jason-weirather / GSVA

A command-line interface and python module for R's GSVA bioconductor package
Apache License 2.0
13 stars 6 forks source link

FileNotFoundError: [Errno 2] File b'/tmp/weirathe.o_2u3pdz/pathways.csv' does not exist: b'/tmp/weirathe.o_2u3pdz/pathways.csv #5

Open jkobject opened 4 years ago

jkobject commented 4 years ago

Hello,

With the most up to date version of GSVApy (python 3.8) and a fresh installation of GSVA on R3.6 (with BioConductor), I was not able to run the gsva function from the python bindings.

I was able to run load and run GSVA from R.

the error was:

FileNotFoundError                         Traceback (most recent call last)
<ipython-input-125-a38101f34ffc> in <module>
----> 1 gsva(counts_genes_merged, gmt)

~/miniconda3/lib/python3.7/site-packages/GSVA/__init__.py in gsva(expression_df, geneset_df, method, kcdf, abs_ranking, min_sz, max_sz, parallel_sz, parallel_type, mx_diff, tau, ssgsea_norm, verbose, tempdir)
    101     sp = Popen(cmd,stdout=PIPE,stderr=destination)
    102     sp.communicate()
--> 103     output = pd.read_csv(os.path.join(tempdir,"pathways.csv"),index_col=0)
    104     output.index = output.index.astype(str)
    105     output.columns = output.columns.astype(str)
jason-weirather commented 4 years ago

Hi @jkobject thanks for letting me know. It may be some time before I can test this on a vanilla build to see if i can replicate and ensure its working on new versions of R and bioconductor. I'll leave this issue open, I still use this wrapper myself and would like to support others who find it useful.

jkobject commented 4 years ago

Hi @jason-weirather I think this is a very useful package. I was previously trying to use GSEApy which seem to have an ssGSEA algorithm. However I have thousands of samples that I need to analyse at once and the algorithm could only work on fewer than 50 at a time..

AJFIRESTONE commented 3 years ago

I had the same issue. Running the rscript from the command line gave the following:

$ Rscript /Users/firestone/opt/anaconda3/lib/python3.8/site-packages/GSVA/gsva.r 'gsva', 'Gaussian', 'False', '1', 'None', '0', 'SOCK', 'True', 'None', 'True', 'False', '/var/folders/zk/bcry5y2s7hn2ryc49rwpy_8h0000gn/T/weirathe.3cr28do2' Loading required package: BiocGenerics Loading required package: parallel

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:parallel’:

clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from ‘package:stats’:

IQR, mad, sd, var, xtabs

The following objects are masked from ‘package:base’:

anyDuplicated, append, as.data.frame, basename, cbind, colnames,
dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
union, unique, unsplit, which.max, which.min

Loading required package: Biobase Welcome to Bioconductor

Vignettes contain introductory material; view with
'browseVignettes()'. To cite Bioconductor, see
'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: annotate Loading required package: AnnotationDbi Loading required package: stats4 Loading required package: IRanges Loading required package: S4Vectors

Attaching package: ‘S4Vectors’

The following object is masked from ‘package:base’:

expand.grid

Loading required package: XML Loading required package: graph

Attaching package: ‘graph’

The following object is masked from ‘package:XML’:

addNode

Warning message: NAs introduced by coercion Warning message: NAs introduced by coercion Warning message: NAs introduced by coercion Error in .local(expr, gset.idx.list, ...) : unused argument (parallel.type = "SOCK,") Calls: gsva -> gsva In addition: Warning message: NAs introduced by coercion Execution halted

So for me removing the 'parallel.type=' lines from gsva.r seemed to corrected the issue. looking at the DOCs for current GSAV package i don't see a parallel.type argument listed anymore so maybe that's the issue. I don't know very much about R (or anything else though).

jkobject commented 2 years ago

Hello, FYI, I ended up writing my own tool: https://github.com/broadinstitute/genepy/blob/master/genepy/rna/__init__.py#L747

you can copy this code (and the relevant ssGSEA.py file or use genepy directly (which contain many bioinformatics helper functions)

Best,