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


Python Chromosome.align_experiments方法代码示例

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


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

示例1: test_03_tad_multi_aligner

# 需要导入模块: from pytadbit import Chromosome [as 别名]
# 或者: from pytadbit.Chromosome import align_experiments [as 别名]
    def test_03_tad_multi_aligner(self):

        if CHKTIME:
            t0 = time()

        test_chr = Chromosome(name='Test Chromosome', centromere_search=True,
                              experiment_tads=[exp1, exp2, exp3, exp4],
                              experiment_hic_data=[
                                  PATH + '/40Kb/chrT/chrT_A.tsv',
                                  PATH + '/20Kb/chrT/chrT_B.tsv',
                                  PATH + '/20Kb/chrT/chrT_C.tsv',
                                  PATH + '/20Kb/chrT/chrT_D.tsv'],
                              experiment_names=['exp1', 'exp2', 'exp3', 'exp4'],
                              experiment_resolutions=[40000,20000,20000,20000],
                              silent=True)
        for exp in test_chr.experiments:
            exp.normalize_hic(silent=True, factor=None)

        test_chr.align_experiments(verbose=False, randomize=False,
                                   method='global')
        _, (score1, pval1) = test_chr.align_experiments(verbose=False,
                                                        method='global',
                                                        randomize=True, rnd_num=100)
        _, (_, pval2) = test_chr.align_experiments(verbose=False, randomize=True,
                                                   rnd_method='shuffle', rnd_num=100)
        # Values with alignments obtained with square root normalization.
        #self.assertEqual(round(-26.095, 3), round(score1, 3))
        #self.assertEqual(round(0.001, 1), round(pval1, 1))
        #self.assertTrue(abs(0.175 - pval2) < 0.2)
        self.assertEqual(round(-11.002, 3), round(score1, 3))
        self.assertEqual(round(0.001, 1), round(pval1, 1))
        self.assertTrue(abs(0.04 - pval2) < 0.1)
        if CHKTIME:
            print '3', time() - t0
开发者ID:mrG7,项目名称:TADbit,代码行数:36,代码来源:test_all.py

示例2: test_03_tad_multi_aligner

# 需要导入模块: from pytadbit import Chromosome [as 别名]
# 或者: from pytadbit.Chromosome import align_experiments [as 别名]
    def test_03_tad_multi_aligner(self):
        test_chr = Chromosome(name='Test Chromosome',
                              tad_handlers=[exp1, exp2, exp3, exp4],
                              experiment_names=['exp1', 'exp2', 'exp3', 'exp4'],
                              experiment_resolutions=[40000,20000,20000,20000])

        test_chr.align_experiments(verbose=False, randomize=False,method='global')
        score1, pval1 = test_chr.align_experiments(verbose=False,method='global',
                                                   randomize=True)
        _, pval2 = test_chr.align_experiments(verbose=False, randomize=True,
                                              rnd_method='shuffle')
        self.assertEqual(round(-26.095, 3), round(score1, 3))
        self.assertEqual(round(0.001, 1), round(pval1, 1))
        self.assertTrue(abs(0.175 - pval2) < 0.2)
开发者ID:fransua,项目名称:tadbit_R,代码行数:16,代码来源:test_all.py

示例3: test_03_tad_multi_aligner

# 需要导入模块: from pytadbit import Chromosome [as 别名]
# 或者: from pytadbit.Chromosome import align_experiments [as 别名]
    def test_03_tad_multi_aligner(self):

        test_chr = Chromosome(name='Test Chromosome',
                              experiment_tads=[exp1, exp2, exp3, exp4],
                              experiment_hic_data=['40Kb/chrT/chrT_A.tsv', '20Kb/chrT/chrT_B.tsv', '20Kb/chrT/chrT_C.tsv', '20Kb/chrT/chrT_D.tsv'],
                              experiment_names=['exp1', 'exp2', 'exp3', 'exp4'],
                              experiment_resolutions=[40000,20000,20000,20000])
        for exp in test_chr.experiments: exp.normalize_hic(method='visibility')

        test_chr.align_experiments(verbose=False, randomize=False,
                                   method='global')
        score1, pval1 = test_chr.align_experiments(verbose=False,method='global',
                                                   randomize=True)
        _, pval2 = test_chr.align_experiments(verbose=False, randomize=True,
                                              rnd_method='shuffle')
        self.assertEqual(round(-26.095, 3), round(score1, 3))
        self.assertEqual(round(0.001, 1), round(pval1, 1))
        self.assertTrue(abs(0.175 - pval2) < 0.2)
开发者ID:dbau,项目名称:tadbit,代码行数:20,代码来源:test_all.py

示例4: test_03_tad_multi_aligner

# 需要导入模块: from pytadbit import Chromosome [as 别名]
# 或者: from pytadbit.Chromosome import align_experiments [as 别名]
    def test_03_tad_multi_aligner(self):

        if ONLY and ONLY != "03":
            return
        if CHKTIME:
            t0 = time()

        test_chr = Chromosome(
            name="Test Chromosome",
            centromere_search=True,
            experiment_tads=[exp1, exp2, exp3, exp4],
            experiment_hic_data=[
                PATH + "/40Kb/chrT/chrT_A.tsv",
                PATH + "/20Kb/chrT/chrT_B.tsv",
                PATH + "/20Kb/chrT/chrT_C.tsv",
                PATH + "/20Kb/chrT/chrT_D.tsv",
            ],
            experiment_names=["exp1", "exp2", "exp3", "exp4"],
            experiment_resolutions=[40000, 20000, 20000, 20000],
            silent=True,
        )
        for exp in test_chr.experiments:
            exp.normalize_hic(silent=True, factor=None)

        test_chr.align_experiments(verbose=False, randomize=False, method="global")
        _, (score1, pval1, perc1, perc2) = test_chr.align_experiments(
            verbose=False, method="global", randomize=True, rnd_num=100
        )
        _, (_, pval2, perc1, perc2) = test_chr.align_experiments(
            verbose=False, randomize=True, rnd_method="shuffle", rnd_num=100
        )
        # Values with alignments obtained with square root normalization.
        # self.assertEqual(round(-26.095, 3), round(score1, 3))
        # self.assertEqual(round(0.001, 1), round(pval1, 1))
        # self.assertTrue(abs(0.175 - pval2) < 0.2)
        self.assertEqual(round(-11.002, 3), round(score1, 3))
        self.assertEqual(round(0.001, 1), round(pval1, 1))
        self.assertTrue(abs(0.04 - pval2) < 0.1)
        if CHKTIME:
            print "3", time() - t0
开发者ID:MarcoDiS,项目名称:TADbit,代码行数:42,代码来源:test_all.py

示例5: test_tad_multi_aligner

# 需要导入模块: from pytadbit import Chromosome [as 别名]
# 或者: from pytadbit.Chromosome import align_experiments [as 别名]
 def test_tad_multi_aligner(self):
     exp1 = tadbit("chrT/chrT_A.tsv", max_tad_size="auto", verbose=False, no_heuristic=False)
     exp2 = tadbit("chrT/chrT_B.tsv", max_tad_size="auto", verbose=False, no_heuristic=False)
     exp3 = tadbit("chrT/chrT_C.tsv", max_tad_size="auto", verbose=False, no_heuristic=False)
     exp4 = tadbit("chrT/chrT_D.tsv", max_tad_size="auto", verbose=False, no_heuristic=False)
     test_chr = Chromosome(
         name="Test Chromosome",
         resolution=20000,
         experiments=[exp1, exp2, exp3, exp4],
         experiment_names=["exp1", "exp2", "exp3", "exp4"],
     )
     score, pval = test_chr.align_experiments(verbose=False, randomize=True)
     self.assertEqual(round(19.555803, 3), round(score, 3))
     self.assertEqual(round(0.4, 1), round(pval, 1))
开发者ID:gui11aume,项目名称:tadbit,代码行数:16,代码来源:test_all.py

示例6: Chromosome

# 需要导入模块: from pytadbit import Chromosome [as 别名]
# 或者: from pytadbit.Chromosome import align_experiments [as 别名]
# initiate a chromosome object that will store all Hi-C data and analysis
my_chrom = Chromosome(name='My fisrt chromsome')

# load Hi-C data
my_chrom.add_experiment('First Hi-C experiment', xp_handler="sample_data/HIC_k562_chr19_chr19_100000_obs.txt", resolution=100000)
my_chrom.add_experiment('Second Hi-C experiment', xp_handler="sample_data/HIC_gm06690_chr19_chr19_100000_obs.txt", resolution=100000)

# run core tadbit function to find TADs, on each experiment
my_chrom.find_tad('First Hi-C experiment' , n_cpus=8, verbose=False)
my_chrom.find_tad('Second Hi-C experiment', n_cpus=8, verbose=False)

print my_chrom.experiments


my_chrom.align_experiments(names=["First Hi-C experiment", "Second Hi-C experiment"])

print my_chrom.alignment

ali = my_chrom.alignment[('First Hi-C experiment', 'Second Hi-C experiment')]


print ali.write_alignment(ftype='html')

score, pval = my_chrom.align_experiments(randomize=True, rnd_num=1000)
print score, pval


score, pval = my_chrom.align_experiments(randomize=True, rnd_method="shuffle", rnd_num=1000)
print score, pval
开发者ID:3DGenomes,项目名称:TADbit,代码行数:31,代码来源:tutorial.py


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