Coverage For Fastq Files
2
1
Entering edit mode
11.2 years ago
Assa Yeroslaviz ★ 1.7k

Hi,

Is there a way of calculating the coverage of a fastq file using the "ShortRead" function coverage?

When doing so I get

> coverage(dilpR1)


Error in function (classes, fdef, mtable) : unable to find an inherited method for function "coverage", for signature "ShortReadQ"

Is there a way of calling it, so that it will work?

Thanks

Assa

r coverage short • 5.9k views
7
Entering edit mode

Fastq files must be aligned to a reference genome in order to compute coverage. Otherwise they are merely anonymous sequence without coordinates/context from which to asses coverage.

6
Entering edit mode
11.2 years ago
Karl ▴ 340

Coverage is defined as the read depth at a location. FastQ files are sequence with quality scores. You can't compute coverage because you dont have read depth or location.

I computed coverage with a tool called coverageBED from BEDTOOLS which takes a set of regions (as a BED file) and a set of (sorted) aligned reads (as SAM or BAM) and counts how many fall onto each region.

No FastQ involved in the process, although you might want to align the fastQ to a reference and obtain a SAM or BAM that way.

0
Entering edit mode

sorry I mixed it with the bam files.

2
Entering edit mode
11.2 years ago

In order to calculate coverage with tools available in the bioconductor universe, you will first have to align the reads to the genome.

Given various type of alignment formats, the ShortRead package will be able to load these alignments into your R workspace as an object that should be easy to convert into a GRanges object, or GappedAlignment object, or similar. You can then use coverage on those to get what you're after.