本文整理汇总了Python中Population.Population.from_population_file方法的典型用法代码示例。如果您正苦于以下问题:Python Population.from_population_file方法的具体用法?Python Population.from_population_file怎么用?Python Population.from_population_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Population.Population
的用法示例。
在下文中一共展示了Population.from_population_file方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: pos_dict
# 需要导入模块: from Population import Population [as 别名]
# 或者: from Population.Population import from_population_file [as 别名]
def pos_dict(gd_indivs_file, input_type):
rv = {}
p = Population()
p.from_population_file(gd_indivs_file)
for tag in p.tag_list():
column, name = tag.split(':')
column = int(column) - 1
if input_type == 'gd_genotype':
column -= 2
rv[name] = column
return rv
示例2: len
# 需要导入模块: from Population import Population [as 别名]
# 或者: from Population.Population import from_population_file [as 别名]
import gd_util
import sys
from Population import Population
################################################################################
if len(sys.argv) != 13:
gd_util.die('Usage')
input, p1_input, p2_input, input_type, data_source, min_reads, min_qual, retain, discard_fixed, biased, output, ind_arg = sys.argv[1:]
p_total = Population()
p_total.from_wrapped_dict(ind_arg)
p1 = Population()
p1.from_population_file(p1_input)
if not p_total.is_superset(p1):
gd_util.die('There is an individual in population 1 that is not in the SNP table')
p2 = Population()
p2.from_population_file(p2_input)
if not p_total.is_superset(p2):
gd_util.die('There is an individual in population 2 that is not in the SNP table')
################################################################################
prog = 'Fst_column'
args = [ prog ]
args.append(input)
args.append(data_source)
示例3: int
# 需要导入模块: from Population import Population [as 别名]
# 或者: from Population.Population import from_population_file [as 别名]
if p_type == 'gd_genotype':
column = int(column) - 2
the_list.append('{0}:{1}:{2}'.format(val, column, name))
################################################################################
if len(sys.argv) != 11:
gd_util.die('Usage')
snp_input, snp_ext, snp_arg, cov_input, cov_ext, cov_arg, indiv_input, min_coverage, req_thresh, output = sys.argv[1:]
p_snp = load_pop(snp_input, snp_arg)
p_cov = load_pop(cov_input, cov_arg)
p_ind = Population()
p_ind.from_population_file(indiv_input)
if not p_snp.is_superset(p_ind):
gd_util.die('There is an individual in the population individuals that is not in the SNP/Genotype table')
if p_cov is not None and (not p_cov.is_superset(p_ind)):
gd_util.die('There is an individual in the population individuals that is not in the Coverage table')
################################################################################
prog = 'mito_pi'
args = [ prog ]
args.append(snp_input)
args.append(cov_input)
args.append(min_coverage)
示例4: load_and_check_pop
# 需要导入模块: from Population import Population [as 别名]
# 或者: from Population.Population import from_population_file [as 别名]
def load_and_check_pop(name, file, total_pop):
p = Population(name=name)
p.from_population_file(file)
if not total_pop.is_superset(p):
gd_util.die('There is an individual in {0} that is not in the SNP table'.format(name))
return p
示例5: Population
# 需要导入模块: from Population import Population [as 别名]
# 或者: from Population.Population import from_population_file [as 别名]
args = [ prog ]
args.append(input)
args.append(data_source)
user_coverage_file = os.path.join(extra_files_path, 'coverage.txt')
args.append(user_coverage_file)
population_list = []
if all_individuals:
tags = p_total.tag_list()
elif p1_input is not None:
p1 = Population()
this_pop = Population()
this_pop.from_population_file(p1_input)
population_list.append(this_pop)
p1.from_population_file(p1_input)
if not p_total.is_superset(p1):
gd_util.die('There is an individual in the population that is not in the SNP table')
tags = p1.tag_list()
else:
tags = []
for population_file, population_name in population_info:
population = Population()
this_pop = Population()
this_pop.from_population_file(population_file)
population_list.append(this_pop)
population.from_population_file(population_file)
if not p_total.is_superset(population):
gd_util.die('There is an individual in the {} population that is not in the SNP table'.format(population_name))
示例6: len
# 需要导入模块: from Population import Population [as 别名]
# 或者: from Population.Population import from_population_file [as 别名]
import gd_util
from Population import Population
################################################################################
if len(sys.argv) != 6:
gd_util.die('Usage')
input, input_type, ind_arg, pop_input, output = sys.argv[1:]
p_total = Population()
p_total.from_wrapped_dict(ind_arg)
p1 = Population()
p1.from_population_file(pop_input)
if not p_total.is_superset(p1):
gd_util.die('There is an individual in the population that is not in the SNP table')
################################################################################
prog = 'kinship_prep'
args = [ prog ]
args.append(input) # a Galaxy SNP table
args.append(0) # required number of reads for each individual to use a SNP
args.append(0) # required genotype quality for each individual to use a SNP
args.append(0) # minimum spacing between SNPs on the same scaffold
for tag in p1.tag_list():
if input_type == 'gd_genotype':
示例7: Population
# 需要导入模块: from Population import Population [as 别名]
# 或者: from Population.Population import from_population_file [as 别名]
p_total = Population()
p_total.from_wrapped_dict(ind_arg)
individual_population = {}
population_list = []
if all_individuals:
p1 = p_total
p1.name = 'All Individuals'
population_list.append(p1)
else:
p1 = Population()
for file, name in population_files:
this_pop = Population(name)
this_pop.from_population_file(file)
population_list.append(this_pop)
for tag in this_pop.tag_list():
if tag not in individual_population:
individual_population[tag] = name
# add individuals from this file to p1
p1.from_population_file(file)
if not p_total.is_superset(p1):
gd_util.die('There is an individual in the population that is not in the SNP table')
################################################################################
示例8: len
# 需要导入模块: from Population import Population [as 别名]
# 或者: from Population.Population import from_population_file [as 别名]
import gd_util
import sys
from Population import Population
################################################################################
if len(sys.argv) != 7:
gd_util.die('Usage')
gd_saps_file, gd_snps_file, covered_intervals_file, gd_indivs_file, output_file, ind_arg = sys.argv[1:]
p_total = Population()
p_total.from_wrapped_dict(ind_arg)
p1 = Population()
p1.from_population_file(gd_indivs_file)
if not p_total.is_superset(p1):
gd_util.die('There is an individual in the population individuals that is not in the SNP table')
################################################################################
prog = 'get_pi'
args = [ prog ]
args.append(gd_saps_file)
args.append(gd_snps_file)
args.append(covered_intervals_file)
columns = p1.column_list()
for column in columns:
args.append(column)