##load example data and plot it
data(TULASequences)
plot(TULASequences)
## Access all sequences which have a 4 in position 1
print(TULASequences[TULASequences[,1] == 4,])
## Access all sequences which have an tyrosine residue in position 1 and
## cluster
TULASequences.subset <- TULASequences[TULASequences[,1] == which(TULASequences@alphabet == 'Y'),]
plot(TULASequences.subset)
##Calculate distance matrix on this subset and use agglomerative
## clustering to plotit
TULA.dmatrix <- dist(TULASequences.subset)
TULA.hclusters <- hclust(TULA.dmatrix)
plot(TULA.hclusters)Run the code above in your browser using DataLab