# Ed's Big Plans

## CS 683 A4 Hints

This is a Structural Bioinformatics Course Hints Page for Assignment 4 (Winter 2010).

Hi!

• Hints for A4E1 has had a lot of activity, Annie and I have posted two conflicting conclusions however.
• A4E2 is very straight forward, I don’t really think anyone should mention it here.
• I’m currently working on A4E3.

Most items discussed on this page refer to Chimera software — see Dr. Burkowski’s course site for CS[46]83.

- Ed

Written by Eddie Ma

March 5th, 2010 at 7:06 pm

Posted in

### 24 Responses to 'CS 683 A4 Hints'

1. A4, Question 1

For this question, you can check out numpy.linalg.qr()

However, I haven’t figured out a way to get it to definitely maintain the direction of the nitrogen -> alpha-carbon bond.

Kyle

4 Mar 10 at 17:49

2. For the Nussinov algorithm, I get a top score of -161. Anybody else get that?

Kyle

5 Mar 10 at 01:01

3. Assignment 4 Q3a

For scoring using Single Base Pair model (Table 5.1),

Is,
deltaG(CG) = deltaG(GC) = -3
deltaG(AU) = deltaG(UA) = -2
deltaG(GU) = deltaG(UG) = -1

i.e. Is score for CG and GC same or the table suggests score for only CG, AU, GU and else is 0.

Assignment 4 Q1a

What is your resultant vector for the given test case?
This is just to check if my approach is correct.

Esh

5 Mar 10 at 23:13

4. For Nussinov Algorithm:

Using the RNA sequence from Page 26 of Unit10:
i.e. GCUCAAAGUCCAGGAGG
I get exact same DP Matrix as shown on slide.

So, using the sequence from Assignment 4, I get:
[[ 0. 0. 0. ..., -179. -179. -179.]
[ 0. 0. 0. ..., -176. -178. -178.]
[ 0. 0. 0. ..., -174. -176. -176.]
…,
[ 0. 0. 0. ..., 0. 0. 0.]
[ 0. 0. 0. ..., 0. 0. 0.]
[ 0. 0. 0. ..., 0. 0. 0.]] as my matrix.

I hope this isn’t giving away the solution. Hence the ‘…’.

Hope someone can put similar solution for MFOLD.

Esh

6 Mar 10 at 05:18

5. I fixed some bugs with my bifurcation, and I too get 179. Sounds good.

HINT: DO NOT, under any circumstances, decide to re-index the dot-plot matrix to save space, or you will permanently shorten your lifespan.

Kyle

9 Mar 10 at 13:58

6. @Esh – That’s not giving away the solution, don’t worry
@Kyle – Remember, two vectors are ‘in the same direction’ if their inner product is positive– just multiply by the signum of the dot product to check if two vectors are going in the same direction make the two vectors go in the same direction.

Okay– so I’ve finally gotten some work done on this assignment.

Eddie Ma

11 Mar 10 at 13:37

7. A4E1 – Final delta values…

Does anyone else have [-0.12 -0.26 3.22] as final values?

I’ll go ahead and put in the little arrows that Dr. Burkowski said would be helpful and post an image soon.

Notice: The values are rounded so as to not reveal the actual answer.

Update: Images follow…

Tough to see… The first snapshot– I have axes as follows: virtual x = red, virtual y = green, virtual z = blue.

Notice the axes have been set to 15Å instead of 1Å– the latter being too small to visualize.

Default functional groups are shown in this snap shot given by what Chimera labels as not part of the ribbon display.

Alphabet soup (composed of histadine)– a very clear image. We can actually see that the axes are incorrect. Notice that the x (red) axis is going down from the alpha carbon to the nitrogen (correct). The y (green) axis is supposed to run TOWARD the R-group, but it is instead running away from it (incorrect). The z (blue) axis is running toward the beta-carbon (correct). Yay! It turns out my definitions were wrong– and the image IS CORRECT! The y (green) axis is running toward the C (the carboxyl carbon) (correct). The z (blue) axis is running twoard the beta-carbon (first carbon of the side chain) (correct).

My previous notion of C (carboxyl carbon) and beta-carbon were reversed!

Only the histadines– one can compare this image with the previous to verify the directionality of each axis against the atoms of the bare residues.

I’ll have to figure out what’s wrong with this and post an update soon.

HUGE HINT! Find the z-axis first! If you know that your x-axis and the vector formed from alpha-carbon to carboxyl-carbon are going to be on a plane, then the z-axis is perpendicular to that plane! This makes finding the y-axis easy — each step just becomes finding a unit normal!

Eddie Ma

11 Mar 10 at 13:40

8. A4Q1: So, is anyone else getting these numbers?
For protein P:
xyz = [-0.81274255 -0.47409982 0.33864273] [ 0.24102583 -0.80276625 -0.54541076] [ 0.5304301 -0.36165689 0.7667126 ]
d = [-12.43496107 11.91098711 14.74788559]
For Protein Q:
xyz = [ 0.59473674 -0.13216372 0.79298232] [ 0.50132424 0.83207958 -0.23731325] [-0.62846019 0.53868017 0.56112517]
d = [ 15.62175171 -1.88990339 -3.27248202]
Findal Delta = [-28.05671279 13.8008905 18.0203676 ]

Annie

13 Mar 10 at 16:21

9. My values are different :/

px = [ 0.72216042 -0.33161826 -0.60705326]
py = [-0.17212295 -0.93613712 0.30662842]
pz = [-0.66996867 -0.11694711 -0.73312029]

pd = [ 3.78069754 -13.50512676 0.55496977]

qx = [-0.13333333 0.73333333 0.66666667]
qy = [-0.62447626 0.46017354 -0.63108614]
qz = [-0.76957886 -0.50046233 0.39659279]

qd = [ 3.9 -13.24194987 -2.66472582]

Delta(pq) = [-0.11930246 -0.26317689 3.21969558]

Both of our versions however are composed of orthogonal unit normals…

Eddie Ma

13 Mar 10 at 17:18

10. Ok, I got your numbers Eddie. Turns out I was using the wrong protein and the wrong residues. The 1MBN residues are offset by 1; It’s all good. Much thanks!

Annie

14 Mar 10 at 12:23

11. Ya, so dare I ask what’s up with the weird off-by-one error in 1mbn? I dropped my q indices by one and get the same answers as you guys. Any idea which is correct?
I do p.findResidue(i), q.findResidue(j), p.findResidue(r), q.findResidue(s). Is that what you guys did? Is there a better way?

Also, as a hint to those starting the question, check out Gram-Schmidt process on Wikipedia.

Kyle

14 Mar 10 at 16:42

12. Do you guys mind explaining what your reasoning is behind using the inputs
i=87; j=92; r=61; s=66
as opposed to the inputs
i=87; j=93; r=61; s=67
as given in the assignment?

..for the record with the later inputs I get a delta of
delta: [[-11.84105418 -11.61522337 3.82745178]]

Fiona

14 Mar 10 at 17:08

13. Hahah! Awesome!

I can get Fiona and Kyle’s values as follows…

PiCA [ 13.765 30.955 -3.916]
PiN [ 14.819 30.471 -4.802]
PiC [ 13.061 29.879 -3.101]
PiCB [ 12.723 31.758 -4.693]

PrCA [ 18.448 42.279 -10.759]

QjCA [ 6.7 31.5 -0.6]
QjN [ 7.6 31.3 0.6]
QjC [ 7.1 32.8 -1.4]
QjCB [ 5.2 31.3 -0.4]

QsCA [ 17.1 26.1 10.4]

xyz(Pi)
[ 0.72216042 -0.33161826 -0.60705326]
[-0.17212295 -0.93613712 0.30662842]
[-0.66996867 -0.11694711 -0.73312029]

xyz(Qj)
[ 0.59473674 -0.13216372 0.79298232]
[ 0.50132424 0.83207958 -0.23731325]
[-0.62846019 0.53868017 0.56112517]

d(Pir) [ 3.78069754 -13.50512676 0.55496977]
d(Pjs) [ 15.62175171 -1.88990339 -3.27248202]
D(PQijrs) [-11.84105418 -11.61522337 3.82745178]

What did I change?

My custom residue finding loop is as follows:

for ip, p in enumerate(P.residues):
if p.id.position == i:
I = ip
break

Where ‘i’ is the amino acid number to look for… this gives the wrong result even though I’m looking at “p.id.position”…

The resulting residue object is stored as ‘p’.

If the above is replaced with…

p = P.findResidue(i)

…then the results are consistent with Fiona and Kyle’s.

So– this means one thing: either I don’t understand “p.id.position == i” OR the information we garner from it is not the same as “p = P.findResidue(i)” …

Ugh… Fiona’s bothering Krzysztof tomorrow

Eddie Ma

14 Mar 10 at 19:38

14. This gets worse–

In my function to find the atoms CA, N, C, CB, the positions look like this:
>>> P.findResidue(i).id.position = 87
>>> P.findResidue(i).id.position = 94
>>> P.findResidue(i).id.position = 61
>>> P.findResidue(i).id.position = 68

(the last two “P”s are actually “Q”.)

BUT! When we call the findResidue function from console, the positions look like this:

>>> PDB_1JEB.findResidue(87).id.position
87
>>> PDB_1JEB.findResidue(93).id.position
93
>>> PDB_1MBN.findResidue(61).id.position
62
>>> PDB_1MBN.findResidue(67).id.position
68

What’s going on?!

Eddie Ma

14 Mar 10 at 19:47

15. i=87; j=93; r=61; s=67
gives me:
delta: [-11.84105418 -11.61522337 3.82745178]

and with i=87; j=92; r=61; s=66
delta = [-0.11930246 -0.26317689 3.21969558]

You shouldn’t be worried about indexes as that is always editable by Krzysztof. As long as the method is implemented correctly, we are good.

Esh

15 Mar 10 at 00:21

16. Can anyone try your algo. from Exercise 3a with example on Pg. 155 of text and check if you get same matrix as given on Figure 5.18 of text.

I am getting same “top-right” value but few of my E[i,j] values are different.

-Thanks

Esh

15 Mar 10 at 02:11

17. Also if someone could post the structures for Exrecise 3

Esh

15 Mar 10 at 03:01

18. Yes, I am having slight differences for the last “top-right” valuesin in prefering selection of Case4 Bifurcation. I stepped-through my answer, and it seems reasonable.

How’s everyone coming along on 3b?
Eddie, does Python have a better debugger?

Annie

15 Mar 10 at 10:34

19. That is odd, but your deltas for 1b…
Keep using i=87; j=92; r=61; s=66 as the indices. As Eddie showed up above, chimera is doing something weird in findResidue() for the second protein (the -1 offset will be necessary for 1MBN). Like Esh said, I can always go in there and edit these. Make a note in your comments where though.

Krzysztof

15 Mar 10 at 14:01

20. You know Annie, I really ought to know about debuggers… I’ll look into it and post if I find anything interesting.

I’m not quite done 3a yet

Eddie Ma

15 Mar 10 at 19:15

W=[[ 0. 0. 0. ..., 106.9 108. 108. ]
[ 0. 0. 0. ..., 106.7 108. 108. ]
[ 0. 0. 0. ..., 106.7 108. 108. ]
…,
[ 0. 0. 0. ..., 0. 0. 0. ]
[ 0. 0. 0. ..., 0. 0. 0. ]
[ 0. 0. 0. ..., 0. 0. 0. ]]
V= [[ 0. 0. 0. ..., 105.8 106.7 108. ]
[ 0. 0. 0. ..., 106. 107.1 108. ]
[ 0. 0. 0. ..., 105.8 106.7 108. ]
…,
[ 0. 0. 0. ..., 0. 0. 0. ]
[ 0. 0. 0. ..., 0. 0. 0. ]
[ 0. 0. 0. ..., 0. 0. 0. ]]

Annie

15 Mar 10 at 23:41

22. Does anyone feel like posting their matrices for 3b for the 17 nucleotide problem on the slides? I’m getting something, but I have no idea if it’s reasonable.

My first row is
[0, 0, 0, 0, 3.7999999999999998, 0, 0, 0, 0, 2.3999999999999999, 1.5, 2.1000000000000001, 4.5]
for V. Does that make any sense? Note: I am omitting the first four columns from the row, due to the whole biological constraints deal.

Kyle

16 Mar 10 at 12:33

23. @ Kyle – post above mine

[[ Inf Inf Inf Inf 5.7 5.6 5.6 3.6 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.1]
[ Inf Inf Inf Inf Inf 5.7 5.6 3.6 3.6 3.6 3.6 3.6 3.5 3.5 3.3 1.9 1.9]
[ Inf Inf Inf Inf Inf Inf 5.7 5.6 5.6 5.4 5.4 5.4 5.4 4.1
3.3 3.3 2.3]
[ Inf Inf Inf Inf Inf Inf Inf 5.7 5.6 5.6 5.4 5.4 5.4 5.4
3.3 3.3 2.3]
[ Inf Inf Inf Inf Inf Inf Inf Inf 5.7 5.6 5.6 5.4 5.4 5.4
3.3 3.3 2.3]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf 5.7 5.6 5.6 5.4 5.4
3.3 3.3 2.3]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf 5.7 5.6 5.6 5.4
3.3 3.3 2.3]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf 5.7 5.6 5.6
3.3 3.3 2.3]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf 5.7 5.6
3.3 3.3 2.3]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf 5.7
5.6 5.6 2.3]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
5.7 5.6 5.6]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf 5.7 5.6]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf 5.7]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf]]

[[ Inf Inf Inf Inf 5.7 5.6 5.6 5.4 1.1 5.6 6.4 6.5 6.6 6.7
6.8 5.5 5.3]
[ Inf Inf Inf Inf Inf 5.7 5.6 3.6 5.4 5.9 5.6 6.4 3.5 4.3
6.7 1.9 3. ]
[ Inf Inf Inf Inf Inf Inf 5.7 5.6 5.6 5.4 5.9 5.6 6.4 4.1 4.
5.1 3.5]
[ Inf Inf Inf Inf Inf Inf Inf 5.7 5.6 5.6 5.4 5.9 5.6 6.4
6.5 5. 6.7]
[ Inf Inf Inf Inf Inf Inf Inf Inf 5.7 5.6 5.6 5.4 5.9 5.6
6.4 6.5 6.6]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf 5.7 5.6 5.6 5.4 5.9
5.6 6.4 6.5]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf 5.7 5.6 5.6 5.4
5.9 5.6 6.4]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf 5.7 5.6 5.6
5.4 5.9 5.6]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf 5.7 5.6
3.3 5.4 4.1]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf 5.7
5.6 5.6 2.3]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
5.7 5.6 5.6]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf 5.7 5.6]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf 5.7]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf]
[ Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf]]

I could be wrong. Let me know.

Esh

17 Mar 10 at 21:23

24. EPILOGUE:

This assignment ended yesterday.

Eddie Ma

19 Mar 10 at 15:23