本文整理汇总了Python中pymodule.PassingData.npute_window_size方法的典型用法代码示例。如果您正苦于以下问题:Python PassingData.npute_window_size方法的具体用法?Python PassingData.npute_window_size怎么用?Python PassingData.npute_window_size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymodule.PassingData
的用法示例。
在下文中一共展示了PassingData.npute_window_size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: doFilter
# 需要导入模块: from pymodule import PassingData [as 别名]
# 或者: from pymodule.PassingData import npute_window_size [as 别名]
def doFilter(
self,
snpData,
snpData_qc_strain,
snpData_qc_snp,
min_call_probability,
max_call_mismatch_rate,
max_call_NA_rate,
max_snp_mismatch_rate,
max_snp_NA_rate,
npute_window_size,
output_dir=None,
):
"""
2009-10-11
replace imputeData() with NPUTE.samplingImpute(..., no_of_accessions_per_sampling=300, coverage=3) to avoid memory blowup.
2008-12-22
replace '=' and ',' with '_' in the output filename
2008-05-19
matrix_ls has to be of length >0 before concatenation
2008-05-19
use SNPData structure
2008-05-18
add onlyCommon=True to FilterAccessions.filterByError()
2008-05-17
add argument output_dir. if it's available, output data matrix before and after imputation
2008-05-12
add
qcdata.no_of_accessions_filtered_by_mismatch
qcdata.no_of_accessions_filtered_by_na
qcdata.no_of_snps_filtered_by_mismatch
qcdata.no_of_snps_filtered_by_na
qcdata.no_of_monomorphic_snps_removed
2008-05-11
split up from computing_node_handler
"""
qcdata = PassingData()
twoSNPData = TwoSNPData(
SNPData1=snpData, SNPData2=snpData_qc_strain, row_matching_by_which_value=0, debug=self.debug
)
row_id2NA_mismatch_rate = twoSNPData.cmp_row_wise()
del twoSNPData
newSnpData = SNPData.removeRowsByMismatchRate(snpData, row_id2NA_mismatch_rate, max_call_mismatch_rate)
qcdata.no_of_accessions_filtered_by_mismatch = newSnpData.no_of_rows_filtered_by_mismatch
newSnpData = SNPData.removeRowsByNARate(newSnpData, max_call_NA_rate)
qcdata.no_of_accessions_filtered_by_na = newSnpData.no_of_rows_filtered_by_na
twoSNPData = TwoSNPData(
SNPData1=newSnpData, SNPData2=snpData_qc_snp, row_matching_by_which_value=0, debug=self.debug
)
col_id2NA_mismatch_rate = twoSNPData.cmp_col_wise()
del twoSNPData
newSnpData = SNPData.removeColsByMismatchRate(newSnpData, col_id2NA_mismatch_rate, max_snp_mismatch_rate)
qcdata.no_of_snps_filtered_by_mismatch = newSnpData.no_of_cols_filtered_by_mismatch
newSnpData = SNPData.removeColsByNARate(newSnpData, max_snp_NA_rate)
qcdata.no_of_snps_filtered_by_na = newSnpData.no_of_cols_filtered_by_na
twoSNPData = TwoSNPData(
SNPData1=newSnpData, SNPData2=snpData_qc_snp, row_matching_by_which_value=0, debug=self.debug
)
newSnpData = twoSNPData.mergeTwoSNPData(priority=2)
del twoSNPData
# MergeSnpsData.merge(snpsd_250k_tmp, snpsd_ls_qc_snp, unionType=0, priority=2)
newSnpData = SNPData.removeMonomorphicCols(newSnpData)
qcdata.no_of_monomorphic_snps_removed = newSnpData.no_of_monomorphic_cols
# FilterSnps.filterMonomorphic(snpsd_250k_tmp)
if output_dir:
# output data here
if not os.path.isdir(output_dir):
os.makedirs(output_dir)
output_fname_prefix_ls = [
"min_oligo_call_probability_%s" % min_call_probability,
"max_array_mismatch_rate_%s" % max_call_mismatch_rate,
"max_array_NA_rate_%s" % max_call_NA_rate,
"max_snp_mismatch_rate_%s" % max_snp_mismatch_rate,
"max_snp_NA_rate_%s" % max_snp_NA_rate,
"npute_window_size_%s" % npute_window_size,
]
output_fname = os.path.join(output_dir, "_".join(output_fname_prefix_ls + ["before_imputation.tsv"]))
newSnpData.tofile(output_fname)
# chromosomes = [snpsd_250k_tmp[i].chromosome for i in range(len(snpsd_250k_tmp))]
# snpsdata.writeRawSnpsDatasToFile(output_fname, snpsd_250k_tmp, chromosomes=chromosomes, deliminator=',', withArrayIds = True)
"""
qcdata.no_of_snps_filtered_by_mismatch = 0
qcdata.no_of_snps_filtered_by_na = 0
qcdata.no_of_monomorphic_snps_removed = 0
for snpsd in snpsd_250k_tmp:
qcdata.no_of_snps_filtered_by_mismatch += snpsd.no_of_snps_filtered_by_mismatch
qcdata.no_of_snps_filtered_by_na += snpsd.no_of_snps_filtered_by_na
qcdata.no_of_monomorphic_snps_removed += snpsd.no_of_monomorphic_snps_removed
"""
#.........这里部分代码省略.........