wheaton5 / souporcell

Clustering scRNAseq by genotypes
MIT License
168 stars 46 forks source link

minimap2 error #71

Open XiaofeiSunUCSF opened 4 years ago

XiaofeiSunUCSF commented 4 years ago

Thanks for this great package. I got an error when try the test file

'checking modules imports done checking bam for expected tags checking fasta restarting pipeline in existing directory demux_data_test remapping with minimap2 Traceback (most recent call last): File "/opt/souporcell/souporcell_pipeline.py", line 539, in minimap_tmp_files = remap(args, region_fastqs, all_fastqs) File "/opt/souporcell/souporcell_pipeline.py", line 244, in remap stdout = samfile, stderr = minierr) File "/usr/local/envs/py36/lib/python3.6/subprocess.py", line 311, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['minimap2', '-ax', 'splice', '-t', '8', '-G50k', '-k', '21', '-w', '11', '--sr$

[M::mm_idx_gen::97.2111.52] collected minimizers [M::mm_idx_gen::113.9671.88] sorted minimizers [M::main::113.9671.88] loaded/built the index for 194 target sequence(s) [M::mm_mapopt_update::113.9671.88] mid_occ = 1000 [M::mm_idx_stat] kmer size: 21; skip: 11; is_hpc: 0; #seq: 194 [M::mm_idx_stat::120.630*1.83] distinct minimizers: 381286575 (95.43% are singletons); average occurrences: 1.291; average spacing: 6.mappmapping minimap2 -ax splice -t 8 -G50k -k 21 -w 11 --sr -A2 -B8 -O12,32 -E2,1 -r200 -p.5 -N20 -f1000,5000 -n2 -m20 -s40 -g2000 -2K50m --secondary=no refdata-cel$

wheaton5 commented 4 years ago

Are you using the singularity build or your own manual install?

Is there a minimap.err or any other .err or .out files in the output directory?

Best, Haynes

marlmatos commented 2 years ago

Hi Haynes, Thank you for building Souporcell. I am also having trouble running the pipeline at this step. I haven't been able to install singularity in my cluster so I did the hard install. The fastq files are created fine, but when it going to minimap2 it says it cannot find minimap2.

I get an output file minimap.err

mapping
minimap2 -ax splice -t 8 -G50k -k 21 -w 11 --sr -A2 -B8 -O12,32 -E2,1 -r200 -p.5 -N20 -f1000,5000 -n2 -m20 -s40 -g2000 -2K50m --secondary=no /home/greally-lab/indexes/hg38_cellranger/refdata-cellranger-GRCh38-3.0.0/fasta/genome.fa /home/marlrodrig/CD4_pilot3_novogene/souporcell_outs//tmp.fq
~
~

and the job log

checking modules
imports done
checking bam for expected tags
checking fasta
generating fastqs with cell barcodes and umis in readname
remapping
Traceback (most recent call last):
  File "/home/marlrodrig/souporcell/souporcell_pipeline.py", line 572, in <module>
    minimap_tmp_files = remap(args, region_fastqs, all_fastqs)
  File "/home/marlrodrig/souporcell/souporcell_pipeline.py", line 262, in remap
    stdout = samfile, stderr = minierr)
  File "/home/marlrodrig/.conda/envs/souporcell/lib/python3.6/subprocess.py", line 286, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/home/marlrodrig/.conda/envs/souporcell/lib/python3.6/subprocess.py", line 267, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/home/marlrodrig/.conda/envs/souporcell/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/home/marlrodrig/.conda/envs/souporcell/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'minimap2': 'minimap2'

Thanks

wheaton5 commented 2 years ago

Do u have minimap2 installed and on the path?

marlmatos commented 2 years ago

Hi, Thanks for the quick reply. No, I don't. I guess I am a little lost. I thought that the python environment souporcell_env.yaml had them inside.

Most of the programs except for vatrix are already installed in my cluster. How can I add them to the PATH of the souporcell_env.yaml?

does that mean I should do "module load" for each program minimap2, freebayes, etc. on my .sh file before i call conda activate souporcell and souporcell_pipeline.py?

wheaton5 commented 2 years ago

Hey, just checked and minimap2 isnt included in the conda env. I guess I never tested the environment with a completely bare environment. So I'll fix that. In the mean time go ahead and install it yourself and it should work.

clementhelsens commented 1 year ago

Hello ! I am also trying to run with the hard install and I face the same problem. I see that your last comment @wheaton5 mention fixing the environment, but the yaml still does not contains anything related to minimap. Running conda install -c bioconda minimap2 on top of the created env fixes the problem. It installs minimap2-2.17

EDIT in my case bedtools also needed to be installed, conda can do it and in my case it took bedtools-2.26.0, but I also need vartrix and for this one conda was not able to fix the environment conflicts. So I downloaded the latest release from github and added the binary to my conda env bin.

EDIT2 I also add to implement a small fix in souporcell_pipeline.py, change open with open_function here https://github.com/wheaton5/souporcell/blob/master/souporcell_pipeline.py#L398 In my case there is an encoding problem UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b