From: Diane Trout Date: Fri, 27 Mar 2015 18:07:06 +0000 (-0700) Subject: Import flowcell details into the triple store from a lane X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=575108fde7574000d8ccb7164703902726e8b0f1 Import flowcell details into the triple store from a lane --- diff --git a/htsworkflow/submission/submission.py b/htsworkflow/submission/submission.py index 9cd9dc8..ee28e91 100644 --- a/htsworkflow/submission/submission.py +++ b/htsworkflow/submission/submission.py @@ -245,6 +245,7 @@ class Submission(object): self.model.append(s) self._add_lane_details(libNode) + self._add_flowcell_details() def _add_lane_details(self, libNode): """Import lane details @@ -264,6 +265,20 @@ class Submission(object): raise e + def _add_flowcell_details(self): + template = loader.get_template('aws_flowcell.sparql') + results = self.execute_query(template, Context()) + + parser = RDF.Parser(name='rdfa') + for r in self.execute_query(template, Context()): + flowcell = r['flowcell'] + try: + parser.parse_into_model(self.model, flowcell.uri) + except RDF.RedlandError as e: + LOGGER.error("Error accessing %s" % (str(flowcell))) + raise e + + def find_best_match(self, filename): """Search through potential filename matching patterns """ diff --git a/htsworkflow/templates/aws_flowcell.sparql b/htsworkflow/templates/aws_flowcell.sparql new file mode 100644 index 0000000..afbfea0 --- /dev/null +++ b/htsworkflow/templates/aws_flowcell.sparql @@ -0,0 +1,7 @@ +PREFIX htswlib: + +select distinct ?flowcell +WHERE { + ?lane htswlib:flowcell ?flowcell ; + a htswlib:IlluminaLane . +}