[R] about the analysis of strings, thanks

Dimitrios Rizopoulos Dimitris.Rizopoulos at med.kuleuven.be
Sun Jun 18 13:02:00 CEST 2006


I'm not aware of package for amino acid sequence analysis, but it'd 
better to search yourself using, e.g., RSiteSearch() and help.search().

Regarding your question consider the following:

strg1 <- c("AAA", "AA", "AAAA")
strg2 <- c("BBB", "BBBB", "BBB")

strg <- paste(strg1, strg2, sep = "")
nA <- nchar(gsub("B", "", strg, fixed = TRUE))
nB <- nchar(gsub("A", "", strg, fixed = TRUE))

strg
nA # freq of A's
nB # freq of B's


I hope it helps.

Best,
Dimitris

---- 
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
     http://www.student.kuleuven.be/~m0390867/dimitris.htm


Quoting ucecgxu at ucl.ac.uk:

> Dear R-helpers:
> 
> thank your for your attention.
> 
> i am a newer to R and i am doing some protein category classification
> based on
> the amino acid sequence.while i have some question urgent.
> 
> 1. any packages for analysis amino acid sequence
> 2. given two sequences "AAA" and "BBB",how can i combine them into
> "AAABBB"
> 
> 3. based on "AAABBB",how can i get some statistics of this string
> such as how
> many letters,how many "A"s in the string.
> 
> 
> Thank you very much and i am looking forward to hearing from you
> soon
> 
> have a nice day!
> 
> Best Regards
> 
> Marshall
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
> 
> 


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm



More information about the R-help mailing list