Question: Problem 1 , part ( i ) . Download DNASeqs.RData and then load it into your R workspace ( see HW 8 for how to

Problem 1, part (i).
Download DNASeqs.RData and then load it into your R workspace (see HW8 for how to load external .RData files). The data frame dna.seq has 11 rows and 1620 columns, where each row vector is the DNA sequence of some protein. The length of the sequence is 1620, and each column represents one nucleotide. Run the following code to compute the distance matrix, dna.dist, which will be used for hierarchical clustering.
n <- nrow(dna.seq)
D <- matrix(0, nrow=n, ncol=n) # create an empty n-by-n matrix
row.names(D)<- row.names(dna.seq)
for (i in 1:n){
for (j in 1:i){
D[i, j]<- sum(dna.seq[i,]!= dna.seq[j,])
}
}
# convert the numeric matrix D to a "distance matrix" object
dna.dist <- as.dist(D)
According to dna.dist, what is the distance between Pbe5 and Pme2?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!