View source: R/coverageToExon.R
coverageToExon | R Documentation |
This function extracts the coverage information calculated by fullCoverage for a set of exons determined by makeGenomicState. The underlying code is similar to getRegionCoverage with additional tweaks for calculating RPKM values.
coverageToExon(
fullCov = NULL,
genomicState,
L = NULL,
returnType = "raw",
files = NULL,
...
)
fullCov |
A list where each element is the result from
loadCoverage used with |
genomicState |
A GRanges object created with makeGenomicState.
It can be either the |
L |
The width of the reads used. Either a vector of length 1 or length equal to the number of samples. |
returnType |
If |
files |
A character vector with the full path to the sample BAM files
(or BigWig files).
The names are used for the column names of the DataFrame. Check
rawFiles for constructing |
... |
Arguments passed to other methods and/or advanced arguments. Advanced arguments:
Passed to extendedMapSeqlevels and define_cluster. |
Parallelization is used twice.
First, it is used by strand. Second, for processing the exons by
chromosome. So there is no gain in using mc.cores
greater than the
maximum of the number of strands and number of chromosomes.
If fullCov
is NULL
and files
is specified, this function
will attempt to read the coverage from the files. Note that if you used
'totalMapped' and 'targetSize' before, you will have to specify them again
to get the same results.
A matrix (nrow = number of exons in genomicState
corresponding to the chromosomes in fullCov
, ncol = number of
samples) with the number of reads (or RPKM) per exon. The row names
correspond to the row indexes of genomicState$fullGenome
(if
fullOrCoding='full'
) or genomicState$codingGenome
(if
fullOrCoding='coding'
).
Andrew Jaffe, Leonardo Collado-Torres
fullCoverage, getRegionCoverage
## Obtain fullCov object
fullCov <- list("21" = genomeDataRaw$coverage)
## Use only the first two exons
smallGenomicState <- genomicState
smallGenomicState$fullGenome <- smallGenomicState$fullGenome[
which(smallGenomicState$fullGenome$theRegion == "exon")[1:2]
]
## Finally, get the coverage information for each exon
exonCov <- coverageToExon(
fullCov = fullCov,
genomicState = smallGenomicState$fullGenome, L = 36
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.