**0**wrote:

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?

Please explain why you posted the same question again, you have gotten an answer already.

47kHello 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!

47kBecause my question don't answer.

ı try it but programme give error :

Error in dimnames(x) <- dn :

length of 'dimnames' [2] not equal to array extent

0For sure it won't work, because dimnames

musthave 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?47kAlso, if your original question is not answered correctly, please attend the original question instead of posting again.

47kYes, I know. I create scoring matrix but this matrix Needleman-Wunsch global alignment matrix. And I need this matrix.

0I have answered your initial question.

47k