當前位置: 首頁>>代碼示例>>Python>>正文


Python PassingData.npute_window_size方法代碼示例

本文整理匯總了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
		"""

#.........這裏部分代碼省略.........
開發者ID:,項目名稱:,代碼行數:103,代碼來源:


注:本文中的pymodule.PassingData.npute_window_size方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。