metagentools / MetaCoAG

🚦🧬 Binning Metagenomic Contigs via Composition, Coverage and Assembly Graphs
https://metacoag.readthedocs.io/en/stable/
GNU General Public License v3.0
58 stars 5 forks source link

question of megahit #20

Open yuyuyu-fy opened 2 years ago

yuyuyu-fy commented 2 years ago

Hello! Sorry to bother you again. I ran several experiments with metacoag. There is no problem with running in spades mode, but this error is always reported when running several samples in megahit mode. I suspect it is the problem of name and ID. how can we solve it?

image
Vini2 commented 2 years ago

Hello @yuyuyu-fy,

Can you let me know what files you use as input and their format (copy-paste the output from head <file>), especially the format of the abundance file?

Thank you!

yuyuyu-fy commented 2 years ago

command is

image

abundance file

image

contigs file

image

gfa file

image
Vini2 commented 2 years ago

Hello @yuyuyu-fy,

I'm extremely sorry for the late reply. Can you share the files you are using so I can run a test?

Thank you!

josefawelling commented 1 year ago

Hello @Vini2,

I'm also trying to run MetaCoAG for a megahit assembly and getting the error described above.

This is the code I used to produce the input files megahit_core contig2fastg k-value path/to/contigs > path/to/fastg_out (also used megahit_toolkit)

gfastats path/to/fastg_out -o gfa > path/to/gfa_out

coverm contig -1 path/to/read1 -2 path/to/read2 -r path/to/contigs -o path/to/abundance -t 8 && sed -i '1d' path/to/abundance

MetaCoAG code: metacoag --assembler megahit --graph path/to/gfa_out --contigs path/to/contigs --abundance path/to/abundance --output path/to/binning/

I've tried to modify the contigs.fa file:

  1. rename fasta header & remove the k-value (see above 'k141_' )
  2. sort fasta file by renamed ID

I've also tried to run it with the data you used in your paper (accession numbers ERR970400, ERR970477) Always got the same error..

I suspect the problem is that there is no connection between the contigs header and the fastg header. Could you help me, I don't know what else to try?

Thanks!

Vini2 commented 1 year ago

Hi @josefawelling,

Thanks for your interest in MetaCoAG.

Can you show me the first few lines of your --graph file and --contigs file?

Also, can you try running metacoag with the --assembler parameter as megahitc and see if it works.

Let me know what happens!

josefawelling commented 1 year ago

Hi @Vini2,

thanks for the quick reply! Changing to --assembler megahitc leads to the same key error. Here are the first few lines of the contig & graph files.

contigs graph