Skip to content

Commit

Permalink
Explore dropping CDSs
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed Jan 26, 2024
1 parent 1257e05 commit f264a39
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions apollo/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,28 @@ def _yieldGeneData(gene, disable_cds_recalculation=False, use_name=False):
# # TODO: handle description
# # TODO: handle GO, Gene Product, Provenance

def __floc(location):
return f"{location['fmin']}-{location['fmax']}-{location['strand']}"

for child1 in current['children']:
exon_regions = []
for child1 in current['children']:
for child in child1['children']:
print(child)
if child['type']['name'] == 'exon':
exon_regions.append(__floc(child['location']))
new_current_children = []
for child in child1['children']:
if child['type']['name'] == 'CDS':
continue
nnn = __floc(child['location'])
if nnn not in exon_regions:
new_current_children.append(child)
else:
new_current_children.append(child)
child1['children'] = new_current_children
print(exon_regions)

if 'children' in current and gene.type == 'gene':
# Only sending mRNA level as apollo is more comfortable with orphan mRNAs
return current['children']
Expand Down

0 comments on commit f264a39

Please sign in to comment.