本文整理汇总了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())
示例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)
示例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)
示例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.">')
示例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'))
示例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"))
示例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)
示例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.">')
示例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.">')
示例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.">')
示例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.">')
示例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.">')
示例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.">')