nrow,ncol name,matrix name
My input;
seq1="GCATGCU"
seq2="GATTACA"
n=length(s1string) #seq1
m=length(s2string) #seq2
This matrix
D <- matrix(0,nrow=m+1, ncol=n+1)
seq1 and seq2 length = 7 but I must create matrix 8x8:
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
[1,] 0 -1 -2 -3 -4 -5 -6 -7
[2,] -1 1 0 -1 -2 -3 -4 -5
[3,] -2 0 0 1 0 -1 -2 -3
[4,] -3 -1 -1 0 2 1 0 -1
[5,] -4 -2 -2 -1 1 1 0 -1
[6,] -5 -3 -3 -1 0 0 0 -1
[7,] -6 -4 -2 -2 -1 -1 1 0
[8,] -7 -5 -3 -1 -2 -2 0 0
I want to define matrix ncol with s1string, nrow= s2string but start colname and rowname [2, ], [,2]. For example, [,2]="G" [,3]="C" [,4]="A" [,5]="T" [,6]="G" [,7]="C" [,8]="T". I don't want define in this [1,1]. Can you help me for this topic?
• 2,636 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Please explain why you posted the same question again, you have gotten an answer already.
Hello gizemtatar!
Questions similar to yours can already be found at:
We have closed your question to allow us to keep similar content in the same thread.
If you disagree with this please tell us why in a reply below. We'll be happy to talk about it.
Cheers!
Because my question don't answer.
I try it but programme give error:
For sure it won't work, because dimnames must have same length as the matrix dimensions, why do you want to assign 7 dimnames to an 8x8 matrix. Your matrix looks like a scoring matrix. So the solution is obvious: define proper dimension names of length 8. So what's in the additional column?
Also, if your original question is not answered correctly, please attend the original question instead of posting again.
Yes, I know. I create scoring matrix but this matrix Needleman-Wunsch global alignment matrix. And I need this matrix.
I have answered your initial question.