jlw-ecoevo / gRodon

17 stars 5 forks source link

Weighted metagenome mode #4

Closed eoliver20 closed 3 years ago

eoliver20 commented 3 years ago

Hi, I have been using gRodon in the metagenome mode but want to try running the weighted option. But it is unclear to me how the median depth is calculated. I am using Prokka to annotate my metagenome assemblies. Is there a way to use the output from Prokka to calculate the read depth?

Thanks for your help!

jlw-ecoevo commented 3 years ago

Hi!

The read depth can be calculated using any read-mapping software to map the reads back to the genes output by prokka

For example, with the BWA aligner and using samtools to convert to bam output:

bwa index genes.ffn                                                                        

bwa mem genes.ffn reads.fwd.fastq.gs reads.rev.fastq.gz | samtools view -bS - > mapped_reads.bam 

And then you can get a nice summary table listing the average coverage of each gene using bamcov:

bamcov -H mapped_reads.bam > genes_coverage.tbl