# NOT RUN {
## Residue hydropathy values
seq <- c("R","S","D","X","-","X","R","H","Q","V","L")
aa2index(seq)
# }
# NOT RUN {
## Use a sliding window average
aa2index(aa=seq, index=22, window=3)
## Use an alignment
aln <- read.fasta(system.file("examples/hivp_xray.fa",package="bio3d"))
prop <- t(apply(aln$ali, 1, aa2index, window=1))
## find and use indices for volume calculations
i <- which(sapply(aa.index,
function(x) length(grep("volume", x$D, ignore.case=TRUE)) != 0))
sapply(i, function(x) aa2index(aa=seq, index=x, window=5))
# }
Run the code above in your browser using DataLab