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


Python ADAMContext.loadAlignments方法代码示例

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


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

示例1: test_save_as_bam

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

        testFile = self.resourceFile("sorted.sam")
        ac = ADAMContext(self.ss)

        reads = ac.loadAlignments(testFile)
        tmpPath = self.tmpFile() + ".bam"
        reads.saveAsSam(tmpPath,
                        isSorted=True,
                        asSingleFile=True)

        bamReads = ac.loadAlignments(tmpPath)

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

示例2: test_aggregatedCoverage

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadAlignments [as 别名]
    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)
开发者ID:karenfeng,项目名称:adam,代码行数:10,代码来源:coverageRdd_test.py

示例3: test_flatten

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadAlignments [as 别名]
    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)
开发者ID:karenfeng,项目名称:adam,代码行数:10,代码来源:coverageRdd_test.py

示例4: test_collapse

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadAlignments [as 别名]
    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())
开发者ID:karenfeng,项目名称:adam,代码行数:10,代码来源:coverageRdd_test.py

示例5: test_count_kmers

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadAlignments [as 别名]
    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)
开发者ID:bigdatagenomics,项目名称:adam,代码行数:11,代码来源:alignmentRecordDataset_test.py

示例6: test_load_alignments

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadAlignments [as 别名]
    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)
开发者ID:bigdatagenomics,项目名称:adam,代码行数:11,代码来源:adamContext_test.py

示例7: test_to_fragments

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadAlignments [as 别名]
    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)
开发者ID:bigdatagenomics,项目名称:adam,代码行数:11,代码来源:alignmentRecordDataset_test.py

示例8: test_realignIndels_reads

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

        readsPath = self.resourceFile("small.1.sam")

        ac = ADAMContext(self.ss)

        reads = ac.loadAlignments(readsPath)
        realigned = reads.realignIndels()

        self.assertEqual(realigned.toDF().count(), 20)
开发者ID:bigdatagenomics,项目名称:adam,代码行数:12,代码来源:alignmentRecordDataset_test.py

示例9: test_toFeatures

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadAlignments [as 别名]
    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())
开发者ID:karenfeng,项目名称:adam,代码行数:12,代码来源:coverageRdd_test.py

示例10: test_transform

# 需要导入模块: from bdgenomics.adam.adamContext import ADAMContext [as 别名]
# 或者: from bdgenomics.adam.adamContext.ADAMContext import loadAlignments [as 别名]
    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)
开发者ID:bigdatagenomics,项目名称:adam,代码行数:12,代码来源:alignmentRecordDataset_test.py

示例11: test_filterByOverlappingRegion

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

        readsPath = self.resourceFile("unsorted.sam")
        ac = ADAMContext(self.ss)

        reads = ac.loadAlignments(readsPath)

        query = ReferenceRegion("chr2", 1, 400)

        filtered = reads.filterByOverlappingRegion(query)
        self.assertEqual(filtered.toDF().count(), 1)
开发者ID:bigdatagenomics,项目名称:adam,代码行数:13,代码来源:alignmentRecordDataset_test.py

示例12: test_save_unordered_sam

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

        testFile = self.resourceFile("unordered.sam")
        ac = ADAMContext(self.ss)

        reads = ac.loadAlignments(testFile)
        tmpPath = self.tmpFile() + ".sam"
        reads.saveAsSam(tmpPath,
                        asSingleFile=True)

        self.checkFiles(testFile, tmpPath)
开发者ID:bigdatagenomics,项目名称:adam,代码行数:13,代码来源:alignmentRecordDataset_test.py

示例13: test_to_coverage

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

        readsPath = self.resourceFile("unsorted.sam")
        ac = ADAMContext(self.ss)

        reads = ac.loadAlignments(readsPath)

        coverage = reads.toCoverage()
        self.assertEquals(coverage.toDF().count(), 42)

        coverage = reads.toCoverage(collapse = False)
        self.assertEquals(coverage.toDF().count(), 46)
开发者ID:karenfeng,项目名称:adam,代码行数:14,代码来源:alignmentRecordRdd_test.py

示例14: test_save

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

        testFile = self.resourceFile("sorted.sam")
        ac = ADAMContext(self.ss)

        reads = ac.loadAlignments(testFile)
        coverage = reads.toCoverage()
        tmpPath = self.tmpFile() + ".coverage.adam"
        coverage.save(tmpPath,
                              asSingleFile=True,
                            disableFastConcat=True)
    	assert(os.listdir(tmpPath) != [])
开发者ID:karenfeng,项目名称:adam,代码行数:14,代码来源:coverageRdd_test.py

示例15: test_union

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

        testFile1 = self.resourceFile("sorted.sam")
        testFile2 = self.resourceFile("unordered.sam")
        ac = ADAMContext(self.ss)

        reads1 = ac.loadAlignments(testFile1)
        reads2 = ac.loadAlignments(testFile2)

        unionReads = reads1.union([reads2])

        self.assertEqual(unionReads.toDF().count(), 13)
开发者ID:bigdatagenomics,项目名称:adam,代码行数:14,代码来源:alignmentRecordDataset_test.py


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