[BioC] (no subject)
Herve Pages
hpages at fhcrc.org
Mon Jan 29 21:58:22 CET 2007
Qing Jing wrote:
> library(Biostrings);
> dnaAlph<-new("BioPatternAlphabet",DNAAlphabet(),c(N="AGCT",
> B="CGT",D="AGT",H="ACT",K="GT",M="AC",R="AG",S="CG",
> V="ACG",W="AT",Y="CT"));
> Error in getClass(Class, where =
> topenv(parent.frame())) :
>
> "BioPatternAlphabet" is not a defined
> class
[This is a copy/paste of the answer I've already sent to the R-help list]
Hi Qing,
"BioPatternAlphabet" was a class defined in Biostrings 1 (Biostrings
version 1.y.z). In Biostrings 2, the class system has changed and you don't
need to create an instance of the DNA alphabet anymore:
- To create a DNAString object, just do:
> mydna <- DNAString("AGG-HCNTT")
> mydna
9-letter "DNAString" object
Value: AGG-HCNTT
- To get the DNA alphabet, call alphabet() on a DNAString object:
> alphabet(mydna)
[1] "A" "C" "G" "T" "M" "R" "S" "V" "W" "Y" "H" "K" "D" "B" "N" "-"
or, if you don't have a DNAString instance yet:
> DNA_ALPHABET
[1] "A" "C" "G" "T" "M" "R" "S" "V" "W" "Y" "H" "K" "D" "B" "N" "-"
Note that the "DNA alphabet" is the "IUPAC Extended Genetic Alphabet".
- To get the mapping between the DNA alphabet and the set of ambiguities
associated to each "extended" letter:
> IUPAC_CODE_MAP
A C G T M R W S Y K V
"A" "C" "G" "T" "AC" "AG" "AT" "CG" "CT" "GT" "ACG"
H D B N
"ACT" "AGT" "CGT" "ACGT"
- For more details, see:
> ?DNAString
Cheers,
H.
More information about the Bioconductor
mailing list