Xinglab / rMATS-long

Other
23 stars 2 forks source link

error running rmats_long.py #19

Closed hucinoo closed 6 months ago

hucinoo commented 6 months ago

When I ran rmats_long.py with test data everything went well, but with my own data I got this error:

my group_1.txt file: saf5d

my group_2 file: wt3

abundance.esp header looks like this: transcript_ID transcript_name gene_ID saf5d wt3

The error is following:

`running: ['/home/hucko/miniconda3/envs/condaenv/bin/python', '/data/home/hucko/miniconda3/envs/condaenv/rMATS-long/detect_differential_isoforms.py', '--abundance', '/data/home/hucko/pombe/output/samples_N2_R0_abundance.esp', '--out-dir', '/data/home/hucko/pombe/output/output', '--group-1', '/data/home/hucko/pombe/output/group_1.txt', '--group-2', '/data/home/hucko/pombe/output/group_2.txt', '--adj-pvalue', '0.05', '--delta-proportion', '0.1', '--num-threads', '1'] running: ['Rscript', '/data/home/hucko/miniconda3/envs/condaenv/rMATS-long/detect_differential_isoforms.R', '/data/home/hucko/pombe/output/samples_N2_R0_abundance.esp', '/data/home/hucko/pombe/output/output', '1', '/data/home/hucko/pombe/output/group_1.txt', '/data/home/hucko/pombe/output/group_2.txt']

Attaching package: 'DRIMSeq'

The following object is masked from 'package:base':

proportions

Warning: Your system is mis-configured: '/etc/localtime' is not a symlink Warning: It is strongly recommended to set envionment variable TZ to 'localtime' (or equivalent) Saving 7 x 7 in image

About to run DRIMSeq::dmPrecision(...) which could take a while... ! Using a subset of 0.1 genes to estimate common precision !

! Using common_precision = 993.7118 as prec_init !

Error in simpleLoess(y, x, w, span, degree = degree, parametric = parametric, : invalid 'x' Calls: main ... dmDS_estimateTagwisePrecision -> dm_profileLikModeration -> loess -> simpleLoess In addition: Warning messages: 1: In max(which(not_boundry)) : no non-missing arguments to max; returning -Inf 2: In dm_movingAverageByCol(loglik = loglik, mean_expression = mean_expression, : NAs introduced by coercion to integer range Execution halted Traceback (most recent call last): File "/data/home/hucko/miniconda3/envs/condaenv/rMATS-long/detect_differential_isoforms.py", line 142, in main() File "/data/home/hucko/miniconda3/envs/condaenv/rMATS-long/detect_differential_isoforms.py", line 138, in main detect_differential_isoforms(args) File "/data/home/hucko/miniconda3/envs/condaenv/rMATS-long/detect_differential_isoforms.py", line 127, in detect_differential_isoforms detect_isoforms(script_dir, args.abundance, args.out_dir, args.num_threads, File "/data/home/hucko/miniconda3/envs/condaenv/rMATS-long/detect_differential_isoforms.py", line 82, in detect_isoforms rmats_long_utils.run_command(command) File "/data/home/hucko/miniconda3/envs/condaenv/rMATS-long/rmats_long_utils.py", line 278, in run_command subprocess.run(command, check=True) File "/home/hucko/miniconda3/envs/condaenv/lib/python3.12/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['Rscript', '/data/home/hucko/miniconda3/envs/condaenv/rMATS-long/detect_differential_isoforms.R', '/data/home/hucko/pombe/output/samples_N2_R0_abundance.esp', '/data/home/hucko/pombe/output/output', '1', '/data/home/hucko/pombe/output/group_1.txt', '/data/home/hucko/pombe/output/group_2.txt']' returned non-zero exit status 1. Traceback (most recent call last): File "/data/home/hucko/miniconda3/envs/condaenv/rMATS-long/rmats_long.py", line 624, in main() File "/data/home/hucko/miniconda3/envs/condaenv/rMATS-long/rmats_long.py", line 618, in main summary = rmats_long(args) ^^^^^^^^^^^^^^^^ File "/data/home/hucko/miniconda3/envs/condaenv/rMATS-long/rmats_long.py", line 582, in rmats_long detect_differential_isoforms(args.abundance, args.out_dir, File "/data/home/hucko/miniconda3/envs/condaenv/rMATS-long/rmats_long.py", line 283, in detect_differential_isoforms rmats_long_utils.run_command(command) File "/data/home/hucko/miniconda3/envs/condaenv/rMATS-long/rmats_long_utils.py", line 278, in run_command subprocess.run(command, check=True) File "/home/hucko/miniconda3/envs/condaenv/lib/python3.12/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['/home/hucko/miniconda3/envs/condaenv/bin/python', '/data/home/hucko/miniconda3/envs/condaenv/rMATS-long/detect_differential_isoforms.py', '--abundance', '/data/home/hucko/pombe/output/samples_N2_R0_abundance.esp', '--out-dir', '/data/home/hucko/pombe/output/output', '--group-1', '/data/home/hucko/pombe/output/group_1.txt', '--group-2', '/data/home/hucko/pombe/output/group_2.txt', '--adj-pvalue', '0.05', '--delta-proportion', '0.1', '--num-threads', '1']' returned non-zero exit status 1.`

Thanks for your help!

EricKutschera commented 6 months ago

I think these errors are due to only having 2 samples (saf5d, wt3):

Error in simpleLoess(y, x, w, span, degree = degree, parametric = parametric, :
invalid 'x'
Calls: main ... dmDS_estimateTagwisePrecision -> dm_profileLikModeration -> loess -> simpleLoess
In addition: Warning messages:
1: In max(which(not_boundry)) :
no non-missing arguments to max; returning -Inf
2: In dm_movingAverageByCol(loglik = loglik, mean_expression = mean_expression, :
NAs introduced by coercion to integer range

It looks like you may have installed rmats-long from bioconda (based on miniconda3/envs/condaenv/rMATS-long/). The bioconda package is v1.0.0, but there are some more recent changes in the master branch. In particular there is a change to the DRIMSeq parameters when there are only 2 samples: https://github.com/Xinglab/rMATS-long/blob/592cb3268d16aa6bea3a6b79aedceac128563e3b/scripts/detect_differential_isoforms.R#L286

Until a new bioconda release is made, you can get the latest code from github and then run using python ./scripts/rmats_long.py. You can use your current conda install which has most of the dependencies, but you'll need to install r-ggrepel which is needed with the latest code: https://github.com/Xinglab/rMATS-long/blob/d4845c5e5a23681f8b39a146328ed2eb84bf3017/conda_requirements.txt#L12

conda install -c conda-forge -c bioconda r-ggrepel

hucinoo commented 6 months ago

Thank you very much! Now it works perfectly