Description Usage Arguments Author(s) See Also Examples
export
methods for BSgenome objects.
NOTE: The export
generic function and most of
its methods are defined and documented in the rtracklayer package.
This man page only documents the 2 export
methods define in the BSgenome package.
1 2 3 4 |
object |
The BSgenome object to export. |
con |
A FastaFile or TwoBitFile object. Alternatively |
format |
If not missing, should be |
compress, compression_level |
Forwarded to |
verbose |
Whether or not the function should display progress.
|
... |
Extra arguments. The method for TwoBitFile objects
forwards them to |
Michael Lawrence
BSgenome objects.
The export
generic, and
FastaFile and TwoBitFile
objects in the rtracklayer package.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | library(BSgenome.Celegans.UCSC.ce2)
genome <- BSgenome.Celegans.UCSC.ce2
## Export as FASTA file.
out1_file <- file.path(tempdir(), "Celegans.fasta")
export(genome, out1_file)
## Export as twoBit file.
out2_file <- file.path(tempdir(), "Celegans.2bit")
export(genome, out2_file)
## Sanity checks:
dna0 <- DNAStringSet(as.list(genome))
system.time(dna1 <- import(out1_file))
stopifnot(identical(names(dna0), names(dna1)) && all(dna0 == dna1))
system.time(dna2 <- import(out2_file)) # importing twoBit is 10-20x
# faster than importing non
# compressed FASTA
stopifnot(identical(names(dna0), names(dna2)) && all(dna0 == dna2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.