本文整理汇总了Python中test.TestUtils.TestUtils.createTranscriptProviderDatasource方法的典型用法代码示例。如果您正苦于以下问题:Python TestUtils.createTranscriptProviderDatasource方法的具体用法?Python TestUtils.createTranscriptProviderDatasource怎么用?Python TestUtils.createTranscriptProviderDatasource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test.TestUtils.TestUtils
的用法示例。
在下文中一共展示了TestUtils.createTranscriptProviderDatasource方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_appris_selects_transcript
# 需要导入模块: from test.TestUtils import TestUtils [as 别名]
# 或者: from test.TestUtils.TestUtils import createTranscriptProviderDatasource [as 别名]
def test_appris_selects_transcript(self):
m = MutationDataFactory.default_create(chr="2", start="201722365", end="201722366", ref_allele="AC", alt_allele="-", build="hg19")
transcript_ds = TestUtils.createTranscriptProviderDatasource(self.config)
m = transcript_ds.annotate_mutation(m)
tx = transcript_ds.get_transcript(m['annotation_transcript'])
self.assertTrue(tx is not None, "Transcript was None when it should have been found. Does the ground truth transcript above need to be updated?")
self.assertEqual(tx._transcript_id,'ENST00000321356.4')
示例2: _get_chosen_tx_and_transcript_ds
# 需要导入模块: from test.TestUtils import TestUtils [as 别名]
# 或者: from test.TestUtils.TestUtils import createTranscriptProviderDatasource [as 别名]
def _get_chosen_tx_and_transcript_ds(self, chrom, loc):
config = TestUtils.createUnitTestConfig()
transcript_ds = TestUtils.createTranscriptProviderDatasource(config)
transcript_ds.set_tx_mode(TranscriptProvider.TX_MODE_CANONICAL)
start_txs = transcript_ds.get_transcripts_by_pos(chr=chrom, start=str(loc), end=str(loc))
chosen_tx = transcript_ds._choose_transcript(start_txs, transcript_ds.get_tx_mode(),
VariantClassification.VT_SNP, "", "", str(loc), str(loc))
return chosen_tx, transcript_ds
示例3: test_retrieve_transcripts_from_region
# 需要导入模块: from test.TestUtils import TestUtils [as 别名]
# 或者: from test.TestUtils.TestUtils import createTranscriptProviderDatasource [as 别名]
def test_retrieve_transcripts_from_region(self):
"""Test that we can retrieve a large number of transcripts. Requires a full gencode datasource."""
config = TestUtils.createUnitTestConfig()
transcript_ds = TestUtils.createTranscriptProviderDatasource(config)
filtered_txs = transcript_ds.get_transcripts_by_pos(chr="1", start="1", end="100000000")
self.assertTrue(len(filtered_txs) > 4000)
gene_set = set([tx.get_gene() for tx in filtered_txs])
self.assertTrue(len(gene_set) > 1500)
示例4: test_protein_position_off_by_one
# 需要导入模块: from test.TestUtils import TestUtils [as 别名]
# 或者: from test.TestUtils.TestUtils import createTranscriptProviderDatasource [as 别名]
def test_protein_position_off_by_one(self, chrom, start, end, ref, alt, gt_prot_change):
config = TestUtils.createUnitTestConfig()
transcript_ds = TestUtils.createTranscriptProviderDatasource(config)
cc_txs_fp = file("testdata/tx_exact_uniprot_matches.txt", 'r')
cc_txs = [tx.rsplit(".", 1)[0] for tx in cc_txs_fp]
cc_txs.append("ENST00000338368") # Add a transcript that is not exactly the same, but close
cc_txs_fp.close()
transcript_ds.set_custom_canonical_txs(cc_txs)
m = MutationDataFactory.default_create()
m.chr = chrom
m.start = start
m.end = end
m.ref_allele = ref
m.alt_allele = alt
m2 = transcript_ds.annotate_mutation(m)
self.assertEqual(m2['protein_change'], gt_prot_change)
示例5: test_3_prime_flank_annotation_negative_strand
# 需要导入模块: from test.TestUtils import TestUtils [as 别名]
# 或者: from test.TestUtils.TestUtils import createTranscriptProviderDatasource [as 别名]
def test_3_prime_flank_annotation_negative_strand(self):
m = MutationDataFactory.default_create(chr="5", start="1253255", end="1253255", ref_allele="A", alt_allele="T", build="hg19")
transcript_ds = TestUtils.createTranscriptProviderDatasource(self.config)
m = transcript_ds.annotate_mutation(m)
self.assertEqual(m['variant_classification'], "3'Flank")
示例6: test_not_5_prime_flank_annotation_positive_strand
# 需要导入模块: from test.TestUtils import TestUtils [as 别名]
# 或者: from test.TestUtils.TestUtils import createTranscriptProviderDatasource [as 别名]
def test_not_5_prime_flank_annotation_positive_strand(self):
m = MutationDataFactory.default_create(chr="3", start="180625088", end="180625088", ref_allele="C", alt_allele="A", build="hg19")
transcript_ds = TestUtils.createTranscriptProviderDatasource(self.config)
m = transcript_ds.annotate_mutation(m)
self.assertEqual(m['variant_classification'], "IGR")