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


Python ADAMContext.loadGenotypes方法代码示例

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


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

示例1: test_vcf_round_trip

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadGenotypes [as 别名]
    def test_vcf_round_trip(self):
        
        testFile = self.resourceFile("small.vcf")
        ac = ADAMContext(self.ss)
        
        genotypes = ac.loadGenotypes(testFile)

        tmpPath = self.tmpFile() + ".vcf"
        genotypes.toVariantContexts().saveAsVcf(tmpPath)

        savedGenotypes = ac.loadGenotypes(testFile)

        self.assertEquals(genotypes._jvmRdd.jrdd().count(),
                          savedGenotypes._jvmRdd.jrdd().count())
开发者ID:karenfeng,项目名称:adam,代码行数:16,代码来源:genotypeRdd_test.py

示例2: test_transform

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadGenotypes [as 别名]
    def test_transform(self):
        testFile = self.resourceFile("random.vcf")
        ac = ADAMContext(self.ss)

        genotypes = ac.loadGenotypes(testFile)

        transformedGenotypes = genotypes.transform(lambda x: x.filter(x.contigName == '1'))

        self.assertEquals(transformedGenotypes.toDF().count(), 9)
开发者ID:karenfeng,项目名称:adam,代码行数:11,代码来源:genotypeRdd_test.py

示例3: test_load_genotypes

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadGenotypes [as 别名]
    def test_load_genotypes(self):

        
        testFile = self.resourceFile("small.vcf")
        ac = ADAMContext(self.ss)
        
        reads = ac.loadGenotypes(testFile)

        self.assertEqual(reads.toDF().count(), 18)
        self.assertEqual(reads._jvmRdd.jrdd().count(), 18)
开发者ID:bigdatagenomics,项目名称:adam,代码行数:12,代码来源:adamContext_test.py

示例4: test_vcf_add_filter

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadGenotypes [as 别名]
    def test_vcf_add_filter(self):
        
        testFile = self.resourceFile("small.vcf")
        ac = ADAMContext(self.ss)
        
        genotypes = ac.loadGenotypes(testFile)

        tmpPath = self.tmpFile() + ".vcf"
        genotypes.toVariantContexts().addFilterHeaderLine("BAD",
                                                          "Bad variant.").saveAsVcf(tmpPath)

        self.check_for_line_in_file(tmpPath, '##FILTER=<ID=BAD,Description="Bad variant.">')
开发者ID:karenfeng,项目名称:adam,代码行数:14,代码来源:genotypeRdd_test.py

示例5: test_vcf_sort_lex

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadGenotypes [as 别名]
    def test_vcf_sort_lex(self):
    
        testFile = self.resourceFile("random.vcf")
        ac = ADAMContext(self.ss)
        
        genotypes = ac.loadGenotypes(testFile)

        tmpPath = self.tmpFile() + ".vcf"
        genotypes.toVariantContexts().sortLexicographically().saveAsVcf(tmpPath,
                                                                        asSingleFile=True)

        self.checkFiles(tmpPath, self.resourceFile("sorted.lex.vcf", module='adam-cli'))
开发者ID:karenfeng,项目名称:adam,代码行数:14,代码来源:genotypeRdd_test.py

示例6: test_vcf_sort

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadGenotypes [as 别名]
    def test_vcf_sort(self):
    
        testFile = self.resourceFile("random.vcf")
        ac = ADAMContext(self.sc)
        
        genotypes = ac.loadGenotypes(testFile)

        tmpPath = self.tmpFile() + ".vcf"
        genotypes.toVariantContextRDD().sort().saveAsVcf(tmpPath,
                                                         asSingleFile=True)

        self.checkFiles(tmpPath, self.resourceFile("sorted.vcf"))
开发者ID:laserson,项目名称:adam,代码行数:14,代码来源:genotypeRdd_test.py

示例7: test_to_variants

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadGenotypes [as 别名]
    def test_to_variants(self):
        testFile = self.resourceFile("small.vcf")
        ac = ADAMContext(self.ss)

        genotypes = ac.loadGenotypes(testFile)

        variants = genotypes.toVariants()

        self.assertEquals(variants.toDF().count(), 18)

        variants = genotypes.toVariants(dedupe=True)

        self.assertEquals(variants.toDF().count(), 6)
开发者ID:karenfeng,项目名称:adam,代码行数:15,代码来源:genotypeRdd_test.py

示例8: test_vcf_add_format_scalar

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadGenotypes [as 别名]
    def test_vcf_add_format_scalar(self):
        
        testFile = self.resourceFile("small.vcf")
        ac = ADAMContext(self.ss)
        
        genotypes = ac.loadGenotypes(testFile)

        tmpPath = self.tmpFile() + ".vcf"
        genotypes.toVariantContexts().addScalarFormatHeaderLine("SC",
                                                                "Scalar.",
                                                                str).saveAsVcf(tmpPath)

        self.check_for_line_in_file(tmpPath,
                                    '##FORMAT=<ID=SC,Number=1,Type=String,Description="Scalar.">')
开发者ID:karenfeng,项目名称:adam,代码行数:16,代码来源:genotypeRdd_test.py

示例9: test_vcf_add_info_all_array

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadGenotypes [as 别名]
    def test_vcf_add_info_all_array(self):
        
        testFile = self.resourceFile("small.vcf")
        ac = ADAMContext(self.ss)
        
        genotypes = ac.loadGenotypes(testFile)

        tmpPath = self.tmpFile() + ".vcf"
        genotypes.toVariantContexts().addAllAlleleArrayInfoHeaderLine("RA",
                                                                      "Array with # alleles.",
                                                                      float).saveAsVcf(tmpPath)

        self.check_for_line_in_file(tmpPath,
                                    '##INFO=<ID=RA,Number=R,Type=Float,Description="Array with # alleles.">')
开发者ID:karenfeng,项目名称:adam,代码行数:16,代码来源:genotypeRdd_test.py

示例10: test_vcf_add_info_scalar

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadGenotypes [as 别名]
    def test_vcf_add_info_scalar(self):
        
        testFile = self.resourceFile("small.vcf")
        ac = ADAMContext(self.ss)
        
        genotypes = ac.loadGenotypes(testFile)

        tmpPath = self.tmpFile() + ".vcf"
        genotypes.toVariantContexts().addScalarInfoHeaderLine("SC",
                                                              "Scalar.",
                                                              bool).saveAsVcf(tmpPath)

        self.check_for_line_in_file(tmpPath,
                                    '##INFO=<ID=SC,Number=0,Type=Flag,Description="Scalar.">')
开发者ID:karenfeng,项目名称:adam,代码行数:16,代码来源:genotypeRdd_test.py

示例11: test_vcf_add_format_alts_array

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadGenotypes [as 别名]
    def test_vcf_add_format_alts_array(self):
        
        testFile = self.resourceFile("small.vcf")
        ac = ADAMContext(self.ss)
        
        genotypes = ac.loadGenotypes(testFile)

        tmpPath = self.tmpFile() + ".vcf"
        genotypes.toVariantContexts().addAlternateAlleleArrayFormatHeaderLine("AA",
                                                                              "Array with # alts.",
                                                                              chr).saveAsVcf(tmpPath)

        self.check_for_line_in_file(tmpPath,
                                    '##FORMAT=<ID=AA,Number=A,Type=Character,Description="Array with # alts.">')
开发者ID:karenfeng,项目名称:adam,代码行数:16,代码来源:genotypeRdd_test.py

示例12: test_vcf_add_format_genotype_array

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadGenotypes [as 别名]
    def test_vcf_add_format_genotype_array(self):
        
        testFile = self.resourceFile("small.vcf")
        ac = ADAMContext(self.ss)
        
        genotypes = ac.loadGenotypes(testFile)

        tmpPath = self.tmpFile() + ".vcf"
        genotypes.toVariantContexts().addGenotypeArrayFormatHeaderLine("GA",
                                                                       "Array with # genotypes.",
                                                                       float).saveAsVcf(tmpPath)

        self.check_for_line_in_file(tmpPath,
                                    '##FORMAT=<ID=GA,Number=G,Type=Float,Description="Array with # genotypes.">')
开发者ID:karenfeng,项目名称:adam,代码行数:16,代码来源:genotypeRdd_test.py

示例13: test_vcf_add_format_array

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadGenotypes [as 别名]
    def test_vcf_add_format_array(self):
        
        testFile = self.resourceFile("small.vcf")
        ac = ADAMContext(self.ss)
        
        genotypes = ac.loadGenotypes(testFile)

        tmpPath = self.tmpFile() + ".vcf"
        genotypes.toVariantContexts().addFixedArrayFormatHeaderLine("FA4",
                                                                    4,
                                                                    "Fixed array of 4 elements.",
                                                                    int).saveAsVcf(tmpPath)

        self.check_for_line_in_file(tmpPath,
                                    '##FORMAT=<ID=FA4,Number=4,Type=Integer,Description="Fixed array of 4 elements.">')
开发者ID:karenfeng,项目名称:adam,代码行数:17,代码来源:genotypeRdd_test.py


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