run10x Trouble creating loom files : cellsorted file not found
See original GitHub issueHi,
I ran this command
velocyto run -b “/path/barcodes.tsv” -m “/path/hg38_rmsk.gtf” “/path/outs/possorted_genome_bam.bam” “/path/refdata-cellranger-GRCh38-3.0.0/genes/genes.gtf”
and received the following errors:
2019-06-21 14:42:09,834 - INFO - Starting the sorting process of /path/outs/possorted_genome_bam.bam the output will be at: /path/outs/cellsorted_possorted_genome_bam.bam 2019-06-21 14:42:09,834 - INFO - Command being run is: samtools sort -l 7 -m 2000M -t CB -O BAM -@ 16 -o /path/outs/cellsorted_possorted_genome_bam.bam /path/outs/possorted_genome_bam.bam 2019-06-21 14:42:09,834 - INFO - While the bam sorting happens do other things… 2019-06-21 14:42:09,834 - INFO - Load the annotation from /path/refdata-cellranger-GRCh38-3.0.0/genes/genes.gtf sort: invalid option – ‘t’ sort: invalid option – ‘O’ open: No such file or directory [bam_sort_core] fail to open file CB
2019-06-21 15:59:20,518 - DEBUG - End of file. Reset index: start scanning from initial position. 2019-06-21 15:59:20,519 - DEBUG - 3416460 reads were skipped because no apropiate cell or umi barcode was found 2019-06-21 15:59:20,519 - INFO - Now just waiting that the bam sorting process terminates 2019-06-21 15:59:20,519 - INFO - bam file #0 has been sorted 2019-06-21 15:59:20,519 - DEBUG - Start molecule counting!
Failed to open file /path/outs/cellsorted_possorted_genome_bam.bam Traceback (most recent call last): File “/mnt/software/unstowable/miniconda3-4.6.14/envs/mamba/bin/velocyto”, line 10, in <module> sys.exit(cli()) File “/mnt/software/unstowable/miniconda3-4.6.14/envs/mamba/lib/python3.7/site-packages/click/core.py”, line 764, in call return self.main(*args, **kwargs) File “/mnt/software/unstowable/miniconda3-4.6.14/envs/ma/lib/python3.7/site-packages/click/core.py”, line 717, in main rv = self.invoke(ctx) File “/mnt/software/unstowable/miniconda3-4.6.14/envs/ma/lib/python3.7/site-packages/click/core.py”, line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File “/mnt/software/unstowable/miniconda3-4.6.14/envs/ma/lib/python3.7/site-packages/click/core.py”, line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File “/mnt/software/unstowable/miniconda3-4.6.14/envs/ma/lib/python3.7/site-packages/click/core.py”, line 555, in invoke return callback(*args, **kwargs) File “/mnt/software/unstowable/miniconda3-4.6.14/envs/ma/lib/python3.7/site-packages/velocyto/commands/run.py”, line 116, in run samtools_memory=samtools_memory, dump=dump, loom_numeric_dtype=dtype, verbose=verbose, additional_ca=additional_ca) File “/mnt/software/unstowable/miniconda3-4.6.14/envs/ma/lib/python3.7/site-packages/velocyto/commands/_run.py”, line 229, in _run results = exincounter.count(bamfile_cellsorted, multimap=multimap) # NOTE: we would avoid some millions of if statements evaluations if we write two function count and count_with output File “/mnt/software/unstowable/miniconda3-4.6.14/envs/ma/lib/python3.7/site-packages/velocyto/counter.py”, line 756, in count for r in self.iter_alignments(bamfile, unique=not multimap): File “/mnt/software/unstowable/miniconda3-4.6.14/envs/ma/lib/python3.7/site-packages/velocyto/counter.py”, line 251, in iter_alignments fin = pysam.AlignmentFile(bamfile) # type: pysam.AlignmentFile File “pysam/libcalignmentfile.pyx”, line 736, in pysam.libcalignmentfile.AlignmentFile.cinit File “pysam/libcalignmentfile.pyx”, line 935, in pysam.libcalignmentfile.AlignmentFile._open FileNotFoundError: [Errno 2] could not open alignment file
/path/outs/cellsorted_possorted_genome_bam.bam
: No such file or directory
Does anyone know the solution to this? I cannot find the file called cellsorted_postsorted_genome_bam.bam in the output folder it listed.
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top GitHub Comments
Hi,
I realized there was an issue with samtools sort. Thus I ran this command separately first:
samtools sort -t CB -O BAM -o ~/outputfolder/cellsorted_possorted_genome_bam.bam ~path/possorted_genome_bam.bam
This requires samtools to be installed separately. Once this cellsorted file was generated, I placed it/outputted it in the expected folder where cellsorted is supposed to be found. Then, I subsequently ran velocyto run where it was able to skip this step as the file already exists.
Hope this helps!
Hello, I did the same. I firstly executed samtools sort command and then tried velocyto run. However, I am getting a big issue. I am doing it without UMI-barcode file, and also i am using -U tag.
My command line is :
velocyto run --without-umi -o /5TB-storage/gaurav.ahuja/sidrah/Data/b_mouse_linda/trimmed/bams/cellsorted/loom -m /5TB-storage/gaurav.ahuja/sidrah/Data/filesforvelocyto/mm10_rmsk.gtf /5TB-storage/gaurav.ahuja/sidrah/Data/b_mouse_linda/trimmed/bams/cellsorted/$line1.bam /5TB-storage/gaurav.ahuja/sidrah/Data/filesforvelocyto/Mus_musculus.GRCm38.101.gtf
I got this error.ile “/home/gaurav.ahuja/anaconda2/envs/velocyto/bin/velocyto”, line 8, in sys.exit(cli()) File “/home/gaurav.ahuja/anaconda2/envs/velocyto/lib/python3.6/site-packages/click/core.py”, line 764, in call return self.main(*args, **kwargs) File “/home/gaurav.ahuja/anaconda2/envs/velocyto/lib/python3.6/site-packages/click/core.py”, line 717, in main rv = self.invoke(ctx) File “/home/gaurav.ahuja/anaconda2/envs/velocyto/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File “/home/gaurav.ahuja/anaconda2/envs/velocyto/lib/python3.6/site-packages/click/core.py”, line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File “/home/gaurav.ahuja/anaconda2/envs/velocyto/lib/python3.6/site-packages/click/core.py”, line 555, in invoke return callback(*args, **kwargs) File “/home/gaurav.ahuja/anaconda2/envs/velocyto/lib/python3.6/site-packages/velocyto/commands/run.py”, line 116, in run samtools_memory=samtools_memory, dump=dump, loom_numeric_dtype=dtype, verbose=verbose, additional_ca=additional_ca) File “/home/gaurav.ahuja/anaconda2/envs/velocyto/lib/python3.6/site-packages/velocyto/commands/_run.py”, line 159, in _run exincounter.peek(bamfile[0]) File “/home/gaurav.ahuja/anaconda2/envs/velocyto/lib/python3.6/site-packages/velocyto/counter.py”, line 158, in peek raise IOError(“The bam file does not contain cell and umi barcodes appropriatelly formatted. If you are runnin UMI-less data you should use the -U flag.”) OSError: The bam file does not contain cell and umi barcodes appropriatelly formatted. If you are running UMI-less data you should use the -U flag. ^CTraceback (most recent call last): File “/home/gaurav.ahuja/anaconda2/envs/velocyto/lib/python3.6/site-packages/llvmlite/ir/_utils.py”, line 48, in str return self.__cached_str AttributeError: ‘GEPInstr’ object has no attribute ‘_StrCaching__cached_str’
Please help me in this regard. Thank you.