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