mark the example submission rule files as being raw, so the escapes dont get confused
[htsworkflow.git] / encode_submission / geo_gather.py
index 5d6bf1142f193c3c88a566270ed6579b4f58273c..751264cc4276a658491c387852a180fff94929a0 100644 (file)
@@ -58,9 +58,7 @@ def main(cmdline=None):
     model = get_model(opts.model, opts.db_path)
     mapper = None
     if opts.name:
-        mapper = GEOSubmission(opts.name,  model)
-        if opts.library_url is not None:
-            mapper.library_url = opts.library_url
+        mapper = GEOSubmission(opts.name,  model, host=opts.host)
         submission_uri = get_submission_uri(opts.name)
 
 
@@ -71,12 +69,16 @@ def main(cmdline=None):
 
     results = ResultMap()
     for a in args:
-        results.add_results_from_file(a)
+        if os.path.exists(a):
+            results.add_results_from_file(a)
+        else:
+            logger.warn("File %s doesn't exist.", a)
 
     if opts.make_tree_from is not None:
         results.make_tree_from(opts.make_tree_from)
 
     if opts.fastq:
+        logger.info("Building fastq extraction scripts")
         flowcells = os.path.join(opts.sequence, 'flowcells')
         extractor = CondorFastqExtract(opts.host, flowcells,
                                        model=opts.model,
@@ -84,6 +86,8 @@ def main(cmdline=None):
         extractor.create_scripts(results)
 
     if opts.scan_submission:
+        if opts.name is None:
+            parser.error("Please define a submission name")
         mapper.scan_submission_dirs(results)
 
     if opts.make_soft: