export_sq {tidysq} | R Documentation |
Export sq objects into other formats
Description
Converts object of class sq
to a class
from another package. Currently supported packages are ape,
bioseq, Bioconductor and seqinr. For exact list of
supported classes and resulting types, see details.
Usage
export_sq(x, export_format, name = NULL, ...)
Arguments
x |
[ |
export_format |
[ |
name |
[ |
... |
further arguments to be passed from or to other methods. |
Details
Currently supported formats are as follows (grouped by sq
types):
-
ami:
-
"ape::AAbin"
-
"bioseq::bioseq_aa"
-
"Biostrings::AAString"
-
"Biostrings::AAStringSet"
-
"seqinr::SeqFastaAA"
-
-
dna:
-
"ape::DNAbin"
-
"bioseq::bioseq_dna"
-
"Biostrings::DNAString"
-
"Biostrings::DNAStringSet"
-
"seqinr::SeqFastadna"
-
-
rna:
-
"bioseq::bioseq_rna"
-
"Biostrings::RNAString"
-
"Biostrings::RNAStringSet"
-
Value
An object with the format specified in the parameter. To find information about the detailed structure of this object, see documentation of these objects.
See Also
Functions from output module:
as.character.sq()
,
as.matrix.sq()
,
as.sq()
,
write_fasta()
Examples
# DNA and amino acid sequences can be exported to most packages
sq_ami <- sq(c("MVVGL", "LAVPP"), alphabet = "ami_bsc")
export_sq(sq_ami, "ape::AAbin")
export_sq(sq_ami, "bioseq::bioseq_aa")
export_sq(sq_ami, "Biostrings::AAStringSet", c("one", "two"))
export_sq(sq_ami, "seqinr::SeqFastaAA")
sq_dna <- sq(c("TGATGAAGCGCA", "TTGATGGGAA"), alphabet = "dna_bsc")
export_sq(sq_dna, "ape::DNAbin", name = c("one", "two"))
export_sq(sq_dna, "bioseq::bioseq_dna")
export_sq(sq_dna, "Biostrings::DNAStringSet")
export_sq(sq_dna, "seqinr::SeqFastadna")
# RNA sequences are limited to Biostrings and bioseq
sq_rna <- sq(c("NUARYGCB", "", "DRKCNYBAU"), alphabet = "rna_ext")
export_sq(sq_rna, "bioseq::bioseq_rna")
export_sq(sq_rna, "Biostrings::RNAStringSet")
# Biostrings can export single sequences to simple strings as well
export_sq(sq_dna[1], "Biostrings::DNAString")