From: Jacob Mick on
"Roger Stafford" <ellieandrogerxyzzy(a)mindspring.com.invalid> wrote in message <i12qj4$oq5$1(a)fred.mathworks.com>...
> "Jacob Mick" <jam7w2DELETETHISTEXT(a)mail.missouri.edu> wrote in message <i12lhs$s5k$1(a)fred.mathworks.com>...
> > Sorry for the unclear explanation. I want matrix C to have the values of B but be numbered according to cells of A.
> >
> > matrix A
> > [1] = x
> > [2] = y
> > [3] = z
> >
> > matrix B
> > [x,y] = r
> > [x,z] = n
> >
> > matrix c
> > [1,2] = r
> > [1,3] = n
> >
> >
> > I'm trying to derive information from the statistical coupling matrix of a protein, by looking at the coupled residues that don't appear in the contact map.
> >
> > Matrix A is my matrix used for translating the sequence alignment used in the SCA to a well studied protein's sequence.
> >
> > Matrix B is the contact map of the well studied protein.
> - - - - - - - - - -
> What is the difficulty with the solution I suggested, Jacob? Suppose A and B are defined as
>
> A = [2 3 1];
>
> B = [10 11 12;
> 13 14 15;
> l6 17 18];
>
> Then when you do C = B(A,A) it results in:
>
> C = 14 15 13
> 17 18 16
> 11 12 10
>
> This is compatible with what you stated:
>
> x = A(1) = 2
> y = A(2) = 3
> z = A(3) = 1
> r = B(x,y) = B(2,3) = 15
> n = B(x,z) = B(2,1) = 13
> C(1,2) = 15 = r
> C(1,3) = 13 = n
>
> Also as far as I can determine C = B(A,A) also satisfies all your earlier conditions. If you want something else please describe it to us in such a way that we know exactly what you mean. Please, no more vague statements! For example, with the above A and B, exactly how would you like C to be if the above C is not what you want? Give all its nine values that you would like to see in their desired locations.
>
> Note that this code still functions without error even if A is not a permutation of 1:size(B,1). However in that case there will be values in B that do not occur in C and some that will be duplicated.
>
> Roger Stafford

Thank you so much for helping! What you send me was close but it didn't do the full cell.

Here's a zip file of matrices A and B, "ats.mat" and "abba.mat"
http://www.mediafire.com/?nfqyymgzimj

abba.mat, a contact map is symmetric if that helps at all

When I ran C=abba('ats,ats')
C=
(1,1) =56
(2,2) =12
(3,2) =32
(2,3) =32
(3,3) =56
and that's all
Cell (2,2) should be 42
(3,2) = 35 = (2,3)
and (3,3) 20


It left out the majority of the cell
(2,1) = 56
(3,1) = 40
(4,1) = 47
....
(1,3) = 40
(1,2) = 56
....
....
(442,443) = 35
[that was from cell (454,455)]

There is some cells in "abba" that don't exist in "ats," I was going to manually prune these, as well as the zeroes in "ats."

I really appreciate working with me. This isn't my strong suit.
 | 
Pages: 1
Prev: Dynamically Sized Matrices
Next: find coordinates