python/pymethylprocess/utils.py
def remove_snps(input_pkl,output_pkl, array_type):
    """Remove SNPs from methylation array."""
    import numpy as np
    #from rpy2.robjects import pandas2ri
    from pymethylprocess.meffil_functions import r_snp_cpgs
    #pandas2ri.activate()
    os.makedirs(output_pkl[:output_pkl.rfind('/')],exist_ok=True)
    snp_cpgs = r_snp_cpgs(array_type)#pandas2ri.ri2py()
    methyl_array=MethylationArray.from_pickle(input_pkl)
    methyl_array.beta = methyl_array.beta.loc[:,np.setdiff1d(list(methyl_array.beta),snp_cpgs)]
    methyl_array.write_pickle(output_pkl)
Remove SNPs from methylation array.
Remove SNPs from methylation array.
Remove SNPs from methylation array .
def remove_snps(input_pkl,output_pkl, array_type):
    import numpy as np
    from pymethylprocess.meffil_functions import r_snp_cpgs
    os.makedirs(output_pkl[:output_pkl.rfind('/')],exist_ok=True)
    snp_cpgs = r_snp_cpgs(array_type)
    methyl_array=MethylationArray.from_pickle(input_pkl)
    methyl_array.beta = methyl_array.beta.loc[:,np.setdiff1d(list(methyl_array.beta),snp_cpgs)]
    methyl_array.write_pickle(output_pkl)
def remove_snps ( input_pkl , output_pkl , array_type ) : import numpy as np from pymethylprocess . meffil_functions import r_snp_cpgs os . makedirs ( output_pkl [ : output_pkl . rfind ( '/' ) ] , exist_ok = True ) snp_cpgs = r_snp_cpgs ( array_type ) methyl_array = MethylationArray . from_pickle ( input_pkl ) methyl_array . beta = methyl_array . beta . loc [ : , np . setdiff1d ( list ( methyl_array . beta ) , snp_cpgs ) ] methyl_array . write_pickle ( output_pkl )
Remove SNPs from methylation array.
Remove SNPs from methylation array .
"""Remove SNPs from methylation array.""" #from rpy2.robjects import pandas2ri #pandas2ri.activate() #pandas2ri.ri2py()
input_pkl
output_pkl
array_type