本文整理汇总了Python中bdgenomics.adam.adamContext.ADAMContext类的典型用法代码示例。如果您正苦于以下问题:Python ADAMContext类的具体用法?Python ADAMContext怎么用?Python ADAMContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ADAMContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_aggregatedCoverage
def test_aggregatedCoverage(self):
testFile = self.resourceFile("small.sam")
ac = ADAMContext(self.ss)
reads = ac.loadAlignments(testFile)
coverage = reads.toCoverage()
collapsed = coverage.aggregatedCoverage(10)
self.assertEquals(collapsed.toDF().count(), 166)
示例2: test_collapse
def test_collapse(self):
testFile = self.resourceFile("sorted.sam")
ac = ADAMContext(self.ss)
reads = ac.loadAlignments(testFile)
coverage = reads.toCoverage()
collapsed = coverage.collapse()
self.assertEquals(collapsed.toDF().count(), coverage.toDF().count())
示例3: test_flatten
def test_flatten(self):
testFile = self.resourceFile("small.sam")
ac = ADAMContext(self.ss)
reads = ac.loadAlignments(testFile)
coverage = reads.toCoverage()
flattened = coverage.flatten()
self.assertEquals(flattened.toDF().count(), 1500)
示例4: test_to_fragments
def test_to_fragments(self):
readsPath = self.resourceFile("unsorted.sam")
ac = ADAMContext(self.ss)
reads = ac.loadAlignments(readsPath)
fragments = reads.toFragments()
self.assertEqual(fragments.toDF().count(), 5)
示例5: test_count_kmers
def test_count_kmers(self):
testFile = self.resourceFile("small.sam")
ac = ADAMContext(self.ss)
reads = ac.loadAlignments(testFile)
kmers = reads.countKmers(6)
self.assertEqual(kmers.count(), 1040)
示例6: test_load_coverage
def test_load_coverage(self):
testFile = self.resourceFile("sample_coverage.bed")
ac = ADAMContext(self.ss)
coverage = ac.loadCoverage(testFile)
self.assertEqual(coverage.toDF().count(), 3)
示例7: test_load_interval_list
def test_load_interval_list(self):
testFile = self.resourceFile("SeqCap_EZ_Exome_v3.hg19.interval_list")
ac = ADAMContext(self.ss)
reads = ac.loadFeatures(testFile)
self.assertEqual(reads.toDF().count(), 369)
self.assertEqual(reads._jvmRdd.jrdd().count(), 369)
示例8: test_load_bed
def test_load_bed(self):
testFile = self.resourceFile("gencode.v7.annotation.trunc10.bed")
ac = ADAMContext(self.ss)
reads = ac.loadFeatures(testFile)
self.assertEqual(reads.toDF().count(), 10)
self.assertEqual(reads._jvmRdd.jrdd().count(), 10)
示例9: test_load_gtf
def test_load_gtf(self):
testFile = self.resourceFile("Homo_sapiens.GRCh37.75.trun20.gtf")
ac = ADAMContext(self.ss)
reads = ac.loadFeatures(testFile)
self.assertEqual(reads.toDF().count(), 15)
self.assertEqual(reads._jvmRdd.jrdd().count(), 15)
示例10: test_load_alignments
def test_load_alignments(self):
testFile = self.resourceFile("small.sam")
ac = ADAMContext(self.ss)
reads = ac.loadAlignments(testFile)
self.assertEqual(reads.toDF().count(), 20)
self.assertEqual(reads._jvmRdd.jrdd().count(), 20)
示例11: test_transform
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)
示例12: test_load_narrowPeak
def test_load_narrowPeak(self):
testFile = self.resourceFile("wgEncodeOpenChromDnaseGm19238Pk.trunc10.narrowPeak")
ac = ADAMContext(self.ss)
reads = ac.loadFeatures(testFile)
self.assertEqual(reads.toDF().count(), 10)
self.assertEqual(reads._jvmRdd.jrdd().count(), 10)
示例13: test_load_contig_fragments
def test_load_contig_fragments(self):
testFile = self.resourceFile("HLA_DQB1_05_01_01_02.fa")
ac = ADAMContext(self.ss)
reads = ac.loadContigFragments(testFile)
self.assertEqual(reads.toDF().count(), 1)
self.assertEqual(reads._jvmRdd.jrdd().count(), 1)
示例14: test_toFeatures
def test_toFeatures(self):
testFile = self.resourceFile("sorted.sam")
ac = ADAMContext(self.ss)
reads = ac.loadAlignments(testFile)
coverage = reads.toCoverage()
features = coverage.toFeatures()
assert(isinstance(features, FeatureRDD))
self.assertEquals(features.toDF().count(), coverage.toDF().count())
示例15: test_transform
def test_transform(self):
readsPath = self.resourceFile("unsorted.sam")
ac = ADAMContext(self.ss)
reads = ac.loadAlignments(readsPath)
transformedReads = reads.transform(lambda x: x.filter(x.referenceName == "1"))
self.assertEqual(transformedReads.toDF().count(), 1)