methylprep icon indicating copy to clipboard operation
methylprep copied to clipboard

methylprep.read_geo exceptions

Open marcmaxson opened this issue 4 years ago • 0 comments

  • For files of the <GEO>_signals.txt.gz variety, it won't apply p-value detection to probes if the p-value column is there for each sample.
  • IF meth and unmeth column names differ in case (e.g. SampleA Unmethylated Signal vs samplea Methylated Signal) it wont work. Instead you have to use pandas like this:
>>>import pandas as pd
>>> x = pd.read_csv('GSE67530_signals.txt', sep='\t')
>>> cols = {i:i.title() for i in list(x.columns)}
>>> x = x.rename(columns=cols)
>>> x.to_csv('GSE67530_signals_revised.txt', sep='\t')
>>> z = methylprep.read_geo('GSE67530_signals_revised.txt')
>>> z.to_csv('GSE67530_betas.csv.gz') 

(make samples case insensitive. It's possible to have the function try this trick before failing)

marcmaxson avatar Apr 07 '20 02:04 marcmaxson