From d9697c7e4a93736e5bb17bcc771c86ce377713c1 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Mon, 1 Jul 2013 15:57:12 -0700 Subject: [PATCH] Initial attempt to start generating trackHubs and manifest files. --- encode_submission/trackhub.py | 14 +++++++++++++- htsworkflow/submission/trackhub.py | 7 +++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/encode_submission/trackhub.py b/encode_submission/trackhub.py index 41f76d1..c5c2543 100644 --- a/encode_submission/trackhub.py +++ b/encode_submission/trackhub.py @@ -97,7 +97,7 @@ def main(cmdline=None): mapper.scan_submission_dirs(results) if opts.make_hub: - mapper.make_hub(results) + make_hub(results) if opts.sparql: sparql_query(model, opts.sparql) @@ -107,6 +107,18 @@ def main(cmdline=None): print writer.serialize_model_to_string(model) +def make_hub(results): + trackdb = mapper.make_hub(results) + manifest = mapper.make_manifest(results) + + trackstream = sys.stdout + #with open('trackDb.txt', 'w') as trackstream: + trackstream.write(trackdb) + + #with open('manifest.txt', 'w') as mainifeststream: + manifeststream = sys.stdout + mainifeststream.write(mainifest) + def make_parser(): parser = OptionParser() diff --git a/htsworkflow/submission/trackhub.py b/htsworkflow/submission/trackhub.py index e3087fe..87a5258 100644 --- a/htsworkflow/submission/trackhub.py +++ b/htsworkflow/submission/trackhub.py @@ -39,7 +39,10 @@ class TrackHubSubmission(Submission): context = Context({ 'samples': samples, }) - print str(soft_template.render(context)) + return str(soft_template.render(context)) + + def make_mainifest(self, result_map): + pass def get_sample_metadata(self, analysis_node): """Gather information for filling out sample section of a SOFT file @@ -52,4 +55,4 @@ class TrackHubSubmission(Submission): }) results = self.execute_query(query_template, context) - return results \ No newline at end of file + return results -- 2.30.2