def main(args): log = setupLog(args) conf=get_conf(args.conf) couch = DB.setupServer(conf) db=couch['x_flowcells'] parser=cl.XTenParser(args.flowcell) DB.update_doc(db,parser.obj)
def main(args): log = setupLog(args) conf = get_conf(args.conf) couch = DB.setupServer(conf) db = couch['x_flowcells'] parser = cl.XTenParser(args.flowcell) DB.update_doc(db, parser.obj)
def upload_to_statusdb(run_dir): """ Triggers the upload to statusdb using the dependency flowcell_parser :param string run_dir: the run directory to upload """ couch = fcpdb.setupServer(CONFIG) db=couch[CONFIG['statusdb']['xten_db']] parser=XTenParser(run_dir) fcpdb.update_doc(db,parser.obj)
def _upload_to_statusdb(run): """ Triggers the upload to statusdb using the dependency flowcell_parser :param Run run: the object run """ couch = fcpdb.setupServer(CONFIG) db = couch[CONFIG['statusdb']['xten_db']] parser = run.runParserObj # Check if I have NoIndex lanes # This could be refactored and some checks for key exceptions should be added for element in parser.obj['samplesheet_csv']: if 'NoIndex' in element['index'] or not element[ 'index']: # NoIndex in the case of HiSeq, empty in the case of HiSeqX lane = element['Lane'] # this is a lane with NoIndex # in this case PF Cluster is the number of undetermined reads try: PFclusters = parser.obj['Undetermined'][lane]['unknown'] except KeyError: logger.error("While taking extra care of lane {} of NoIndex type " \ "I found out that not all values were available".format(lane)) continue # In Lanes_stats fix the lane yield parser.obj['illumina']['Demultiplex_Stats']['Lanes_stats'][ int(lane) - 1]['PF Clusters'] = str(PFclusters) # Now fix Barcode lane stats updated = 0 # Check that only one update is made for sample in parser.obj['illumina']['Demultiplex_Stats'][ 'Barcode_lane_statistics']: if lane in sample['Lane']: updated += 1 sample['PF Clusters'] = str(PFclusters) if updated != 1: logger.error( "While taking extra care of lane {} of NoIndex type " "I updated more than once the barcode_lane. " "This is too much to continue so I will fail.".format( lane)) os.sys.exit() # If I am here it means I changed the HTML representation to something # else to accomodate the wired things we do # someone told me that in such cases it is better to put a place holder for this parser.obj['illumina']['Demultiplex_Stats']['NotOriginal'] = "True" # Update info about bcl2fastq tool if not parser.obj.get('DemultiplexConfig'): parser.obj['DemultiplexConfig'] = { 'Setup': { 'Software': run.CONFIG.get('bcl2fastq', {}) } } fcpdb.update_doc(db, parser.obj, over_write_db_entry=True)
def _upload_to_statusdb(run): """ Triggers the upload to statusdb using the dependency flowcell_parser :param Run run: the object run """ couch = fcpdb.setupServer(CONFIG) db = couch[CONFIG['statusdb']['xten_db']] parser = run.runParserObj # Check if I have NoIndex lanes # This could be refactored and some checks for key exceptions should be added for element in parser.obj['samplesheet_csv']: if 'NoIndex' in element['index'] or not element['index']: # NoIndex in the case of HiSeq, empty in the case of HiSeqX lane = element['Lane'] # this is a lane with NoIndex # in this case PF Cluster is the number of undetermined reads try: PFclusters = parser.obj['Undetermined'][lane]['unknown'] except KeyError: logger.error("While taking extra care of lane {} of NoIndex type " \ "I found out that not all values were available".format(lane)) continue # In Lanes_stats fix the lane yield parser.obj['illumina']['Demultiplex_Stats']['Lanes_stats'][int(lane) - 1]['PF Clusters'] = str(PFclusters) # Now fix Barcode lane stats updated = 0 # Check that only one update is made for sample in parser.obj['illumina']['Demultiplex_Stats']['Barcode_lane_statistics']: if lane in sample['Lane']: updated +=1 sample['PF Clusters'] = str(PFclusters) if updated != 1: logger.error("While taking extra care of lane {} of NoIndex type " "I updated more than once the barcode_lane. " "This is too much to continue so I will fail.".format(lane)) os.sys.exit() # If I am here it means I changed the HTML representation to something # else to accomodate the wired things we do # someone told me that in such cases it is better to put a place holder for this parser.obj['illumina']['Demultiplex_Stats']['NotOriginal'] = "True" # Update info about bcl2fastq tool if not parser.obj.get('DemultiplexConfig'): parser.obj['DemultiplexConfig'] = {'Setup': {'Software': run.CONFIG.get('bcl2fastq',{})}} fcpdb.update_doc( db , parser.obj, over_write_db_entry=True)