diff --git a/tests/data/txinfo.gz b/tests/data/txinfo.gz index a2f4776..defe0e2 100644 Binary files a/tests/data/txinfo.gz and b/tests/data/txinfo.gz differ diff --git a/tests/test_uta_loading.py b/tests/test_uta_loading.py index 49188c5..28595f7 100644 --- a/tests/test_uta_loading.py +++ b/tests/test_uta_loading.py @@ -207,6 +207,24 @@ def test_load_txinfo(self): }, ) + transcript.self.session.query(usam.Transcript).filter(usam.Transcript.ac == 'NC_012920.1_09206_09990').one() + self.assertEqual( + { + 'ac': transcript.ac, + 'gene_id': transcript.gene_id, + 'cds_start_i': transcript.cds_start_i, + 'cds_end_i': transcript.cds_end_i, + 'codon_table': transcript.codon_table, + }, + { + 'ac': 'NC_012920.1_09206_09990', + 'gene_id': '4514', + 'cds_start_i': 0, + 'cds_end_i': 784, + 'codon_table': 2, + }, + ) + exon_set = self.session.query(usam.ExonSet).filter(usam.ExonSet.tx_ac == 'NM_080430.4').one() exons = self.session.query(usam.Exon).filter(usam.Exon.exon_set_id == exon_set.exon_set_id).all() self.assertEqual(len(exons), 5) diff --git a/tests/test_uta_parsers_seqrecord.py b/tests/test_uta_parsers_seqrecord.py index 092ed63..6ff2102 100644 --- a/tests/test_uta_parsers_seqrecord.py +++ b/tests/test_uta_parsers_seqrecord.py @@ -27,6 +27,7 @@ class TestSeqRecordFacade(unittest.TestCase): expected_cds_translation="MAESGRPWAQARSAYRASEVLRRGTGRRRDPGPQSNGPGQEDARAPGRMARLRGQLRAEAASRSEVPRLLKLVERAGAG" \ "AAGAGERTGAHSRGSVCSVCGEPRGGATYPAGVLEVSERRLQEGLAAVREELGAGIEALRAELRAELDALRALLPPPPSPPARREPRAVPRAAPRGPTLP" \ "RTLGTVSALVAASRPADDAPDGPAECGAHRAPARKNHKKMPVPPGAPQGGGD", + expected_codon_table=1, expected_exons_se_i=[(0, 696)], ), param( @@ -49,6 +50,7 @@ class TestSeqRecordFacade(unittest.TestCase): "EDIDECALPTGGHICSYRCINIPGSFQCSCPSSGYRLAPNGRNCQDIDECVTGIHNCSINETCFNIQGGFRCLAFECPENYRRSAATRCERLPCHENREC" \ "SKLPLRITYYHLSFPTNIQAPAVVFRMGPSSAVPGDSMQLAITGGNEEGFFTTRKVSPHSGVVALTKPVPEPRDLLLTVKMDLSRHGTVSSFVAKLFIFV" \ "SAEL", + expected_codon_table=1, expected_exons_se_i=[ (0, 182), (182, 288), @@ -80,6 +82,7 @@ class TestSeqRecordFacade(unittest.TestCase): expected_cds_product=None, expected_cds_protein_id=None, expected_cds_translation=None, + expected_codon_table=None, expected_exons_se_i=[], ), param( @@ -95,6 +98,7 @@ class TestSeqRecordFacade(unittest.TestCase): expected_cds_product=None, expected_cds_protein_id=None, expected_cds_translation=None, + expected_codon_table=None, expected_exons_se_i=[], ), ]) @@ -112,6 +116,7 @@ def test_seq_record_facade( expected_cds_product, expected_cds_protein_id, expected_cds_translation, + expected_codon_table, expected_exons_se_i, ): gbff_file = os.path.join(self.test_data_dir, file_name) @@ -127,18 +132,9 @@ def test_seq_record_facade( assert self.seq_record_facade.cds_product == expected_cds_product assert self.seq_record_facade.cds_protein_id == expected_cds_protein_id assert self.seq_record_facade.cds_translation == expected_cds_translation + assert self.seq_record_facade.codon_table == expected_codon_table assert self.seq_record_facade.exons_se_i == expected_exons_se_i - # @parameterized.expand([ @parameterized.expand([ - # param('no genes', features={}), - # param('no genes', features={'gene': []}), - # param('more than one gene', features={'gene': [Mock(), Mock()]}), - # param('more than one CDS', features={'CDS': [Mock(), Mock()]}), - # ]) - # def test_validate_features_by_type_invalid(self, test_name, features): - # with self.assertRaises(SeqRecordFeatureError): - # SeqRecordFacade.validate_features_by_type(features) - @parameterized.expand([ param("no gene feature", gene_feature_mock={}), param("gene feature is None", gene_feature_mock={"gene": None}),