Christensen-Lab-Dartmouth / PyMethylProcess

Preprocessing methylation pipeline, written in python. Easy to use and highly parallelized.
https://christensen-lab-dartmouth.github.io/PyMethylProcess/
MIT License
35 stars 8 forks source link

Path issue when running PyMethylProcess in ubuntu on windows (WSL) #14

Open varunorama opened 3 years ago

varunorama commented 3 years ago

Hello,

I am using pymethyl-process to process IDAT files in the hope of extracting the beta values from multiple samples. Currently I am running it as such:

pymethyl-preprocess preprocess_pipeline --n_cores 8 --idat_dir /mnt/d/IDATS/205130650082/ --pipeline minfi --noob_norm --output_pk
l /mnt/d/TRUD/pymethyl_run/

Where the idat directory is a folder containing all IDAT files. One thing to note, II am currently running this all through the Ubuntu subarchitecture through WSL.

However, running this produces an error which suggests that the path is wrong:

/home/varundwaraka/anaconda3/lib/python3.8/site-packages/rpy2/robjects/pandas2ri.py:17: FutureWarning: pandas.core.index is deprecated and will be removed in a future version.  The public classes are available in the top-level namespace.
  from pandas.core.index import Index as PandasIndex
/home/varundwaraka/anaconda3/lib/python3.8/site-packages/rpy2/rinterface/__init__.py:146: RRuntimeWarning: [read.metharray.sheet] Found the following CSV files:

  warnings.warn(x, RRuntimeWarning)
character(0)

/home/varundwaraka/anaconda3/lib/python3.8/site-packages/rpy2/rinterface/__init__.py:146: RRuntimeWarning: Error in list.files(path = base, pattern = "_Grn.idat$", recursive = recursive,  :
  invalid 'path' argument

  warnings.warn(x, RRuntimeWarning)
/home/varundwaraka/anaconda3/lib/python3.8/site-packages/rpy2/rinterface/__init__.py:146: RRuntimeWarning: In addition:
  warnings.warn(x, RRuntimeWarning)
/home/varundwaraka/anaconda3/lib/python3.8/site-packages/rpy2/rinterface/__init__.py:146: RRuntimeWarning: There were 25 warnings (use warnings() to see them)
  warnings.warn(x, RRuntimeWarning)
/home/varundwaraka/anaconda3/lib/python3.8/site-packages/rpy2/rinterface/__init__.py:146: RRuntimeWarning:

  warnings.warn(x, RRuntimeWarning)
Traceback (most recent call last):
  File "/home/varundwaraka/anaconda3/bin/pymethyl-preprocess", line 8, in <module>
    sys.exit(preprocess())
  File "/home/varundwaraka/anaconda3/lib/python3.8/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/varundwaraka/anaconda3/lib/python3.8/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/varundwaraka/anaconda3/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/varundwaraka/anaconda3/lib/python3.8/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/varundwaraka/anaconda3/lib/python3.8/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/varundwaraka/anaconda3/lib/python3.8/site-packages/pymethylprocess/preprocess.py", line 293, in preprocess_pipeline
    preprocesser.preprocess_enmix_pipeline(n_cores=n_cores, pipeline=pipeline, noob=noob_norm, use_cache=use_cache, qc_only=qc_only, bmiq=bmiq)
  File "/home/varundwaraka/anaconda3/lib/python3.8/site-packages/pymethylprocess/PreProcessDataTypes.py", line 606, in preprocess_enmix_pipeline
    self.load_idats()
  File "/home/varundwaraka/anaconda3/lib/python3.8/site-packages/pymethylprocess/PreProcessDataTypes.py", line 514, in load_idats
    self.RGset = self.minfi.read_metharray_exp(targets=targets, extended=True)
  File "/home/varundwaraka/anaconda3/lib/python3.8/site-packages/rpy2/robjects/functions.py", line 178, in __call__
    return super(SignatureTranslatedFunction, self).__call__(*args, **kwargs)
  File "/home/varundwaraka/anaconda3/lib/python3.8/site-packages/rpy2/robjects/functions.py", line 106, in __call__
    res = super(Function, self).__call__(*new_args, **new_kwargs)
rpy2.rinterface.RRuntimeError: Error in list.files(path = base, pattern = "_Grn.idat$", recursive = recursive,  :
  invalid 'path' argument

However, checking the path to the folder suggests that it is correct:

(base) varundwaraka@LAPTOP-6T391O1J:/mnt/d/IDATS/205130650082$ pwd
/mnt/d/IDATS/205130650082

Is there any explanation as to why this error is occuring? Is it a path issue? Or is this a different issue within pandas? Any insight will be helpful!

Thanks, Varun

jlevy44 commented 2 years ago

Hi Varun, the error is odd. What version of rpy2 do you have installed? Last time I checked, worked with 2.9.4 but functionality changed between rpy2 v2 and v3.