Package: koverage
Quickly get coverage statistics given reads and an assembly.MotivationWhile there are tools that will calculate read-coverage statistics, they do not scale particularly well for large
datasets, large sample numbers, or large reference FASTAs.
Koverage is designed to place minimal burden on I/O and RAM to allow for maximum scalability.InstallKoverage is available on PyPI and Bioconda.Recommend create env for installation:condacreate-nkoveragepython=3.11
condaactivatekoverageInstall with PIP:pipinstallkoverageInstall with Bioconda:condainstall-cbiocondakoverageTest the installationkoveragetestDeveloper install:gitclonehttps://github.com/beardymcjohnface/Koverage.gitcdKoverage
pipinstall-e.UsageGet coverage statistics from mapped reads (default method).koveragerun--readsreadDir--refassembly.fastaGet coverage statistics using kmers (scales much better for very large reference FASTAs).koveragerun--readsreadDir--refassembly.fastakmerAny unrecognised commands are passed onto Snakemake.
Run Koverage on a HPC using a Snakemake profile.koveragerun--readsreadDir--refassembly.fasta--profilemySlurmProfileParsing samples with--readsYou can pass either a directory of reads or a TSV file to--reads.
Note that Koverage expects your read file names to include R1 or R2 e.g. Tynes-BDA-rw-1_S14_L001_R1_001.fastq.gz or SRR7141305_R2.fastq.gz.Directory:Koverage will infer sample names and _R1/_R2 pairs from the filenames.TSV file:Koverage expects 2 or 3 columns, with column 1 being the sample name and columns 2 and 3 the reads files.More information and examples are available hereTestYou can test the methods with the inbuilt dataset like so.# test default methodkoveragetest# test all methodskoveragetestmapkmercovermCoverage methodsMapping-based (default)koveragerun...# orkoveragerun...mapThis method will map reads using minimap2 and use the mapping coordinates to calculate coverage.
This method is suitable for most applications.Kmer-basedkoveragerun...kmerThis method calculatesJellyfishdatabases of the sequencing reads.
It samples kmers from all reference contigs and queries them from the Jellyfish DBs to calculate coverage statistics.
This method is exceptionally fast for very large reference genomes.CoverMkoveragerun...covermWe've included a wrapper forCoverMwhich you may find useful.
The wrapper manually runs minimap2 and then invokes CoverM on the sorted BAM file.
It then combines the output from all samples like the other methods.
If you have a large tempfs/ you'll probably find it faster to run CoverM directly on your reads.CoverM is not currently available for MacOS.OutputsMapping-basedDefault output files using fast estimations for mean, median, hitrate, and variance.sample_coverage.tsvPer sample and per contig counts.ColumndescriptionSampleSample name derived from read file nameContigContig ID from assembly FASTACountRaw mapped read countRPMReads per millionRPKMReads per kilobase millionRPKReads per kilobaseTPMTranscripts per millionMeanEstimatedmean read depthMedianEstimatedmedian read depthHitrateEstimatedfraction of contig with depth > 0VarianceEstimatedread depth varianceall_coverage.tsvPer contig counts (all samples).ColumndescriptionContigContig ID from assembly FASTACountRaw mapped read countRPMReads per millionRPKMReads per kilobase millionRPKReads per kilobaseTPMTranscripts per millionKmer-basedOutputs for kmer-based coverage metrics.
Kmer outputs are gzipped as it is anticipated that this method will be used with very large reference FASTA files.sample_kmer_coverage.NNmer.tsv.gzPer sample and contig kmer coverage.ColumndescriptionSampleSample name derived from read file nameContigContig ID from assembly FASTASumSum of sampled kmer depthsMeanMean sampled kmer depthMedianMedian sampled kmer depthHitrateFraction of kmers with depth > 0VarianceVariance of lowest 95 % of sampled kmer depthsall_kmer_coverage.NNmer.tsv.gzContig kmer coverage (all samples).ColumndescriptionContigContig ID from assembly FASTASumSum of sampled kmer depthsMeanMean sampled kmer depthMedianMedian sampled kmer depth