Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concoct Error Could not retrieve index file #319

Open
howla1ke opened this issue Nov 10, 2022 · 2 comments
Open

Concoct Error Could not retrieve index file #319

howla1ke opened this issue Nov 10, 2022 · 2 comments

Comments

@howla1ke
Copy link

howla1ke commented Nov 10, 2022

Hello,
I am trying to run concoct, I successfully used this script:
cut_up_fasta.py 58D_contigs-fixed.fa -c 10000 -o 0 --merge_last -b contigs_10K.bed > E58_contigs_10K.fa
I then go to create the coverage table and I get errors. I have a bam file, sorted.bam, and bam.bai files and I get an error saying that it cannot open the indexed files. All of the mapping was done using BWA, against the original contigs file (58D_contigs-fixed.fa) can you please tell me what I am doing wrong here. I followed the advice of others ie renaming sample.sorted.bam to sample.bam. I also moved the sorted and indexed bam files into a directory. Nothing is working for me.

concoct_coverage_table.py contigs_10K.bed mapping/D_A20-E58-D3.interleave.bam > coverage_table.tsv
[E::hts_open_format] Failed to open file "mapping/D_A20-E58-D3.interleave.bam" : No such file or directory
ERROR: fail to open index BAM file 'mapping/D_A20-E58-D3.interleave.bam'
Traceback (most recent call last):
File "/opt/software/CONCOCT/1.1.0-foss-2020b-Python-2.7.18/bin/concoct_coverage_table.py", line 91, in
generate_input_table(args.bedfile, args.bamfiles, samplenames=samplenames)
File "/opt/software/CONCOCT/1.1.0-foss-2020b-Python-2.7.18/bin/concoct_coverage_table.py", line 42, in generate_input_table
sys.stderr.write(err)
TypeError: expected a string or other character buffer object
$ concoct_coverage_table.py contigs_10K.bed D_A20-E58-D3.interleave.bam > coverage_table.tsv
[E::idx_find_and_load] Could not retrieve index file for 'D_A20-E58-D3.interleave.bam'
ERROR: fail to open index BAM file 'D_A20-E58-D3.interleave.bam'
Traceback (most recent call last):
File "/opt/software/CONCOCT/1.1.0-foss-2020b-Python-2.7.18/bin/concoct_coverage_table.py", line 91, in
generate_input_table(args.bedfile, args.bamfiles, samplenames=samplenames)
File "/opt/software/CONCOCT/1.1.0-foss-2020b-Python-2.7.18/bin/concoct_coverage_table.py", line 42, in generate_input_table
sys.stderr.write(err)
TypeError: expected a string or other character buffer object
$ ls
58D_contigs-fixed.fa D_A20-E58-D3.interleave.bam E58_contigs_10K.fa
contigs_10K.bed D_A20-E58-D3_S8_L001.interleave.fq.bam
coverage_table.tsv D_A20-E58-D3_S8_L001.interleave.fq.sorted.bam.bai
[howla1keCMICH@dev-intel14-k20 E58_Concoct2]$ mv D_A20-E58-D3_S8_L001.interleave.fq.sorted.bam.bai D_A20-E58-D3.interleave.bam.bai
$ ls
58D_contigs-fixed.fa D_A20-E58-D3.interleave.bam E58_contigs_10K.fa
contigs_10K.bed D_A20-E58-D3.interleave.bam.bai
coverage_table.tsv D_A20-E58-D3_S8_L001.interleave.fq.bam
$ mkdir bam
$ cd bam/
$ pwd

$ cd ..
$ mv D_A20-E58-D3.interleave.bam /mnt/gs21/scratch//E58_Concoct2/bam
$ mv D_A20-E58-D3.interleave.bam.bai
mv: missing destination file operand after ‘D_A20-E58-D3.interleave.bam.bai’
Try 'mv --help' for more information.
$ mv D_A20-E58-D3.interleave.bam.bai /mnt/gs21/scratch/E58_Concoct2/bam
$ ls
58D_contigs-fixed.fa contigs_10K.bed D_A20-E58-D3_S8_L001.interleave.fq.bam
bam coverage_table.tsv E58_contigs_10K.fa
$ rm -r coverage_table.tsv
$ concoct_coverage_table.py contigs_10K.bed mapping//bam > coverage_table.tsv
[E::hts_open_format] Failed to open file "mapping/
/bam" : No such file or directory
ERROR: fail to open index BAM file 'mapping/~/bam'
Traceback (most recent call last):
File "/opt/software/CONCOCT/1.1.0-foss-2020b-Python-2.7.18/bin/concoct_coverage_table.py", line 91, in
generate_input_table(args.bedfile, args.bamfiles, samplenames=samplenames)
File "/opt/software/CONCOCT/1.1.0-foss-2020b-Python-2.7.18/bin/concoct_coverage_table.py", line 42, in generate_input_table
sys.stderr.write(err)
TypeError: expected a string or other character buffer object
$ concoct_coverage_table.py contigs_10K.bed ~/bam > coverage_table.tsv
[E::hts_open_format] Failed to open file "/mnt/home/howla1keCMICH/bam" : No such file or directory
ERROR: fail to open index BAM file '/mnt/home/howla1keCMICH/bam'
Traceback (most recent call last):
File "/opt/software/CONCOCT/1.1.0-foss-2020b-Python-2.7.18/bin/concoct_coverage_table.py", line 91, in
generate_input_table(args.bedfile, args.bamfiles, samplenames=samplenames)
File "/opt/software/CONCOCT/1.1.0-foss-2020b-Python-2.7.18/bin/concoct_coverage_table.py", line 42, in generate_input_table
sys.stderr.write(err)
TypeError: expected a string or other character buffer object
$ concoct_coverage_table.py contigs_10K.bed ~/mnt/gs21/scratch/E58_Concoct2/bam > coverage_table.tsv
[E::hts_open_format] Failed to open file "/mnt/home/mnt/gs21/scratch/E58_Concoct2/bam" : No such file or directory
ERROR: fail to open index BAM file '/mnt/home/howla1keCMICH/mnt/gs21/scratch/E58_Concoct2/bam'
Traceback (most recent call last):
File "/opt/software/CONCOCT/1.1.0-foss-2020b-Python-2.7.18/bin/concoct_coverage_table.py", line 91, in
generate_input_table(args.bedfile, args.bamfiles, samplenames=samplenames)
File "/opt/software/CONCOCT/1.1.0-foss-2020b-Python-2.7.18/bin/concoct_coverage_table.py", line 42, in generate_input_table
sys.stderr.write(err)
TypeError: expected a string or other character buffer object

@arijitnus
Copy link

arijitnus commented Dec 1, 2022

The same issue is being faced by me, and can't figure out the reason @howla1ke .
A similar discussion is found here #307
Let's try this, if that helps us solve

@howla1ke
Copy link
Author

howla1ke commented Dec 2, 2022

Hi, thank you! Let me know if you try this please. I am going to use Concoct through Anvio to see if I can get it to bin this way. I’ll let you know how this goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants