#!/usr/bin/env python
# coding: utf-8
# # idr0001: Sysgro
#
#
#
# A quick look at one of the studies in the IDR, Sysgro. |
#  |
#  |
#  |
#
# ### Dependencies
#
# * [Matplotlib](http://matplotlib.org/)
# * [NumPy](http://www.numpy.org/)
# In[1]:
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.patches as mpatches
matplotlib.rcParams['figure.figsize'] = (12.0, 8.0)
from idr import connection
# In[2]:
screen = "idr0001-graml-sysgro/screenA"
# ### Connect to the IDR server
# In[12]:
conn = connection()
# ### Load information about Sysgro
# In[3]:
idr0001 = [x for x in conn.listScreens(2) if x.name == screen][0]
# In[4]:
idr0001.name
# In[5]:
print idr0001.description
# In[11]:
annotations = idr0001.getAnnotation().getMapValueAsMap()
print """
PubMed ID: %(PubMed ID)s
Authors: %(Publication Authors)s
Imaging Method: %(Imaging Method)s
""" % annotations
# In[7]:
plates = 0
images = 0
for plate in idr0001.listChildren():
plates += 1
for well in plate.listChildren():
images += len(list(well.listChildren()))
print "Plates:", plates
print "Images:", images
# In[8]:
total = None
for plate in idr0001.listChildren():
grid = plate.getWellGrid()
single = np.zeros((len(grid), len(grid[0])))
if total is None:
total = np.zeros((len(grid), len(grid[0])))
for x, row in enumerate(grid):
for y, col in enumerate(row):
single[x][y] = grid[x][y].getImage().getROICount()
total += single
break # Continue to tally all ROIs
# ### Disconnect when done loading data
# In[13]:
conn.close()
# ### Display results
# In[14]:
plt.title('ROIs per well of %s' % plate.id)
plt.pcolor(total)
plt.colorbar()
plt.show()
# ### License
#
# Copyright (C) 2017 University of Dundee. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.