Skip to content

Commit

Permalink
Merge pull request #49 from galaxy-genome-annotation/fix-48
Browse files Browse the repository at this point in the history
should fix the addition of the Shine_Dalgarno_sequence
  • Loading branch information
abretaud committed Feb 1, 2021
2 parents 446cdac + 63b565d commit a9d91a7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ Or with the Arrow client:
History
-------

- 4.2.10
- Bugfix handling Shine-Dalgarno sequences (https://github.com/galaxy-genome-annotation/python-apollo/issues/48)
- 4.2.9
- Bugfix to update_organism when using suppress_output
- 4.2.8
Expand Down
16 changes: 12 additions & 4 deletions apollo/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
noncoding_transcript_types = ['transcript', 'tRNA', 'snRNA', 'snoRNA', 'ncRNA', 'rRNA', 'mRNA', 'miRNA', 'guide_RNA',
'RNase_P_RNA', 'telomerase_RNA', 'SRP_RNA', 'lnc_RNA', 'RNase_MRP_RNA', 'scRNA', 'piRNA',
'tmRNA', 'enzymatic_RNA']
single_level_feature_types = ["repeat_region", "terminator", "shine_dalgarno_sequence", "transposable_element"]
single_level_feature_types = ["repeat_region", "terminator", "transposable_element"]

other_genomic_feature_types = ['exon', 'CDS', 'Shine_Dalgarno_sequence', 'non_canonical_three_prime_splice_site',
'non_canonical_five_prime_splice_site']
all_feature_types = gene_types + coding_transcript_types + pseudogenes_types + noncoding_transcript_types + single_level_feature_types + other_genomic_feature_types


def WAAuth(parser):
Expand Down Expand Up @@ -89,7 +93,7 @@ def AssertAdmin(user):


def _tnType(feature):
if feature.type in ('gene', 'mRNA', 'exon', 'CDS', 'terminator', 'tRNA', 'snRNA', 'snoRNA', 'ncRNA', 'rRNA', 'miRNA', 'repeat_region', 'transposable_element', 'pseudogene', 'transcript'):
if feature.type in all_feature_types:
return feature.type
else:
return 'exon'
Expand All @@ -102,9 +106,13 @@ def _yieldGeneData(gene, disable_cds_recalculation=False, use_name=False):
current['children'] = []
for sf in gene.sub_features:
if _tnType(sf) in coding_transcript_types:
current['children'].append(_yieldCodingTranscriptData(sf, disable_cds_recalculation=disable_cds_recalculation, use_name=use_name))
current['children'].append(
_yieldCodingTranscriptData(sf, disable_cds_recalculation=disable_cds_recalculation,
use_name=use_name))
elif _tnType(sf) in noncoding_transcript_types:
current['children'].append(_yieldNonCodingTranscriptData(sf, disable_cds_recalculation=disable_cds_recalculation, use_name=use_name))
current['children'].append(
_yieldNonCodingTranscriptData(sf, disable_cds_recalculation=disable_cds_recalculation,
use_name=use_name))

# # TODO: handle comments
# # TODO: handle dbxrefs
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

setup(
name="apollo",
version='4.2.9',
version='4.2.10',
description="Apollo API library",
long_description=readme,
author="Helena Rasche;Anthony Bretaudeau;Nathan Dunn",
Expand Down

0 comments on commit a9d91a7

Please sign in to comment.