Description Usage Arguments Value Examples
View source: R/extractCytosinesFromFASTA.R
Extract cytosine coordinates and context information from a FASTA file. Cytosines in ambiguous reference contexts are not reported.
1 2 | extractCytosinesFromFASTA(file, contexts = c("CG", "CHG", "CHH"),
anchor.C = NULL)
|
file |
A character with the file name. |
contexts |
The contexts that should be extracted. If the contexts are named, the returned object will use those names for the contexts. |
anchor.C |
A named vector with positions of the anchoring C in the |
A GRanges-class
object with coordinates of extracted cytosines and meta-data column 'context'.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Read a non-compressed FASTA files:
filepath <- system.file("extdata", "arabidopsis_sequence.fa.gz", package="methimpute")
## Only CG context
cytosines <- extractCytosinesFromFASTA(filepath, contexts = 'CG')
table(cytosines$context)
## Split CG context into subcontexts
cytosines <- extractCytosinesFromFASTA(filepath,
contexts = c('DCG', 'CCG'),
anchor.C = c(DCG=2, CCG=2))
table(cytosines$context)
## With contexts that differ only by anchor
cytosines <- extractCytosinesFromFASTA(filepath,
contexts = c('DCG', 'CCG', 'CCG', 'CWG', 'CHH'),
anchor.C = c(DCG=2, CCG=2, CCG=1, CWG=1, CHH=1))
table(cytosines$context)
## With named contexts
contexts <- c(CG='DCG', CG='CCG', CHG='CCG', CHG='CWG', CHH='CHH')
cytosines <- extractCytosinesFromFASTA(filepath,
contexts = contexts,
anchor.C = c(DCG=2, CCG=2, CCG=1, CWG=1, CHH=1))
table(cytosines$context)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.