本文整理汇总了Python中test.TestUtils.TestUtils.createUnitTestConfig方法的典型用法代码示例。如果您正苦于以下问题:Python TestUtils.createUnitTestConfig方法的具体用法?Python TestUtils.createUnitTestConfig怎么用?Python TestUtils.createUnitTestConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test.TestUtils.TestUtils
的用法示例。
在下文中一共展示了TestUtils.createUnitTestConfig方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _get_chosen_tx_and_transcript_ds
# 需要导入模块: from test.TestUtils import TestUtils [as 别名]
# 或者: from test.TestUtils.TestUtils import createUnitTestConfig [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
示例2: test_retrieve_transcripts_from_region
# 需要导入模块: from test.TestUtils import TestUtils [as 别名]
# 或者: from test.TestUtils.TestUtils import createUnitTestConfig [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)
示例3: test_single_sample_onp_combiner
# 需要导入模块: from test.TestUtils import TestUtils [as 别名]
# 或者: from test.TestUtils.TestUtils import createUnitTestConfig [as 别名]
def test_single_sample_onp_combiner(self):
"""test that we can create an onp combined TCGA maf without crashing"""
input_filename = 'testdata/maflite/onp.singlesample.maf.txt'
output_filename = 'out/testSingleSampleOnpCombiner.maf'
config = TestUtils.createUnitTestConfig()
defaultdb = config.get('DEFAULT',"dbDir")
spec = RunSpecificationFactory.create_run_spec("MAFLITE","TCGAMAF", input_filename, output_filename,
datasource_dir=defaultdb,
other_opts={OptionConstants.INFER_ONPS: True})
annotator = Annotator()
annotator.initialize(spec)
annotator.annotate()
示例4: test_protein_position_off_by_one
# 需要导入模块: from test.TestUtils import TestUtils [as 别名]
# 或者: from test.TestUtils.TestUtils import createUnitTestConfig [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: setUp
# 需要导入模块: from test.TestUtils import TestUtils [as 别名]
# 或者: from test.TestUtils.TestUtils import createUnitTestConfig [as 别名]
def setUp(self):
self.config = TestUtils.createUnitTestConfig()
pass