-
Notifications
You must be signed in to change notification settings - Fork 4
Quality Control: Trouble shooting
All curves on all plates show parallell oddities (something happens more or less at the same time over all colonies on all plates)
Probably no acceptable grayscale was detected.
Verify this by checking the analysis.xml
or analysis_slimmed.xml
for the <OK>
tag.
Run grep -o -e"<ok>.</ok>" analysis.xml
If it shows zeros, then this is your problem.
- Recalibrate the fixture and rerun analysis
- Inspect image if there may be reasons why the grayscale wasn't correctly detected.
- Scratches etc -> Replace grayscale on fixture and rerun experiment
- Bent/Not straight -> Fix placement on fixture and rerun experiment.
There's data but it is very noisy / jumps up and down / looks like two parallell curves / nothing looks like curves.
Typically, this will be caused by the grayscale too.
In ipython:
import scanomatic.io.project_log as pl
from matplotlib import pyplot as plt
import numpy as np
D = [i['grayscale_values'] for i in pl.get_image_entries("/path/to/your.1_pass.analysis")]
plt.imshow(np.asarray(D).T)
plt.show()
The displaying image should be red at top and blue at bottom and homogenously so along the x-axis.
If the image looks nothing like it should:
- Verify that you are using the correct fixture / recalibrate the fixture -> rerun analysis.
- If that doesn't help, verity that there's nothing physically wrong with the grayscale. If there is, get a new gray scale or fix the problem and then rerun the experiment.
- Contact us with your issue.
If the are vertical bands in the image that look different than the majority, the grayscale detection was not entirely stable.
- Verify that your physical grayscale matches the setting in the fixture calibration
- Verify that the grayscale is not damaged.
- If there are only a few bad bands, these can be excluded from the analysis by deleting or renaming the image data for corresponding to that image. E.g. if there's a band at position 32 along the X axis, then remove or rename:
image_32_data.npy
If the data shows a few number of peaks that does not seem to be interfere with the extraction of phenotypes, you could remove the numpy objects with the image data that is causing the problem. Since the peaks usually reoccur in all curves, and typically has a very high value when due to problems with the grayscale, it easy to identify them and remove them.
To identify the numpy objects with high run the following code in the location of your numpy image files:
import numpy as np
import os
import glob
import numpy.ma as ma
NPS = glob.glob('image*.npy')
for n in NPS:
array = np.load(n)
array_masked = np.ma.masked_array(array, np.isnan(array))
mean = np.mean(array_masked)
print n, mean
Files containing the peaks typically stand out by a high mean. To remove rename them with a _BAD prefix, from the previous code, find a good cutoff value and run:
import numpy as np
import os
import glob
import numpy.ma as ma
NPS = glob.glob('image*.npy')
for n in NPS:
array = np.load(n)
array_masked = np.ma.masked_array(array, np.isnan(array))
mean = np.mean(array_masked)
if mean > 10000000: # Replace 10000000 with cutoff value
os.rename(n, ("_BAD" + n))
If there are too many peaks or that they interfere with the extraction of phenotypes, you could instead copy the grayscale from a picture that has a good grayscale. You should verify first that your grayscale is relatively stable. To copy the grayscale from one image to all of the other images, run this script.
Make sure that the grayscale is supplied like this: "'grayscale_values': [230.0, 206.0, 193.0, 177.0, 164.0, 151.0, 136.0, 126.0, 114.0, 103.0, 93.0, 83.0, 74.0, 65.0, 56.0, 49.0, 43.0, 35.0, 29.0, 25.0, 21.0, 19.0, 16.0]"
within quotes!
Input should be the first.pass analysis file, and with the new pass.analysis file you need to rerun the subsequent analysis steps ( run analysis -> convert -> extract features)