Entering edit mode
8.4 years ago
zzzahiri
•
0
hi How can define a variable of type list of different lengths? and how can define n different xS in the for loop? for example
xS in for loop
library(seqinr)
x1=read.fasta("dbppt.fasta", seqtype="AA")
library(protr)
x2=getSequence(x1)
s=matrix(data = NA, nrow = 31012, ncol = 1, byrow = FALSE,dimnames = NULL)
for(n in 1:31012) {
s[n]= c2s(x2[[n]])
}
for(n in 1:31012){
xS=protseg(s[n] , aa="S", k=7)
}
Simple. Don't use a for loop.