wwood / CoverM

Read coverage calculator for metagenomics
GNU General Public License v3.0
273 stars 30 forks source link

Error: There are no found reference sequences that are a part of a genome #182

Closed vmkhot closed 10 months ago

vmkhot commented 10 months ago

Hi there!

I'm trying out coverM for the first time! I first ran the coverage "trimmed_mean" command on 18x2 read files and kept the produced bam files from mapping. It ran successfully (yay)

coverm genome -v -x fa -t 20 --methods trimmed_mean -1 ../../01_qc/qc_files/CAT_S52_R1_001.qc.fastq -2 ../../01_qc/qc_files/CAT_S52_R2_001.qc.fastq --genome-fasta-directory ../allBins/bins --bam-file-cache-directory ../../03_mapping/coverm_bam -o out_genome_coverage.tsv

Next, I wanted to use the same produced bam files to calculate relative abundances of a set of filtered genomes. I have all 18 bam files in a list in the actual command but simplified it below

coverm genome -v -x fa -t 20 --methods relative_abundance --bam-files ../../03_mapping/coverm_bam/coverm-genome.CAT_S52_R1_001.qc.fastq.bam --genome-fasta-directory ../allBins/bins/to_keep -o output_relative_abundances.tsv

However, I get the following error image

I "headed" by bam file -> it looks like this image

And a sample of my genome fasta files image

I'm not sure but my guess is that the headers don't match? But I'm hoping for a way to make this without having to redo mapping and generate more bams again!

Any help is much appreciated!

Cheers,

Varada

wwood commented 10 months ago

Hey,

Yes, when you provide CoverM a set of genomes it changed the headers, because otherwise it is possible 2 contigs from different genomes have the same name, which confuses things.

If you want to re-use the BAM files I suggest using -s '~' instead of genome-fasta-directory.

HTH

vmkhot commented 10 months ago

ok, that seems to have worked!

Thanks again

V