--- /dev/null
+"""
+This renames avg_lib_size to gel_cut_size and adds an insert length field
+to samples_library.
+"""
+
+import shutil
+import sqlite3
+import sys
+
+def main(cmdline=None):
+ if len(cmdline) == 1:
+ dest='/tmp/fctracker.db'
+ else:
+ dest = cmdline[1]
+ shutil.copy(cmdline[0], dest)
+ conn = sqlite3.connect(dest)
+ c = conn.cursor()
+
+
+ c.execute("""alter table samples_library rename to samples_library_temp;""")
+ c.execute("""CREATE TABLE "samples_library" (
+ "id" varchar(10) NOT NULL PRIMARY KEY,
+ "library_name" varchar(100) NOT NULL UNIQUE,
+ "library_species_id" integer NOT NULL REFERENCES "samples_species" ("id"),
+ "hidden" bool NOT NULL,
+ "account_number" varchar(100) NULL,
+ "cell_line_id" integer NULL REFERENCES "samples_cellline" ("id"),
+ "condition_id" integer NULL REFERENCES "samples_condition" ("id"),
+ "antibody_id" integer NULL REFERENCES "samples_antibody" ("id"),
+ "replicate" smallint unsigned NOT NULL,
+ "experiment_type_id" integer NOT NULL REFERENCES "samples_experimenttype" ("id"),
+ "library_type_id" integer NULL REFERENCES "samples_librarytype" ("id"),
+ "creation_date" date NULL,
+ "made_for" varchar(50) NOT NULL,
+ "made_by" varchar(50) NOT NULL,
+ "stopping_point" varchar(25) NOT NULL,
+ "amplified_from_sample_id" varchar(10) NULL,
+ "undiluted_concentration" decimal NULL,
+ "successful_pM" decimal NULL,
+ "ten_nM_dilution" bool NOT NULL,
+ "gel_cut_size" integer NULL,
+ "insert_size" integer NULL,
+ "notes" text NOT NULL
+);""")
+ c.execute("""INSERT INTO samples_library
+( id, library_name, library_species_id, hidden, account_number,
+ cell_line_id, condition_id, antibody_id, replicate,
+ experiment_type_id, library_type_id, creation_date, made_for,
+ made_by, stopping_point, amplified_from_sample_id,
+ undiluted_concentration, successful_pM, ten_nM_dilution,
+ gel_cut_size, notes )
+SELECT
+ id, library_name, library_species_id, hidden, account_number,
+ cell_line_id, condition_id, antibody_id, replicate,
+ experiment_type_id, library_type_id, creation_date, made_for,
+ made_by, stopping_point, amplified_from_sample_id,
+ undiluted_concentration, successful_pM, ten_nM_dilution,
+ avg_lib_size, notes
+FROM samples_library_temp;
+""")
+ c.execute('DROP TABLE samples_library_temp;')
+
+
+ # modify experiments_lane
+ c.execute("""alter table experiments_lane rename to experiments_lane_temp;""")
+ c.execute('''
+CREATE TABLE "experiments_lane" (
+ "id" integer NOT NULL PRIMARY KEY,
+ "flowcell_id" integer NOT NULL REFERENCES "experiments_flowcell" ("id"),
+ "lane_number" integer NOT NULL,
+ "library_id" varchar(10) NOT NULL REFERENCES "samples_library" ("id"),
+ "pM" decimal NOT NULL,
+ "cluster_estimate" integer,
+ "status" integer,
+ "comment" text
+);''')
+
+ c.execute('''
+INSERT INTO experiments_lane
+( id, flowcell_id, lane_number, library_id, pM, cluster_estimate, comment)
+SELECT
+id, flowcell_id, lane_number, library_id, pM, cluster_estimate, comment
+FROM experiments_lane_temp;
+''')
+ c.execute('DROP TABLE experiments_lane_temp;')
+ conn.commit()
+
+if __name__ == "__main__":
+ main(sys.argv[1:])
(None, {
'fields': ('lane_number', 'flowcell',
('library',),
- ('pM', 'cluster_estimate'),
+ ('pM', 'cluster_estimate', 'status'),
'comment',)
}),
)
from htsworkflow.frontend.auth import require_api_key
from htsworkflow.frontend import settings
-from htsworkflow.frontend.experiments.models import FlowCell, DataRun, Lane
+from htsworkflow.frontend.experiments.models import \
+ FlowCell, \
+ DataRun, \
+ Lane, \
+ LANE_STATUS_MAP
from htsworkflow.frontend.samples.models import Library, HTSUser
def flowcell_information(flowcell_id):
'library_id': lane.library.id,
'library_species': lane.library.library_species.scientific_name,
'pM': unicode(lane.pM),
- 'read_length': lane.flowcell.read_length
+ 'read_length': lane.flowcell.read_length,
+ 'status_code': lane.status,
+ 'status': LANE_STATUS_MAP[lane.status]
}
if fc.control_lane is None:
{"pk": "10981", "model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 400,
+ "gel_cut_size": 400,
"library_name": "Paired End Multiplexed Sp-BAC",
"creation_date": "2009-07-21",
"cell_line": 1,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 325,
+ "gel_cut_size": 325,
"library_name": "Paired End Pfl #3 MP 7/24/9 a",
"creation_date": "2009-08-06",
"cell_line": 1,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 300,
+ "gel_cut_size": 300,
"library_name": "Paired ends 99 GM12892",
"creation_date": "2009-08-25",
"cell_line": 1,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 300,
+ "gel_cut_size": 300,
"library_name": "Paired ends 100 VC_CN_4_M_MBB1185_s1",
"creation_date": "2009-09-01",
"cell_line": 1,
},
{"pk": 1197, "model": "experiments.lane",
"fields": {
- "comment": "",
+ "comment": "stuff",
"library": "11061",
"cluster_estimate": 140000,
"flowcell": 153,
"lane_number": 5,
- "pM": "7"
+ "pM": "7",
+ "status": 2
}
},
{
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 300,
+ "gel_cut_size": 300,
"library_name": "Paired ends 101 VC_CN_4_M_MBB1185_s2",
"creation_date": "2009-09-01",
"cell_line": 1,
"cluster_estimate": 2000,
"flowcell": 153,
"lane_number": 6,
- "pM": "7"
+ "pM": "7",
+ "status": 0
}
},
{
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 300,
+ "gel_cut_size": 300,
"library_name": "Paired ends 102 VC_AU_8_M_MBB4721_s1",
"creation_date": "2009-09-01",
"cell_line": 1,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 300,
+ "gel_cut_size": 300,
"library_name": "Paired ends 103 VC_AU_8_M_MBB4721_s2",
"creation_date": "2009-09-01",
"cell_line": 1,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 300,
+ "gel_cut_size": 300,
"library_name": "Paired ends 104 VC_CN_7_M_MBB4898_s1",
"creation_date": "2009-09-01",
"cell_line": 1,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 300,
+ "gel_cut_size": 300,
"library_name": "Paired ends 95 Gilberto_d3_control_LTA",
"creation_date": "2009-08-25",
"cell_line": 1,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 300,
+ "gel_cut_size": 300,
"library_name": "Paired ends 97 Kuntz_PDHT",
"creation_date": "2009-08-25",
"cell_line": 1,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 250,
+ "gel_cut_size": 250,
"library_name": "FLDN1 8/3/9 anti-AcH3 chip B6 a",
"creation_date": "2009-08-26",
"cell_line": null,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 250,
+ "gel_cut_size": 250,
"library_name": "FLDN1 7/8/9 anti-DiMeH3K4 chip B6 a",
"creation_date": "2009-08-26",
"cell_line": null,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 225,
+ "gel_cut_size": 225,
"library_name": "HNDHT HLH hnd-1 strain HT115 fed anti-hlh-1 2% fix plate a",
"creation_date": "2009-08-31",
"cell_line": null,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 225,
+ "gel_cut_size": 225,
"library_name": "HNDM3 HLH hnd-1 strain mex-3 fed anti-hlh-1 2% fix plate a",
"creation_date": "2009-08-31",
"cell_line": null,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 225,
+ "gel_cut_size": 225,
"library_name": "HNDM3 4H8 hnd-1 strain mex-3 fed 4H8 2% fix plate a",
"creation_date": "2009-08-31",
"cell_line": null,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 300,
+ "gel_cut_size": 300,
"library_name": "Paired ends 105 Kuntz PDM3",
"creation_date": "2009-09-01",
"cell_line": 1,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 300,
+ "gel_cut_size": 300,
"library_name": "Paired ends 96 Kuntz_PDE1",
"creation_date": "2009-08-25",
"cell_line": 1,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 300,
+ "gel_cut_size": 300,
"library_name": "Paired ends 94 Gilberto_d3_denerv_LTA",
"creation_date": "2009-08-25",
"cell_line": 1,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 225,
+ "gel_cut_size": 225,
"library_name": "p300 60h C2 FA KF 12/22/8 a",
"creation_date": "2009-08-26",
"cell_line": null,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 225,
+ "gel_cut_size": 225,
"library_name": "p300 60h C2 FA KF 12/22/8 a",
"creation_date": "2009-08-26",
"cell_line": null,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 250,
+ "gel_cut_size": 250,
"library_name": "FLDN1 7/8/9 anti-TriMeH3K27 chip B6 a",
"creation_date": "2009-08-26",
"cell_line": null,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 225,
+ "gel_cut_size": 225,
"library_name": "HNDHT 4H8 hnd-1 strain HT115 fed 4H8 2% fix plate a",
"creation_date": "2009-08-31",
"cell_line": null,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 325,
+ "gel_cut_size": 325,
"library_name": "Paired End SP-BAC Barcoding test 250-300 bp",
"creation_date": "2009-09-03",
"cell_line": 1,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 300,
+ "gel_cut_size": 300,
"library_name": "Paired End AG-3d-1 AG domain of floral meristem day 3, rep 1",
"creation_date": "2009-09-02",
"cell_line": null,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 300,
+ "gel_cut_size": 300,
"library_name": "Paired End AG-5d-1 AG domain of floral meristem day 5, rep 1",
"creation_date": "2009-09-02",
"cell_line": null,
return str
Flowcell_Info.allow_tags = True
+LANE_STATUS_CODES = [(0, 'Failed'),
+ (1, 'Marginal'),
+ (2, 'Good'),]
+LANE_STATUS_MAP = dict((int(k),v) for k,v in LANE_STATUS_CODES )
+LANE_STATUS_MAP[None] = "Unknown"
class Lane(models.Model):
flowcell = models.ForeignKey(FlowCell)
lane_number = models.IntegerField(choices=[(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8)])
library = models.ForeignKey(Library)
pM = models.DecimalField(max_digits=5, decimal_places=2,blank=False, null=False,default=default_pM)
- cluster_estimate = models.IntegerField(blank=True, null=True)
+ cluster_estimate = models.IntegerField(blank=True, null=True)
+ status = models.IntegerField(choices=LANE_STATUS_CODES, null=True, blank=True)
comment = models.TextField(null=True, blank=True)
('cell_line','condition','antibody'),)
}),
('Creation Information:', {
- 'fields' : (('made_for', 'made_by', 'creation_date'), ('stopping_point', 'amplified_from_sample'), ('avg_lib_size','undiluted_concentration', 'ten_nM_dilution', 'successful_pM'), 'account_number', 'notes',)
+ 'fields' : (('made_for', 'made_by', 'creation_date'), ('stopping_point', 'amplified_from_sample'), ('gel_cut_size', 'insert_size', 'undiluted_concentration', 'ten_nM_dilution', 'successful_pM'), 'account_number', 'notes',)
}),
('Library/Project Affiliation:', {
'fields' : (('affiliations'), ('tags'),)
"date_joined": "2009-01-01 00:01:01"
}
},
+ {"pk": 153, "model": "experiments.flowcell",
+ "fields": {
+ "paired_end": true,
+ "run_date": "2009-09-11 22:12:13",
+ "read_length": 75,
+ "notes": "",
+ "advanced_run": false,
+ "control_lane": 2,
+ "cluster_station": 3,
+ "sequencer": 2,
+ "flowcell_id": "303TUAAXX"
+ }
+ },
+ {"pk": 1193, "model": "experiments.lane",
+ "fields": {
+ "comment": "No change in cluster numbers, despite slight increase in pM",
+ "library": "10981",
+ "cluster_estimate": 129000,
+ "flowcell": 153,
+ "lane_number": 1,
+ "pM": "8"
+ }
+ },
+ {"pk": 1197, "model": "experiments.lane",
+ "fields": {
+ "comment": "stuff",
+ "library": "11016",
+ "cluster_estimate": 140000,
+ "flowcell": 153,
+ "lane_number": 5,
+ "pM": "7",
+ "status": 2
+ }
+ },
{"pk": "10981", "model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 400,
+ "gel_cut_size": 400,
"library_name": "Paired End Multiplexed Sp-BAC",
"creation_date": "2009-07-21",
"cell_line": 1,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 325,
+ "gel_cut_size": 325,
"library_name": "Paired End Pfl #3 MP 7/24/9 a",
"creation_date": "2009-08-06",
"cell_line": 1,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 300,
+ "gel_cut_size": 300,
"library_name": "Paired ends 99 GM12892",
"creation_date": "2009-08-25",
"cell_line": 1,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 325,
+ "gel_cut_size": 325,
"library_name": "Paired End Pfl #3 MP 7/24/9",
"creation_date": "2009-08-05",
"cell_line": 1,
"model": "samples.library",
"fields": {
"ten_nM_dilution": false,
- "avg_lib_size": 325,
+ "gel_cut_size": 325,
"library_name": "null cell line",
"creation_date": "2009-08-05",
"cell_line": null,
# note \u00b5 is the micro symbol in unicode
successful_pM = models.DecimalField(max_digits=9, decimal_places=1, blank=True, null=True)
ten_nM_dilution = models.BooleanField()
- avg_lib_size = models.IntegerField(default=225, blank=True, null=True)
+ gel_cut_size = models.IntegerField(default=225, blank=True, null=True)
+ insert_size = models.IntegerField(blank=True, null=True)
notes = models.TextField(blank=True)
def __unicode__(self):
from htsworkflow.frontend.auth import apidata
from htsworkflow.util.conversion import unicode_or_none
-# The django test runner flushes the database between test suites not cases,
-# so to be more compatible with running via nose we flush the database tables
-# of interest before creating our sample data.
-def create_db(obj):
- Species.objects.all().delete()
- obj.species_human = Species(
- scientific_name = 'Homo Sapeins',
- common_name = 'human',
- )
- obj.species_human.save()
- obj.species_worm = Species(
- scientific_name = 'C. Elegans',
- common_name = 'worm',
- )
- obj.species_worm.save()
- obj.species_phix = Species(
- scientific_name = 'PhiX',
- common_name = 'PhiX'
- )
- obj.species_phix.save()
-
- ExperimentType.objects.all().delete()
- obj.experiment_de_novo = ExperimentType(
- name = 'De Novo',
- )
- obj.experiment_de_novo.save()
- obj.experiment_chip_seq = ExperimentType(
- name = 'ChIP-Seq'
- )
- obj.experiment_chip_seq.save()
- obj.experiment_rna_seq = ExperimentType(
- name = 'RNA-Seq'
- )
- obj.experiment_rna_seq.save()
-
- Affiliation.objects.all().delete()
- obj.affiliation_alice = Affiliation(
- name = 'Alice',
- contact = 'Lab Boss',
- email = 'alice@some.where.else.'
- )
- obj.affiliation_alice.save()
- obj.affiliation_bob = Affiliation(
- name = 'Bob',
- contact = 'Other Lab Boss',
- email = 'bob@some.where.else',
- )
- obj.affiliation_bob.save()
- Library.objects.all().delete()
- obj.library_10001 = Library(
- id = "10001",
- library_name = 'C2C12 named poorly',
- library_species = obj.species_human,
- experiment_type = obj.experiment_rna_seq,
- creation_date = datetime.datetime.now(),
- made_for = 'scientist unit 2007',
- made_by = 'microfludics system 7321',
- stopping_point = '2A',
- undiluted_concentration = '5.01',
- hidden = False,
- )
- obj.library_10001.save()
- obj.library_10002 = Library(
- id = "10002",
- library_name = 'Worm named poorly',
- library_species = obj.species_human,
- experiment_type = obj.experiment_rna_seq,
- creation_date = datetime.datetime.now(),
- made_for = 'scientist unit 2007',
- made_by = 'microfludics system 7321',
- stopping_point = '2A',
- undiluted_concentration = '5.01',
- hidden = False,
- )
- obj.library_10002.save()
-
class LibraryTestCase(TestCase):
def setUp(self):
create_db(self)
self.failUnless(len(self.library_10002.affiliations.all()), 2)
self.failUnless(self.library_10001.affiliation(), 'Alice, Bob')
+
class SampleWebTestCase(TestCase):
"""
Test returning data from our database in rest like ways.
lib_response = self.client.get(url, apidata)
self.failUnlessEqual(lib_response.status_code, 200)
lib_json = json.loads(lib_response.content)
+ print lib_json
for d in [lib_dict, lib_json]:
# amplified_from_sample is a link to the library table,
# since amplified_from_sample can be null
#self.failUnlessEqual(d['amplified_from_sample'], lib.amplified_from_sample)
self.failUnlessEqual(d['antibody_id'], lib.antibody_id)
- self.failUnlessEqual(d['avg_lib_size'], lib.avg_lib_size)
self.failUnlessEqual(d['cell_line_id'], lib.cell_line_id)
self.failUnlessEqual(d['cell_line'], unicode_or_none(lib.cell_line))
self.failUnlessEqual(d['experiment_type'], lib.experiment_type.name)
self.failUnlessEqual(d['experiment_type_id'], lib.experiment_type_id)
+ self.failUnlessEqual(d['gel_cut_size'], lib.gel_cut_size)
self.failUnlessEqual(d['hidden'], lib.hidden)
self.failUnlessEqual(d['id'], lib.id)
+ self.failUnlessEqual(d['insert_size'], lib.insert_size)
self.failUnlessEqual(d['library_name'], lib.library_name)
self.failUnlessEqual(d['library_species'], lib.library_species.scientific_name)
self.failUnlessEqual(d['library_species_id'], lib.library_species_id)
self.failUnlessEqual(d['successful_pM'], lib.successful_pM)
self.failUnlessEqual(d['undiluted_concentration'],
unicode(lib.undiluted_concentration))
+ # some specific tests
+ if lib.id == '10981':
+ # test a case where there is no known status
+ lane_set = {u'status': u'Unknown', u'lane_number': 1, u'flowcell': u'303TUAAXX', u'status_code': None}
+ self.failUnlessEqual(len(d['lane_set']), 1)
+ self.failUnlessEqual(d['lane_set'][0], lane_set)
+ elif lib.id == '11016':
+ # test a case where there is a status
+ lane_set = {'status': 'Good', 'lane_number': 5, 'flowcell': u'303TUAAXX', 'status_code': 2}
+ self.failUnlessEqual(len(d['lane_set']), 1)
+ self.failUnlessEqual(d['lane_set'][0], lane_set)
def test_invalid_library(self):
"""
self.failUnlessEqual(response.status_code, 403)
response = self.client.get('/samples/library/10981/json', apidata)
self.failUnlessEqual(response.status_code, 200)
+
+# The django test runner flushes the database between test suites not cases,
+# so to be more compatible with running via nose we flush the database tables
+# of interest before creating our sample data.
+def create_db(obj):
+ Species.objects.all().delete()
+ obj.species_human = Species(
+ scientific_name = 'Homo Sapeins',
+ common_name = 'human',
+ )
+ obj.species_human.save()
+ obj.species_worm = Species(
+ scientific_name = 'C. Elegans',
+ common_name = 'worm',
+ )
+ obj.species_worm.save()
+ obj.species_phix = Species(
+ scientific_name = 'PhiX',
+ common_name = 'PhiX'
+ )
+ obj.species_phix.save()
+
+ ExperimentType.objects.all().delete()
+ obj.experiment_de_novo = ExperimentType(
+ name = 'De Novo',
+ )
+ obj.experiment_de_novo.save()
+ obj.experiment_chip_seq = ExperimentType(
+ name = 'ChIP-Seq'
+ )
+ obj.experiment_chip_seq.save()
+ obj.experiment_rna_seq = ExperimentType(
+ name = 'RNA-Seq'
+ )
+ obj.experiment_rna_seq.save()
+
+ Affiliation.objects.all().delete()
+ obj.affiliation_alice = Affiliation(
+ name = 'Alice',
+ contact = 'Lab Boss',
+ email = 'alice@some.where.else.'
+ )
+ obj.affiliation_alice.save()
+ obj.affiliation_bob = Affiliation(
+ name = 'Bob',
+ contact = 'Other Lab Boss',
+ email = 'bob@some.where.else',
+ )
+ obj.affiliation_bob.save()
+
+ Library.objects.all().delete()
+ obj.library_10001 = Library(
+ id = "10001",
+ library_name = 'C2C12 named poorly',
+ library_species = obj.species_human,
+ experiment_type = obj.experiment_rna_seq,
+ creation_date = datetime.datetime.now(),
+ made_for = 'scientist unit 2007',
+ made_by = 'microfludics system 7321',
+ stopping_point = '2A',
+ undiluted_concentration = '5.01',
+ hidden = False,
+ )
+ obj.library_10001.save()
+ obj.library_10002 = Library(
+ id = "10002",
+ library_name = 'Worm named poorly',
+ library_species = obj.species_human,
+ experiment_type = obj.experiment_rna_seq,
+ creation_date = datetime.datetime.now(),
+ made_for = 'scientist unit 2007',
+ made_by = 'microfludics system 7321',
+ stopping_point = '2A',
+ undiluted_concentration = '5.01',
+ hidden = False,
+ )
+ obj.library_10002.save()
+
import simplejson as json
from htsworkflow.frontend.auth import require_api_key
-from htsworkflow.frontend.experiments.models import FlowCell, Lane
+from htsworkflow.frontend.experiments.models import FlowCell, Lane, LANE_STATUS_MAP
from htsworkflow.frontend.samples.changelist import ChangeList
from htsworkflow.frontend.samples.models import Library, HTSUser
from htsworkflow.frontend.samples.results import get_flowcell_result_dict, parse_flowcell_id
lane_info = []
for lane in lib.lane_set.all():
lane_info.append( {'flowcell':lane.flowcell.flowcell_id,
- 'lane_number': lane.lane_number} )
+ 'lane_number': lane.lane_number,
+ 'status_code': lane.status,
+ 'status': LANE_STATUS_MAP[lane.status]} )
info = {
# 'affiliations'?
#'amplified_from_sample_id': lib.amplified_from_sample,
#'antibody_name': lib.antibody_name(), # we have no antibodies.
'antibody_id': lib.antibody_id,
- 'avg_lib_size': lib.avg_lib_size,
'cell_line_id': lib.cell_line_id,
'cell_line': unicode_or_none(lib.cell_line),
'experiment_type': lib.experiment_type.name,
'experiment_type_id': lib.experiment_type_id,
+ 'gel_cut_size': lib.gel_cut_size,
'hidden': lib.hidden,
'id': lib.id,
+ 'insert_size': lib.insert_size,
'lane_set': lane_info,
'library_id': lib.id,
'library_name': lib.library_name,
<tr><td valign=middle nowrap>First time run?</td><td bgcolor=#CCFFCC></td><td bgcolor=#CCFFCC></td><td bgcolor=#CCFFCC></td><td bgcolor=#CCFFCC></td><td bgcolor=#CCFFCC></td><td bgcolor=#CCFFCC></td><td bgcolor=#CCFFCC></td><td bgcolor=#CCFFCC></td></tr>
-<tr><td valign=middle nowrap>Average Library Size (bp)</td>
+<tr><td valign=middle nowrap>Gel Cut Size (bp)</td>
{% for lane in fc.lane_set.all %}
-<td bgcolor=#CCFFCC>{{ lane.library.avg_lib_size }}</td>
+<td bgcolor=#CCFFCC>{{ lane.library.gel_cut_size }}</td>
{% endfor %}
</tr>
<b>Name</b>: {{ lib.library_name }}<br/>
<b>Species</b>: {{ lib.library_species.scientific_name }}<br/>
<b>Concentration</b>: {{ lib.undiluted_concentration }} ng/µl<br/>
- <b>Gel Cut Size</b>: {{ lib.avg_lib_size }}<br/>
+ <b>Gel Cut Size</b>: {{ lib.gel_cut_size }}<br/>
+ <b>Insert Size</b>: {{ lib.insert_size }}<br/>
<b>Made By</b>: {{ lib.made_by }} <br/>
<b>Affiliations</b>:
<ul>