diff --git a/src/assignment_io.py b/src/assignment_io.py index 87a43945..c11d3e44 100644 --- a/src/assignment_io.py +++ b/src/assignment_io.py @@ -330,7 +330,7 @@ def find_closests_tsts(self, read_assignment): dists_to_gene_tss = [] dists_to_gene_tts = [] - for t in gene_info.db.children(gene_info.db[gene_id], featuretype='transcript', order_by='start'): + for t in gene_info.db.children(gene_info.db[gene_id], featuretype=('transcript', 'mRNA'), order_by='start'): dists_to_gene_tss.append(self.count_tss_dist(read_assignment, t.id)) dists_to_gene_tts.append(self.count_tts_dist(read_assignment, t.id)) dist_to_gene_tss = dists_to_gene_tss[argmin([abs(x) for x in dists_to_gene_tss])] diff --git a/src/gene_info.py b/src/gene_info.py index 71c572bc..ba53d2aa 100644 --- a/src/gene_info.py +++ b/src/gene_info.py @@ -214,14 +214,14 @@ def get_gene_regions(self): def set_isoform_strands(self): self.isoform_strands = {} for gene_db in self.gene_db_list: - for t in self.db.children(gene_db, featuretype='transcript'): + for t in self.db.children(gene_db, featuretype=('transcript', 'mRNA')): self.isoform_strands[t.id] = t.strand # set isoform_id -> gene_id map def set_gene_ids(self): self.gene_id_map = {} for gene_db in self.gene_db_list: - for t in self.db.children(gene_db, featuretype='transcript'): + for t in self.db.children(gene_db, featuretype=('transcript', 'mRNA')): self.gene_id_map[t.id] = gene_db.id # assigns an ordered list of all known exons and introns to self.exons and self.introns @@ -233,7 +233,7 @@ def set_introns_and_exons(self): all_isoforms_exons = {} for gene_db in self.gene_db_list: - for t in self.db.children(gene_db, featuretype='transcript', order_by='start'): + for t in self.db.children(gene_db, featuretype=('transcript', 'mRNA'), order_by='start'): all_isoforms_exons[t.id] = [] for e in self.db.children(t, order_by='start'): if e.featuretype == 'exon': @@ -370,7 +370,7 @@ def split_exons(self, exons): # calculate junction profiles for known isoforms def set_junction_profiles(self, all_isoforms_introns, all_isoforms_exons): for gene_db in self.gene_db_list: - for t in self.db.children(gene_db, featuretype='transcript', order_by='start'): + for t in self.db.children(gene_db, featuretype=('transcript', 'mRNA'), order_by='start'): transcript_region = self.transcript_region(t.id) # setting up intron profiles for current isoform self.intron_profiles.set_profiles(t.id, all_isoforms_introns[t.id], transcript_region,