Coverage For Fastq Files
2
1
Entering edit mode
13.3 years ago
Assa Yeroslaviz ★ 1.9k

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 • 7.1k views
ADD COMMENT
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.

ADD REPLY
8
Entering edit mode
13.3 years ago
Karl ▴ 350

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.

ADD COMMENT
0
Entering edit mode

sorry I mixed it with the bam files.

ADD REPLY
2
Entering edit mode
13.3 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.

ADD COMMENT

Login before adding your answer.

Traffic: 1748 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6