Closed alwhiteh closed 1 year ago
Thanks for reporting, this should now be fixed on the develop branch. Can you try installing from develop and let me know if you still see the error?
Hi Tim,
I ran the code again and got the following output:
Function run_filterbarcodes called with the following arguments:
bam f1.sorted.bam
cells fibroblast_cells.txt
trim_suffix False
nproc 1
barcode_regex None
barcodetag CB
outdir f1_CFs.bam
sam False
func <function run_filterbarcodes at 0x1104c1ca0>
[E::hts_open_format] Failed to open file "f1_CFs.bam/CF_HKOMN4" : No such file or directory
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/Users/alexwhitehead/miniconda3/lib/python3.9/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/Users/alexwhitehead/miniconda3/lib/python3.9/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
File "/Users/alexwhitehead/miniconda3/lib/python3.9/site-packages/sinto/filterbarcodes.py", line 32, in _iterate_reads
bamlist = [pysam.AlignmentFile(x, filemode, header=newhead) for x in filelist]
File "/Users/alexwhitehead/miniconda3/lib/python3.9/site-packages/sinto/filterbarcodes.py", line 32, in <listcomp>
bamlist = [pysam.AlignmentFile(x, filemode, header=newhead) for x in filelist]
File "pysam/libcalignmentfile.pyx", line 751, in pysam.libcalignmentfile.AlignmentFile.__cinit__
File "pysam/libcalignmentfile.pyx", line 924, in pysam.libcalignmentfile.AlignmentFile._open
FileNotFoundError: [Errno 2] could not open alignment file `f1_CFs.bam/CF_HKOMN4`: No such file or directory
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/alexwhitehead/miniconda3/bin/sinto", line 8, in <module>
sys.exit(main())
File "/Users/alexwhitehead/miniconda3/lib/python3.9/site-packages/sinto/arguments.py", line 472, in main
options.func(options)
File "/Users/alexwhitehead/miniconda3/lib/python3.9/site-packages/sinto/utils.py", line 24, in wrapper
func(args)
File "/Users/alexwhitehead/miniconda3/lib/python3.9/site-packages/sinto/cli.py", line 17, in run_filterbarcodes
filterbarcodes.filterbarcodes(
File "/Users/alexwhitehead/miniconda3/lib/python3.9/site-packages/sinto/filterbarcodes.py", line 112, in filterbarcodes
idents = p.map_async(
File "/Users/alexwhitehead/miniconda3/lib/python3.9/multiprocessing/pool.py", line 771, in get
raise self._value
FileNotFoundError: [Errno 2] could not open alignment file `f1_CFs.bam/CF_HKOMN4`: No such file or directory
-Alex
Should be fixed now, could you check again?
I'm getting a similar error still:
Function run_filterbarcodes called with the following arguments:
bam f1.sorted.bam
cells fibroblast_cells.txt
trim_suffix False
nproc 1
barcode_regex None
barcodetag CB
outdir f1_CFs.bam
sam False
func <function run_filterbarcodes at 0x1144dcca0>
[E::hts_open_format] Failed to open file "f1_CFs.bam/CF_MGJNVK" : No such file or directory
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/Users/alexwhitehead/miniconda3/lib/python3.9/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/Users/alexwhitehead/miniconda3/lib/python3.9/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
File "/Users/alexwhitehead/miniconda3/lib/python3.9/site-packages/sinto/filterbarcodes.py", line 32, in _iterate_reads
bamlist = [pysam.AlignmentFile(x, filemode, header=newhead) for x in filelist]
File "/Users/alexwhitehead/miniconda3/lib/python3.9/site-packages/sinto/filterbarcodes.py", line 32, in <listcomp>
bamlist = [pysam.AlignmentFile(x, filemode, header=newhead) for x in filelist]
File "pysam/libcalignmentfile.pyx", line 751, in pysam.libcalignmentfile.AlignmentFile.__cinit__
File "pysam/libcalignmentfile.pyx", line 924, in pysam.libcalignmentfile.AlignmentFile._open
FileNotFoundError: [Errno 2] could not open alignment file `f1_CFs.bam/CF_MGJNVK`: No such file or directory
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/alexwhitehead/miniconda3/bin/sinto", line 8, in <module>
sys.exit(main())
File "/Users/alexwhitehead/miniconda3/lib/python3.9/site-packages/sinto/arguments.py", line 472, in main
options.func(options)
File "/Users/alexwhitehead/miniconda3/lib/python3.9/site-packages/sinto/utils.py", line 24, in wrapper
func(args)
File "/Users/alexwhitehead/miniconda3/lib/python3.9/site-packages/sinto/cli.py", line 17, in run_filterbarcodes
filterbarcodes.filterbarcodes(
File "/Users/alexwhitehead/miniconda3/lib/python3.9/site-packages/sinto/filterbarcodes.py", line 112, in filterbarcodes
idents = p.map_async(
File "/Users/alexwhitehead/miniconda3/lib/python3.9/multiprocessing/pool.py", line 771, in get
raise self._value
FileNotFoundError: [Errno 2] could not open alignment file `f1_CFs.bam/CF_MGJNVK`: No such file or directory
You pulled from the develop branch and installed again?
I used
pip install git+https://github.com/timoast/sinto.git@develop
Is this not correct?
Yep that should work
I just increased the dev version, can you install again and run sinto -v
to check the version is 0.8.3_1 and then check if you're still getting that error?
Hi Tim, this seemed to fix the error! My output file was empty, but I'll troubleshoot a bit more and reopen if I'm confident it's not an issue with my files/formatting. Thanks again!
Hello,
I have some scATAC data from which I am trying to generate pseudobulk files using text files of cell barcodes. The fastq files were aligned with bowtie2 and then converted into .bams and sorted using samtools.
I am encountering the following error:
I am unsure if this is caused by missing the read group portion of the header - when I ran
samtools view -H f1.bam
I got the following output:
Do I need to edit the header somehow or is this due to another issue?
Thanks,
Alex