Merge branch 'master' of mus.cacr.caltech.edu:htsworkflow
authorDiane Trout <diane@caltech.edu>
Thu, 30 Jun 2011 22:48:57 +0000 (15:48 -0700)
committerDiane Trout <diane@caltech.edu>
Thu, 30 Jun 2011 22:48:57 +0000 (15:48 -0700)
extra/ucsc_encode_submission/ucsc_gather.py
htsworkflow/frontend/experiments/models.py
htsworkflow/frontend/templates/sample_header.html
htsworkflow/submission/daf.py

index d52b11bc122cf523a06253091e461848ce33a6de..37169c075d7c5dbdfefa908a86247917c92e0aae 100755 (executable)
@@ -210,15 +210,15 @@ def make_ddf(view_map, submissionNode, daf_name, make_condor=False, outdir=None)
 PREFIX submissionOntology: <http://jumpgate.caltech.edu/wiki/UcscSubmissionOntology#>
 PREFIX ucscDaf: <http://jumpgate.caltech.edu/wiki/UcscDaf#>
 
-select ?submitView  ?filename ?md5sum ?view ?cell ?antibody ?sex ?control ?controlId ?labExpId ?labVersion ?treatment ?protocol
+select ?submitView  ?files ?md5sum ?view ?cell ?antibody ?sex ?control ?controlId ?labExpId ?labVersion ?treatment ?protocol
 WHERE {
-  ?file ucscDaf:filename ?filename ;
+  ?file ucscDaf:filename ?files ;
         ucscDaf:md5sum ?md5sum .
   ?submitView ucscDaf:has_file ?file ;
               ucscDaf:view ?dafView ;
-              ucscDaf:submission %(submission)s .
+              ucscDaf:submission <%(submission)s> .
   ?dafView ucscDaf:name ?view .
-  %(submission)s submissionOntology:library ?library .
+  <%(submission)s> submissionOntology:library ?library .
 
   OPTIONAL { ?submitView ucscDaf:antibody ?antibody }
   OPTIONAL { ?submitView ucscDaf:cell ?cell }
@@ -245,12 +245,12 @@ ORDER BY  ?submitView"""
     else:
         output = sys.stdout
 
-    formatted_query = query_template % {'submission': str(submissionNode)}
+    formatted_query = query_template % {'submission': str(submissionNode.uri)}
 
     query = RDF.SPARQLQuery(formatted_query)
     results = query.execute(view_map.model)
 
-    variables = ['filename']
+    variables = ['files']
     # filename goes first
     variables.extend(view_map.get_daf_variables())
     variables += ['controlId', 'labExpId', 'md5sum']
@@ -264,7 +264,7 @@ ORDER BY  ?submitView"""
         current = all_views.setdefault(viewname, {})
         for variable_name in variables:
             value = str(fromTypedNode(row[variable_name]))
-            if variable_name in ('filename', 'md5sum'):
+            if variable_name in ('files', 'md5sum'):
                 current.setdefault(variable_name,[]).append(value)
             else:
                 current[variable_name] = value
@@ -272,13 +272,13 @@ ORDER BY  ?submitView"""
     for view in all_views.keys():
         line = []
         for variable_name in variables:
-            if variable_name in ('filename', 'md5sum'):
+            if variable_name in ('files', 'md5sum'):
                 line.append(','.join(all_views[view][variable_name]))
             else:
                 line.append(all_views[view][variable_name])
         output.write("\t".join(line))
         output.write(os.linesep)
-        all_files.extend(all_views[view]['filename'])
+        all_files.extend(all_views[view]['files'])
         
     logging.info(
         "Examined {0}, found files: {1}".format(
index 3e8cc867af70da49d3ba85d6b2431536563ebf31..36f6abdb2c9b3d299444941a645080dec182bbe5 100755 (executable)
@@ -180,7 +180,7 @@ def is_valid_lane(value):
 
 class Lane(models.Model):
   flowcell = models.ForeignKey(FlowCell)
-  lane_number = models.IntegerField(validators=[is_valid_lane])
+  lane_number = models.IntegerField(
   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)                                       
@@ -193,8 +193,8 @@ class Lane(models.Model):
                [str(self.id)])
 
   def __unicode__(self):
-    return self.flowcell.flowcell_id + ':' + unicode(self.lane_number)
-                        
+      return self.flowcell.flowcell_id + ':' + unicode(self.lane_number)
+
 ### -----------------------
 class DataRun(models.Model):
     flowcell = models.ForeignKey(FlowCell,verbose_name="Flowcell Id")
index 8ef06a84f8e919acdb466bb762008ee8d62c09c4..f51e64950b6e85ed9880959df6ae7c44bfd3727a 100644 (file)
@@ -25,7 +25,7 @@
     {% if lib.antibody %}
     <b>Antibody</b>:
        <span property="libns:antibody">{{ lib.antibody.antibodies }}</span>
-       {% if lib.antibody.antibodies.nuckname %}
+       {% if lib.antibody.antibodies.nickname %}
        (<span property="libns:antibody_term">{{ lib.antibody.nickname }}</span>)
        {% endif %}
     <br/>
index 28f75999ce80974198a8dad9858524c06b896d71..75c8868ea9f0716f0cfc775853d144cc556eac93 100644 (file)
@@ -260,7 +260,7 @@ class DAFMapper(object):
         submission_name = self.make_submission_name(submission_dir)
         submissionNode = self.get_submission_node(submission_dir)
         submission_uri = str(submissionNode.uri)
-        view_name = fromTypedNode(self.model.get_target(view, dafTermOntology['name']))
+        view_name = str(fromTypedNode(self.model.get_target(view, dafTermOntology['name'])))
         submissionView = RDF.Node(RDF.Uri(submission_uri + '/' + view_name))
 
         self.model.add_statement(
@@ -287,7 +287,7 @@ class DAFMapper(object):
 
         # Add everything I can find
         for term in terms:
-            value = self._get_library_attribute(libNode, term)
+            value = str(self._get_library_attribute(libNode, term))
             if value is not None:
                 self.model.add_statement(RDF.Statement(submissionView, term, value))