I have a very large dataset of sample measurements and I need to plot sample data but without the 'background' data, i.e. data that appears in the control samples. Here is an example of the data:
row a b c sample1 sample2 control1
1 5 2 1 236489 NaN 456932
2 8 3 0 NaN 278695 569202
3 12 8 2 NaN 332465 NaN
I have loaded the whole dataset as a tab delimited txt file and so each column of data is in a different vector. (NaN is where there was no value in the original tab file).
I need to plot a/b against c/b with the sample value on the z axis. I have managed to do this for all the values in the sample vector, but I need to remove all the sample values that have a value on the same row in the control sample. For example, if I want to plot the data for sample2 that does not occur in control1 I have this:
ab = a(:,1)./b(:,1);
cb = c(:,1)./b(:,1);
sample2_without_control1 = setdiff(sample2,control1)
What I would aim to plot is the a/b and c/b values but only from row 3 - as this is the only row in which there is data from sample2 but not control1. However setdiff doesn't work - I still need the value to be kept the same (i.e. as 332465) and not altered at all.
(I have thousands of rows of data like this, so I need a way to do this for entire vectors at once please!)
Thank you :)