BinPro / CONCOCT

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

Error with extract_fasta_bins.py #217

Closed dayuzou closed 5 years ago

dayuzou commented 5 years ago

Hi, I have been trying to use the extract_fasta_bins.py script to get bins, but get into some troubles. My command is: $ python extract_fasta_bins.py ../scaffold.fa bin1_clustering_gt1000.csv --output_path ./bin And the error is:

Traceback (most recent call last):
  File "extract_fasta_bins.py", line 38, in <module>
 main(args)
  File "extract_fasta_bins.py", line 26, in main
    seqs = [all_seqs[contig_id] for contig_id in contig_ids] 
KeyError: 'contig_id'

The clustering file:

contig_id,0
scaffold_0,193
scaffold_1,193
scaffold_2,193
scaffold_3,193

I have checked the clustering file and my scaffold.fa file and the contig_id was same in two files, so I am not sure where went wrong.

alneberg commented 5 years ago

Hi @dayuzou, I think the issue is the first line in your clustering file. Just remove that single line and try if that solves it.

However, I'm curious why this line ended up in there in the first place, is this a problem at a different step of concoct?

Thanks!

dayuzou commented 5 years ago

Hi @alneberg , thank you for your suggestion and it worked :). FYI, the log file did not show any errors when concoct finished, and here is my commond of running concoct: $ nohup concoct --coverage_file ../Depth.txt --composition_file ../scaffold.fa -l 1000 -b bin1 --no_original_data -t 32 &

Thanks!

alneberg commented 5 years ago

Thats great!

Aha, your command looks fine, so I have to look into why this happened.

alneberg commented 5 years ago

I think this error is fixed now since the extract_fasta_bins.py script now expects a header in the clustering file.