Re: [R] "ACCTGMX" to "1223400" in R?

2010-07-21 Thread John1983
Dear all, Thank you for the help. Yes I should have posted in the Bioconductor's forum. Next time I sure will. The chartr function helped and now the code is significantly faster. I have also used the Bstrings as suggested by Martin. Thank you again. -- View this message in context: http://r.78

Re: [R] "ACCTGMX" to "1223400" in R?

2010-07-19 Thread Martin Morgan
On 07/19/2010 06:37 PM, David Winsemius wrote: > > On Jul 19, 2010, at 5:31 PM, John1983 wrote: > >> >> Hi, >> >> I am a newbie in R and was working on some DNA data represented as >> strings >> of A,C,T and G (also wild-character like M and X). I use the Bioconductor >> package in R. > > Well,

Re: [R] "ACCTGMX" to "1223400" in R?

2010-07-19 Thread Gabor Grothendieck
On Mon, Jul 19, 2010 at 5:31 PM, John1983 wrote: > > Hi, > > I am a newbie in R and was working on some DNA data represented as strings > of A,C,T and G (also wild-character like M and X). I use the Bioconductor > package in R. Currently I need to convert a string of the form "ACCTGMX" to > "12234

Re: [R] "ACCTGMX" to "1223400" in R?

2010-07-19 Thread jim holtman
Here is another way of doing it with 'chartr'; I only assume that you have the upper characters, but you can add to the strings to cover any others: > tst <- rep( "ACCTGMX", 5) > chartr("ACTGBDEFHIJKLMNOPQRSUVWXYZ", "123400", tst) [1] "1223400" "1223400" "1223400" "1223400" "12

Re: [R] "ACCTGMX" to "1223400" in R?

2010-07-19 Thread David Winsemius
On Jul 19, 2010, at 5:31 PM, John1983 wrote: Hi, I am a newbie in R and was working on some DNA data represented as strings of A,C,T and G (also wild-character like M and X). I use the Bioconductor package in R. Well, I guess it's sort of a "meta" package, but it is really more of a

[R] "ACCTGMX" to "1223400" in R?

2010-07-19 Thread John1983
Hi, I am a newbie in R and was working on some DNA data represented as strings of A,C,T and G (also wild-character like M and X). I use the Bioconductor package in R. Currently I need to convert a string of the form "ACCTGMX" to "1223400" i.e. A is replaced by 1, C with 2, T with 3, G with 4 and