diff --git a/lib/galaxy/jobs/runners/__init__.py b/lib/galaxy/jobs/runners/__init__.py index 64ba78fd805..439a317a8fd 100644 --- a/lib/galaxy/jobs/runners/__init__.py +++ b/lib/galaxy/jobs/runners/__init__.py @@ -40,7 +40,18 @@ class BaseJobRunner( object ): if job_wrapper.dependency_shell_commands: commands = "; ".join( job_wrapper.dependency_shell_commands + [ commands ] ) - # Append commands to copy job outputs based on from_work_dir attribute. + # -- Append commands to copy job outputs based on from_work_dir attribute. -- + + # Set up dict of dataset id --> output path; output path can be real or + # false depending on outputs_to_working_directory + output_paths = {} + for dataset_path in job_wrapper.get_output_fnames(): + path = dataset_path.real_path + if self.app.config.outputs_to_working_directory: + path = dataset_path.false_path + output_paths[ dataset_path.dataset_id ] = path + + # Walk job's output associations to find and use from_work_dir attributes. job = job_wrapper.get_job() job_tool = self.app.toolbox.tools_by_id.get( job.tool_id, None ) for dataset_assoc in job.output_datasets + job.output_library_datasets: @@ -53,12 +64,13 @@ class BaseJobRunner( object ): # Copy from working dir to HDA. # TODO: move instead of copy to save time? source_file = os.path.join( os.path.abspath( job_wrapper.working_directory ), hda_tool_output.from_work_dir ) + destination = output_paths[ dataset.dataset_id ] if in_directory( source_file, job_wrapper.working_directory ): try: - commands += "; cp %s %s" % ( source_file, dataset.file_name ) - log.debug( "Copying %s to %s as directed by from_work_dir" % ( source_file, dataset.file_name ) ) + commands += "; cp %s %s" % ( source_file, destination ) + log.debug( "Copying %s to %s as directed by from_work_dir" % ( source_file, destination ) ) except ( IOError, OSError ): - log.debug( "Could not copy %s to %s as directed by from_work_dir" % ( source_file, dataset.file_name ) ) + log.debug( "Could not copy %s to %s as directed by from_work_dir" % ( source_file, destination ) ) else: # Security violation. log.exception( "from_work_dir specified a location not in the working directory: %s, %s" % ( source_file, job_wrapper.working_directory ) ) diff --git a/lib/galaxy/jobs/runners/lwr.py b/lib/galaxy/jobs/runners/lwr.py index 254ddfd1417..ae576ef2eea 100644 --- a/lib/galaxy/jobs/runners/lwr.py +++ b/lib/galaxy/jobs/runners/lwr.py @@ -112,16 +112,30 @@ class FileStager(object): class Client(object): """ """ - def __init__(self, remote_host, job_id): + """ + """ + def __init__(self, remote_host, job_id, private_key=None): if not remote_host.endswith("/"): remote_host = remote_host + "/" + ## If we don't have an explicit private_key defined, check for + ## one embedded in the URL. A URL of the form + ## https://moo@cow:8913 will try to contact https://cow:8913 + ## with a private key of moo + private_key_format = "https?://(.*)@.*/?" + private_key_match= re.match(private_key_format, remote_host) + if not private_key and private_key_match: + private_key = private_key_match.group(1) + remote_host = remote_host.replace("%s@" % private_key, '', 1) self.remote_host = remote_host self.job_id = job_id + self.private_key = private_key def url_open(self, request, data): return urllib2.urlopen(request, data) def __build_url(self, command, args): + if self.private_key: + args["private_key"] = self.private_key data = urllib.urlencode(args) url = self.remote_host + command + "?" + data return url diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index f5f4d177ac5..ca461f892e0 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -1083,7 +1083,9 @@ class Tool: help_pages = self.help.findall( "page" ) help_header = self.help.text try: - self.help = Template( util.rst_to_html(self.help.text) ) + self.help = Template( util.rst_to_html(self.help.text), input_encoding='utf-8', + output_encoding='utf-8', default_filters=[ 'decode.utf8' ], + encoding_errors='replace' ) except: log.exception( "error in help for tool %s" % self.name ) # Multiple help page case @@ -1093,7 +1095,10 @@ class Tool: help_footer = help_footer + help_page.tail # Each page has to rendered all-together because of backreferences allowed by rst try: - self.help_by_page = [ Template( util.rst_to_html( help_header + x + help_footer ) ) + self.help_by_page = [ Template( util.rst_to_html( help_header + x + help_footer, + input_encoding='utf-8', output_encoding='utf-8', + default_filters=[ 'decode.utf8' ], + encoding_errors='replace' ) ) for x in self.help_by_page ] except: log.exception( "error in multi-page help for tool %s" % self.name ) diff --git a/tools/rgenetics/rgCaCo.xml b/tools/rgenetics/rgCaCo.xml index 78355f572dc..4a0aac2a784 100644 --- a/tools/rgenetics/rgCaCo.xml +++ b/tools/rgenetics/rgCaCo.xml @@ -1,4 +1,5 @@ + plink for unrelated subjects rgCaCo.py '$i.extra_files_path/$i.metadata.base_name' "$title" '$out_file1' '$logf' '$logf.files_path' '$gffout' diff --git a/tools/rgenetics/rgClean.xml b/tools/rgenetics/rgClean.xml index 855c397fd6c..98566157c8a 100644 --- a/tools/rgenetics/rgClean.xml +++ b/tools/rgenetics/rgClean.xml @@ -1,4 +1,5 @@ + plink filter markers, subjects diff --git a/tools/rgenetics/rgGLM.xml b/tools/rgenetics/rgGLM.xml index 46931655837..ab72f486d40 100644 --- a/tools/rgenetics/rgGLM.xml +++ b/tools/rgenetics/rgGLM.xml @@ -1,4 +1,5 @@ + plink for genotype data diff --git a/tools/rgenetics/rgLDIndep.xml b/tools/rgenetics/rgLDIndep.xml index abf9f225a1d..144edfad544 100644 --- a/tools/rgenetics/rgLDIndep.xml +++ b/tools/rgenetics/rgLDIndep.xml @@ -1,4 +1,5 @@ + plink filter high LD pairs - decrease redundancy diff --git a/tools/rgenetics/rgQC.xml b/tools/rgenetics/rgQC.xml index 4d20c9d2423..19b243db57f 100644 --- a/tools/rgenetics/rgQC.xml +++ b/tools/rgenetics/rgQC.xml @@ -1,5 +1,6 @@ - + plink + Marker and Subject measures diff --git a/tools/rgenetics/rgTDT.xml b/tools/rgenetics/rgTDT.xml index 4abb5d83958..18d36c6f5bd 100644 --- a/tools/rgenetics/rgTDT.xml +++ b/tools/rgenetics/rgTDT.xml @@ -1,4 +1,6 @@ + plink + for family data