Skip to content

Commit

Permalink
Merge pull request #30 from CompEpigen/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
KerstenBreuer authored Nov 26, 2019
2 parents 6721477 + 3f8bb07 commit 17be699
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cwlab/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

from __future__ import absolute_import

__version__ = "0.3.0"
__version__ = "0.3.1"

import os
from flask import Flask
Expand Down
2 changes: 1 addition & 1 deletion cwlab/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def import_wf(
wf_type = get_workflow_type_from_file_ext(wf_path)
else:
assert wf_type in supported_workflow_types, "Provided workflow type \"{wf_type}\" is not supported."
if name is None:
if name is None or name == "":
name = os.path.splitext(os.path.basename(wf_path))[0]
if os.path.splitext(name)[1] in supported_workflow_exts[wf_type]:
name = os.path.splitext(name)[0]
Expand Down
6 changes: 4 additions & 2 deletions cwlab/wf_input/make_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import sys
import re
from .read_wf import supported_workflow_exts
from copy import copy

supported_workflow_types = supported_workflow_exts.keys()

Expand All @@ -18,9 +19,10 @@ def make_CWL_File_or_Directory(path, is_dir=False, secondary_files=[""]):
if sec_ext[0] == "^":
capture_sec_ext = re.search('^(\^+)(.*)', sec_ext)
n_exts_to_rm = len(capture_sec_ext.group(1))
value_root = copy(path)
for idx in range(0,n_exts_to_rm):
value_root = os.path.splitext(path)[0]
sec_file_item_path = path + capture_sec_ext.group(2)
value_root = os.path.splitext(value_root)[0]
sec_file_item_path =value_root + capture_sec_ext.group(2)
else:
sec_file_item_path = path + sec_ext
cwl_sec_file_array.append( {"class": "File", "path": sec_file_item_path } )
Expand Down
3 changes: 2 additions & 1 deletion cwlab/wf_input/match_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import fnmatch
import sys
import re
from copy import copy

def path_exists(path_str, is_dir=False):
if is_dir:
Expand Down Expand Up @@ -61,7 +62,7 @@ def class_file(value_string, secondary_files, validate_paths=True, search_paths=
if sec_ext[0] == "^":
capture_sec_ext = re.search('^(\^+)(.*)', sec_ext)
n_exts_to_rm = len(capture_sec_ext.group(1))
value_root = path
value_root = copy(path)
for idx in range(0,n_exts_to_rm):
value_root = os.path.splitext(value_root)[0]
sec_file_item_path =value_root + capture_sec_ext.group(2)
Expand Down
10 changes: 10 additions & 0 deletions cwlab/wf_input/read_cwl.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys, os
from .read_xls import clean_string
from ruamel.yaml.comments import CommentedMap, CommentedSeq

def is_basic_type_instance(value):
return (isinstance(value, int) or
Expand Down Expand Up @@ -113,6 +114,15 @@ def read_config_from_cwl_file(cwl_file):
if type_ == "File" and "secondaryFiles" in inp_rec:
if isinstance(inp_rec["secondaryFiles"], str):
secondary_files = [ inp_rec["secondaryFiles"] ]
elif isinstance(inp_rec["secondaryFiles"], CommentedMap) and \
"pattern" in inp_rec["secondaryFiles"].keys():
secondary_files = [ inp_rec["secondaryFiles"]["pattern"] ]
elif isinstance(inp_rec["secondaryFiles"], CommentedSeq):
secondary_files = []
for sec_file in inp_rec["secondaryFiles"]:
assert isinstance(sec_file, CommentedMap) and "pattern" in sec_file, \
print_pref + "E: invalid secondaryFiles field for parameter " + name
secondary_files.append(sec_file["pattern"])
elif isinstance(inp_rec["secondaryFiles"], list):
secondary_files = inp_rec["secondaryFiles"]
else:
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name='cwlab',
version='0.3.0',
version='0.3.1',
description='A platform-agnostic, cloud-ready framework for simplified deployment of the Common Workflow Language using a graphical web interface',
long_description=open(README).read(),
long_description_content_type="text/x-rst",
Expand Down Expand Up @@ -35,9 +35,9 @@
'pyexcel-xlsx',
'PyYAML',
'pexpect',
'janis-pipelines>=0.7.0'
'janis-pipelines>=0.7.0',
'cwltool==1.0.20181201184214; platform_system=="Windows"',
'cwltool>=1.0.20180809224403; platform_system!="Windows"',
'cwltool >=1.0.20180809224403, <=1.0.20191022103248; platform_system!="Windows"',
'psutil',
'miniwdl>=0.0.5'
],
Expand Down

0 comments on commit 17be699

Please sign in to comment.