0b945ec36b2fc84fc56a130441d677f4c74b93aa,workers/data_refinery_workers/processors/create_compendia.py,,_perform_imputation,#Any#,68

Before Change


    filtered_combined_matrix_samples = filtered_combined_matrix.dropna(axis=1, thresh=thresh, how="any")

    // "Reset" zero values that were set to NA in RNA-seq samples (i.e., make these zero again) in combined_matrix
    combined_matrix_zero = filtered_combined_matrix_samples.fillna(value=0)

    // Transpose combined_matrix; transposed_matrix
    transposed_matrix = combined_matrix_zero.transpose()

After Change


    transposed_matrix = combined_matrix_zero.transpose()

    // Remove -inf and inf
    transposed_matrix = transposed_matrix.replace([np.inf, -np.inf], np.nan)

    // Perform imputation of missing values with IterativeSVD (rank=10) on the transposed_matrix; imputed_matrix
    imputed_matrix = IterativeSVD(rank=10).fit_transform(transposed_matrix)

    // Untranspose imputed_matrix (genes are now rows, samples are now columns)
    untransposed_imputed_matrix = imputed_matrix.transpose()

    // Convert back to Pandas
    untransposed_imputed_matrix_df = pd.DataFrame.from_records(untransposed_imputed_matrix)
    untransposed_imputed_matrix_df.index = combined_matrix_zero.index
    untransposed_imputed_matrix_df.columns = combined_matrix_zero.columns

    // Quantile normalize imputed_matrix where genes are rows and samples are columns
    // XXX: Refactor QN target acquisition and application before doing this
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: AlexsLemonade/refinebio
Commit Name: 0b945ec36b2fc84fc56a130441d677f4c74b93aa
Time: 2018-11-09
Author: miserlou@gmail.com
File Name: workers/data_refinery_workers/processors/create_compendia.py
Class Name:
Method Name: _perform_imputation


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 9ed54295701c9207c1f777a3f5fa9ede51c96a14
Time: 2017-09-24
Author: yutiansut@qq.com
File Name: QUANTAXIS/QAData/data_fq.py
Class Name:
Method Name: QA_data_make_qfq


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 9ed54295701c9207c1f777a3f5fa9ede51c96a14
Time: 2017-09-24
Author: yutiansut@qq.com
File Name: QUANTAXIS/QAData/data_fq.py
Class Name:
Method Name: QA_data_make_hfq