python/pymethylprocess/preprocess.py
def preprocess_pipeline(idat_dir, n_cores, output_pkl, meffil, n_pcs, pipeline, noob_norm, use_cache, qc_only, p_beadnum_samples, p_detection_samples, p_beadnum_cpgs, p_detection_cpgs, sex_cutoff, sex_sd, bmiq):
    """Perform preprocessing of idats using enmix or meffil."""
    output_dir = output_pkl[:output_pkl.rfind('/')]
    os.makedirs(output_dir,exist_ok=True)
    preprocesser = PreProcessIDAT(idat_dir)
    if meffil:
        qc_parameters={'p.beadnum.samples':p_beadnum_samples,'p.detection.samples':p_detection_samples,'p.detection.cpgs':p_detection_cpgs,'p.beadnum.cpgs':p_beadnum_cpgs,'sex.cutoff':sex_cutoff, 'sex.outlier.sd':sex_sd}
        preprocesser.preprocessMeffil(n_cores=n_cores,n_pcs=n_pcs,qc_report_fname=os.path.join(output_dir,'qc.report.html'), normalization_report_fname=os.path.join(output_dir,'norm.report.html'), pc_plot_fname=os.path.join(output_dir,'pc.plot.pdf'), useCache=use_cache, qc_only=qc_only, qc_parameters=qc_parameters)
    else:
        preprocesser.preprocess_enmix_pipeline(n_cores=n_cores, pipeline=pipeline, noob=noob_norm, use_cache=use_cache, qc_only=qc_only, bmiq=bmiq)
        try:
            preprocesser.plot_qc_metrics(output_dir)
        except:
            pass
    preprocesser.output_pheno_beta(meffil=meffil)
    preprocesser.to_methyl_array('').write_pickle(output_pkl)
Perform preprocessing of idats using enmix or meffil.
Perform preprocessing of idats using enmix or meffil.
Perform preprocessing of idats using enmix or meffil .
def preprocess_pipeline(idat_dir, n_cores, output_pkl, meffil, n_pcs, pipeline, noob_norm, use_cache, qc_only, p_beadnum_samples, p_detection_samples, p_beadnum_cpgs, p_detection_cpgs, sex_cutoff, sex_sd, bmiq):
    output_dir = output_pkl[:output_pkl.rfind('/')]
    os.makedirs(output_dir,exist_ok=True)
    preprocesser = PreProcessIDAT(idat_dir)
    if meffil:
        qc_parameters={'p.beadnum.samples':p_beadnum_samples,'p.detection.samples':p_detection_samples,'p.detection.cpgs':p_detection_cpgs,'p.beadnum.cpgs':p_beadnum_cpgs,'sex.cutoff':sex_cutoff, 'sex.outlier.sd':sex_sd}
        preprocesser.preprocessMeffil(n_cores=n_cores,n_pcs=n_pcs,qc_report_fname=os.path.join(output_dir,'qc.report.html'), normalization_report_fname=os.path.join(output_dir,'norm.report.html'), pc_plot_fname=os.path.join(output_dir,'pc.plot.pdf'), useCache=use_cache, qc_only=qc_only, qc_parameters=qc_parameters)
    else:
        preprocesser.preprocess_enmix_pipeline(n_cores=n_cores, pipeline=pipeline, noob=noob_norm, use_cache=use_cache, qc_only=qc_only, bmiq=bmiq)
        try:
            preprocesser.plot_qc_metrics(output_dir)
        except:
            pass
    preprocesser.output_pheno_beta(meffil=meffil)
    preprocesser.to_methyl_array('').write_pickle(output_pkl)
def preprocess_pipeline ( idat_dir , n_cores , output_pkl , meffil , n_pcs , pipeline , noob_norm , use_cache , qc_only , p_beadnum_samples , p_detection_samples , p_beadnum_cpgs , p_detection_cpgs , sex_cutoff , sex_sd , bmiq ) : output_dir = output_pkl [ : output_pkl . rfind ( '/' ) ] os . makedirs ( output_dir , exist_ok = True ) preprocesser = PreProcessIDAT ( idat_dir ) if meffil : qc_parameters = { 'p.beadnum.samples' : p_beadnum_samples , 'p.detection.samples' : p_detection_samples , 'p.detection.cpgs' : p_detection_cpgs , 'p.beadnum.cpgs' : p_beadnum_cpgs , 'sex.cutoff' : sex_cutoff , 'sex.outlier.sd' : sex_sd } preprocesser . preprocessMeffil ( n_cores = n_cores , n_pcs = n_pcs , qc_report_fname = os . path . join ( output_dir , 'qc.report.html' ) , normalization_report_fname = os . path . join ( output_dir , 'norm.report.html' ) , pc_plot_fname = os . path . join ( output_dir , 'pc.plot.pdf' ) , useCache = use_cache , qc_only = qc_only , qc_parameters = qc_parameters ) else : preprocesser . preprocess_enmix_pipeline ( n_cores = n_cores , pipeline = pipeline , noob = noob_norm , use_cache = use_cache , qc_only = qc_only , bmiq = bmiq ) try : preprocesser . plot_qc_metrics ( output_dir ) except : pass preprocesser . output_pheno_beta ( meffil = meffil ) preprocesser . to_methyl_array ( '' ) . write_pickle ( output_pkl )
Perform preprocessing of idats using enmix or meffil.
Perform preprocessing of idats using enmix or meffil .
"""Perform preprocessing of idats using enmix or meffil."""
idat_dir
n_cores
output_pkl
meffil
n_pcs
pipeline
noob_norm
use_cache
qc_only
p_beadnum_samples
p_detection_samples
p_beadnum_cpgs
p_detection_cpgs
sex_cutoff
sex_sd
bmiq