python/pymethylprocess/preprocess.py
def create_sample_sheet(input_sample_sheet, source_type, idat_dir, output_sample_sheet, mapping_file, header_line, disease_class_column, basename_col, include_columns_file):
    """Create sample sheet for input to minfi, meffil, or enmix."""
    os.makedirs(output_sample_sheet[:output_sample_sheet.rfind('/')], exist_ok=True)
    pheno_sheet = PreProcessPhenoData(input_sample_sheet, idat_dir, header_line= (0 if source_type != 'custom' else header_line))
    if include_columns_file:
        include_columns=np.loadtxt(include_columns_file,dtype=str,delimiter='\t')
        if '\t' in open(include_columns_file).read() and len(include_columns.shape)<2:
            include_columns=dict(include_columns[np.newaxis,:].tolist())
        elif len(include_columns.shape)<2:
            include_columns=dict(zip(include_columns,include_columns))
        else:
            include_columns=dict(include_columns.tolist())
    else:
        include_columns={}
    if source_type == 'tcga':
        pheno_sheet.format_tcga(mapping_file)
    elif source_type == 'geo':
        pheno_sheet.format_geo(disease_class_column, include_columns)
    else:
        pheno_sheet.format_custom(basename_col, disease_class_column, include_columns)
    pheno_sheet.export(output_sample_sheet)
    print("Next Step: Please remove {} from {}, if it exists in that directory.".format(input_sample_sheet, idat_dir))
Create sample sheet for input to minfi, meffil, or enmix.
Create sample sheet for input to minfi, meffil, or enmix.
Create sample sheet for input to minfi meffil or enmix .
def create_sample_sheet(input_sample_sheet, source_type, idat_dir, output_sample_sheet, mapping_file, header_line, disease_class_column, basename_col, include_columns_file):
    os.makedirs(output_sample_sheet[:output_sample_sheet.rfind('/')], exist_ok=True)
    pheno_sheet = PreProcessPhenoData(input_sample_sheet, idat_dir, header_line= (0 if source_type != 'custom' else header_line))
    if include_columns_file:
        include_columns=np.loadtxt(include_columns_file,dtype=str,delimiter='\t')
        if '\t' in open(include_columns_file).read() and len(include_columns.shape)<2:
            include_columns=dict(include_columns[np.newaxis,:].tolist())
        elif len(include_columns.shape)<2:
            include_columns=dict(zip(include_columns,include_columns))
        else:
            include_columns=dict(include_columns.tolist())
    else:
        include_columns={}
    if source_type == 'tcga':
        pheno_sheet.format_tcga(mapping_file)
    elif source_type == 'geo':
        pheno_sheet.format_geo(disease_class_column, include_columns)
    else:
        pheno_sheet.format_custom(basename_col, disease_class_column, include_columns)
    pheno_sheet.export(output_sample_sheet)
    print("Next Step: Please remove {} from {}, if it exists in that directory.".format(input_sample_sheet, idat_dir))
def create_sample_sheet ( input_sample_sheet , source_type , idat_dir , output_sample_sheet , mapping_file , header_line , disease_class_column , basename_col , include_columns_file ) : os . makedirs ( output_sample_sheet [ : output_sample_sheet . rfind ( '/' ) ] , exist_ok = True ) pheno_sheet = PreProcessPhenoData ( input_sample_sheet , idat_dir , header_line = ( 0 if source_type != 'custom' else header_line ) ) if include_columns_file : include_columns = np . loadtxt ( include_columns_file , dtype = str , delimiter = '\t' ) if '\t' in open ( include_columns_file ) . read ( ) and len ( include_columns . shape ) < 2 : include_columns = dict ( include_columns [ np . newaxis , : ] . tolist ( ) ) elif len ( include_columns . shape ) < 2 : include_columns = dict ( zip ( include_columns , include_columns ) ) else : include_columns = dict ( include_columns . tolist ( ) ) else : include_columns = { } if source_type == 'tcga' : pheno_sheet . format_tcga ( mapping_file ) elif source_type == 'geo' : pheno_sheet . format_geo ( disease_class_column , include_columns ) else : pheno_sheet . format_custom ( basename_col , disease_class_column , include_columns ) pheno_sheet . export ( output_sample_sheet ) print ( "Next Step: Please remove {} from {}, if it exists in that directory." . format ( input_sample_sheet , idat_dir ) )
Create sample sheet for input to minfi, meffil, or enmix.
Create sample sheet for input to minfi meffil or enmix .
"""Create sample sheet for input to minfi, meffil, or enmix."""
input_sample_sheet
source_type
idat_dir
output_sample_sheet
mapping_file
header_line
disease_class_column
basename_col
include_columns_file