python/pymethylprocess/utils.py
def stratify(input_pkl,key,output_dir):
    """Split methylation array by key and store."""
    for name, methyl_array in MethylationArray.from_pickle(input_pkl).groupby(key):
        out_dir=os.path.join(output_dir,name.replace('/','-').replace(' ',''))
        os.makedirs(out_dir,exist_ok=True)
        methyl_array.write_pickle(os.path.join(out_dir,'methyl_array.pkl'))
Split methylation array by key and store.
Split methylation array by key and store.
Split methylation array by key and store .
def stratify(input_pkl,key,output_dir):
    for name, methyl_array in MethylationArray.from_pickle(input_pkl).groupby(key):
        out_dir=os.path.join(output_dir,name.replace('/','-').replace(' ',''))
        os.makedirs(out_dir,exist_ok=True)
        methyl_array.write_pickle(os.path.join(out_dir,'methyl_array.pkl'))
def stratify ( input_pkl , key , output_dir ) : for name , methyl_array in MethylationArray . from_pickle ( input_pkl ) . groupby ( key ) : out_dir = os . path . join ( output_dir , name . replace ( '/' , '-' ) . replace ( ' ' , '' ) ) os . makedirs ( out_dir , exist_ok = True ) methyl_array . write_pickle ( os . path . join ( out_dir , 'methyl_array.pkl' ) )
Split methylation array by key and store.
Split methylation array by key and store .
"""Split methylation array by key and store."""
input_pkl
key
output_dir