当前位置: 首页>>代码示例>>Python>>正文


Python TestUtils.createCosmicDatasource方法代码示例

本文整理汇总了Python中TestUtils.TestUtils.createCosmicDatasource方法的典型用法代码示例。如果您正苦于以下问题:Python TestUtils.createCosmicDatasource方法的具体用法?Python TestUtils.createCosmicDatasource怎么用?Python TestUtils.createCosmicDatasource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestUtils.TestUtils的用法示例。


在下文中一共展示了TestUtils.createCosmicDatasource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testRealWorld

# 需要导入模块: from TestUtils import TestUtils [as 别名]
# 或者: from TestUtils.TestUtils import createCosmicDatasource [as 别名]
    def testRealWorld(self):
        """Test that the full COSMIC datasource can retrieve entries by both gp and gpp."""
        gafDS = TestUtils.createTranscriptProviderDatasource(self.config)
        cosmicDS = TestUtils.createCosmicDatasource(self.config)

        # These values are not taken from a real world scenario, but are cooked for this test.

        m = MutationData()
        m.chr = '1'
        m.start = '12941796'
        m.end = '12941796'
        m.ref_allele = "G"
        m.alt_allele = "T"
        m = gafDS.annotate_mutation(m)
        m = cosmicDS.annotate_mutation(m)

        self.assertTrue(m['COSMIC_n_overlapping_mutations'] == '0')

        #1	150483621	150483621
        m = MutationData()
        m.chr = '1'
        m.start = '150483621'
        m.end = '150483621'
        m.ref_allele = "G"
        m.alt_allele = "T"
        m = gafDS.annotate_mutation(m)
        m = cosmicDS.annotate_mutation(m)
开发者ID:alexramos,项目名称:oncotator,代码行数:29,代码来源:CosmicDatasourceTest.py

示例2: testRealWorld

# 需要导入模块: from TestUtils import TestUtils [as 别名]
# 或者: from TestUtils.TestUtils import createCosmicDatasource [as 别名]
    def testRealWorld(self):
        """Test that the full COSMIC datasource can retrieve entries by both gp and gpp."""
        gafDS = TestUtils.createTranscriptProviderDatasource(self.config)
        cosmicDS = TestUtils.createCosmicDatasource(self.config)

        # These values are not taken from a real world scenario, but are cooked for this test.

        m = MutationDataFactory.default_create()
        m.chr = '1'
        m.start = '12941796'
        m.end = '12941796'
        m.ref_allele = "G"
        m.alt_allele = "T"
        m = gafDS.annotate_mutation(m)
        m = cosmicDS.annotate_mutation(m)

        self.assertTrue(m['COSMIC_n_overlapping_mutations'] == '0')

        # # 7:140481411-140481411
        m = MutationDataFactory.default_create()
        m.chr = '7'
        m.start = '140481411'
        m.end = '140481411'
        m.ref_allele = "G"
        m.alt_allele = "T"
        m = gafDS.annotate_mutation(m)
        m = cosmicDS.annotate_mutation(m)

        # As a reminder, the COSMIC datasource does not check the ref and alt allele for a match. (14)
        self.assertTrue(m['COSMIC_n_overlapping_mutations'] == '22')

        # # 7:140481411-140481411
        m = MutationDataFactory.default_create()
        m.chr = '7'
        m.start = '140481411'
        m.end = '140481411'
        m.ref_allele = "G"
        m.alt_allele = "A"
        m = gafDS.annotate_mutation(m)
        m = cosmicDS.annotate_mutation(m)

        # As a reminder, the COSMIC datasource does not check the ref and alt allele for a match. (7)
        self.assertTrue(m['COSMIC_n_overlapping_mutations'] == '22')

        # Test a gpp record
        m = MutationDataFactory.default_create()
        m.createAnnotation("gene", "ABL1")
        m.createAnnotation("transcript_protein_position_start", "255")
        m.createAnnotation("transcript_protein_position_end", "255")

        # These values (chr, start, and end) are incorrect.  This is by design -- just being used as dummy values.
        m.chr = '9'
        m.start = '1'
        m.end = '1'

        m = cosmicDS.annotate_mutation(m)

        # $ grep -P "^ABL1\t" ~/broad_oncotator_configs/CosmicCompleteTargetedScreensMutantExport.tsv/v76/CosmicCompleteTargetedScreensMutantExport.tsv | cut -f 19,24 | sort | egrep "[A-Z]255[A-Z]" | wc
        # 157
        #
        # The rest:
        # $ grep -P "^ABL1\t" ~/broad_oncotator_configs/CosmicCompleteTargetedScreensMutantExport.tsv/v76/CosmicCompleteTargetedScreensMutantExport.tsv | cut -f 19,24 | sort | uniq | egrep "_"
        # p.H295_P296insH	9:133747575-133747576
        # p.K356_K357insE	9:133748407-133748408
        # p.K357_N358insK	9:133748407-133748408
        # p.L184_K274del	9:133738150-133738422
        # p.L248_K274del
        #
        # $ grep -P "^ABL1\t" ~/broad_oncotator_configs/CosmicCompleteTargetedScreensMutantExport.tsv/v76/CosmicCompleteTargetedScreensMutantExport.tsv | cut -f 19,24 | sort | egrep "_K274"
        # p.L184_K274del	9:133738150-133738422
        # p.L184_K274del	9:133738150-133738422
        # p.L248_K274del
        # p.L248_K274del
        #
        # four overlap p.255 + 157 that are exact matches for p.255.
        # 155 + 4 were hematopoietic_and_lymphoid_tissue

        self.assertTrue(m['COSMIC_n_overlapping_mutations'] == str(157 + 4))
        self.assertTrue(m['COSMIC_overlapping_mutation_AAs'].find('255') != -1)
        self.assertTrue(m['COSMIC_overlapping_mutation_AAs'].find('p.L184_K274del') != -1)
        self.assertTrue(m['COSMIC_overlapping_mutation_AAs'].find('p.L248_K274del') != -1)
        self.assertTrue(m['COSMIC_overlapping_primary_sites'].find("haematopoietic_and_lymphoid_tissue(159)") != -1, "Did not have the correct primary sites annotation (haematopoietic_and_lymphoid_tissue(159)): " + m['COSMIC_overlapping_primary_sites'])
开发者ID:Tmacme,项目名称:oncotator,代码行数:84,代码来源:CosmicDatasourceTest.py


注:本文中的TestUtils.TestUtils.createCosmicDatasource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。