5 from htsworkflow.submission.submission import Submission
7 from htsworkflow.util.rdfhelp import \
11 from django.conf import settings
12 from django.template import Context, loader
14 LOGGER = logging.getLogger(__name__)
16 class GEOSubmission(Submission):
17 def __init__(self, name, model):
18 super(GEOSubmission, self).__init__(name, model)
20 def make_soft(self, result_map):
22 for lib_id, result_dir in result_map.items():
23 an_analysis = self.get_submission_node(result_dir)
24 samples.append(self.get_sample_metadata(an_analysis))
26 soft_template = loader.get_template('geo_submission.soft')
30 print str(soft_template.render(context))
32 def check_for_name(self, analysis_node):
34 self.model.get_target(analysis_node,
35 submissionOntology['name']))
37 logger.error("Need name for %s" % (str(analysis_node)))
42 def get_sample_metadata(self, analysis_node):
43 """Gather information for filling out sample section of a SOFT file
45 query_template = loader.get_template('geo_submission.sparql')
48 'submission': str(analysis_node.uri),
51 formatted_query = query_template.render(context)
52 query = RDF.SPARQLQuery(str(formatted_query))
53 rdfstream = query.execute(self.model)