BinPro / CONCOCT

Clustering cONtigs with COverage and ComposiTion
Other
122 stars 48 forks source link

TypeError: write() argument must be str, not bytes #300

Open Valentin-Bio-zz opened 3 years ago

Valentin-Bio-zz commented 3 years ago

Hello, when I run concoct_coverage_table.py I got the following messages on stdout:

[E::idx_find_and_load] Could not retrieve index file for '/datos/vinid/com_bam/201706_bam/sorted_bam/FP.JUN2017_L4S1D05.sort.bam' ERROR: fail to open index BAM file '/datos/vinid/com_bam/201706_bam/sorted_bam/FP.JUN2017_L4S1D05.sort.bam' Traceback (most recent call last): File "/datos/vinid/miniconda3/envs/concoct_env/bin/concoct_coverage_table.py", line 91, in generate_input_table(args.bedfile, args.bamfiles, samplenames=samplenames) File "/datos/vinid/miniconda3/envs/concoct_env/bin/concoct_coverage_table.py", line 41, in generate_input_table sys.stderr.write(out) TypeError: write() argument must be str, not bytes

I suppose that there are issues regarding to my sorted bam files, but when I run samtools view some.sort.bam file, it seems to be sorted . what can be wrong?

this is the command that I used: concoct_coverage_table.py contigs_10K.bed /path-to/sorted_bam/*sort.bam > coverage_table.tsv I have previously produced the splitted contigs file (10kbp) and got the contigs_10K.fa and the contigs_10k.bed file.

alneberg commented 3 years ago

Hi @Valentin-Bio, could you make sure your bam files are not only sorted but also indexed?

Best wishes, Johannes

Valentin-Bio-zz commented 3 years ago

Hi Johannes, thanks for your answer, there has been a problem with the indexed bam files but now they are good, now I got another problem regarding to the "contigs_10K.bed" file . I got the following error message at running concoct_coverage_table.py:

what can be wrong? I tried with running again the cut_up_fasta.py program and got the same error message when running concoct_coverage_table.py.

El lun., 29 de marzo de 2021 9:02 a. m., Johannes Alneberg @. @.)> escribió:

Hi @Valentin-Bio (https://github.com/Valentin-Bio), could you make sure your bam files are not only sorted but also indexed? Best wishes, Johannes

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub (https://github.com/BinPro/CONCOCT/issues/300#issuecomment-809321747), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AKCLXSKFKXSOXOOCCG5N5LLTGB255ANCNFSM4ZYS3S6Q).

alneberg commented 3 years ago

Sorry, there seems to be something missing from your reply? Can you please add the complete error message?

Valentin-Bio-zz commented 3 years ago

the error message was refering to contigs_10K.bed file:

"Errors in BED line 'c_000000353052 0 1378 c_000000253052.concoct_part_0'

this message is repeated multiple times in stdout.

Valentin-Bio-zz commented 3 years ago

It seems that the row names of chr column between BAM and bed files are not the same so they dont match: https://www.biostars.org/p/419172/

if this is the problem, how can I replace the names of the rows of the bed file so they match the names of the bam files (including subcontigs) ?

alneberg commented 3 years ago

Are you able to share any of these files? It's quite hard to debug without access to the files.

Valentin-Bio-zz commented 3 years ago

yes, here I provide the bed file and one of the bam files https://www.dropbox.com/sh/usa60nb5shl289u/AACnAg15fHQphi2IYjo7dZrha?dl=0

Valentin-Bio-zz commented 3 years ago

Hello Alneberg, the error was regarding to a bug using bowtie2, it is solved, now when I run concoct I got the following error:

ImportError: libmkl_rt.so: cannot open shared object file: No such file or directory

what should I do with this ?

zakisaati commented 3 years ago

Hello, I had a similar problem when running concoct command.

When I ran "locate libmkl_rt.so" one of the results was:

/home/zaki/anaconda3/envs/concoct/lib/libmkl_rt.so.1

Thus, I rename that file ("libmkl_rt.so.1") to libmkl_rt.so (removing the ".1" in the filename) and it worked properly