what i am trying to do is plot two rows out of a file looking like this:
number pair atom count shift error
1 ALA ALA CA 7624 1.35 0.13
1 ALA ALA HA 7494 19.67 11.44
38 ARG LYS CA 3395 35.32 9.52
38 ARG LYS HA 3217 1.19 0.38
38 ARG LYS CB 3061 0.54 1.47
39 ARG MET CA 1115 35.62 13.08
39 ARG MET HA 1018 1.93 0.20
39 ARG MET CB 976 1.80 0.34
What i want to do is to plot the rows that contain atom CA and CB using their atomvalues. so basically i want to do :
atomtypemask_ca = data['atom'] == 'CA'
xaxis = np.array(data['shift'][atomtypemask_ca])
aa, atom = data['aa'][atomtypemask_ca], data['atom'][atomtypemask_ca]
atomtypemask_cb = data['atom'] == 'CB'
yaxis = np.array(data['shift'][atomtypemask_cb])
plot (xaxis, yaxis)
what is kind of ruining my day is the reason that some values don't have a CB entry. How can i plot this kind of thing, ignoring entries that have only one of the two atomvalues set? I can of course program it, but i think this should be possible using masks, therefore producing cleaner code.