Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined javascript variable error #36

Closed
drjrm3 opened this issue Oct 31, 2018 · 1 comment
Closed

Undefined javascript variable error #36

drjrm3 opened this issue Oct 31, 2018 · 1 comment

Comments

@drjrm3
Copy link

drjrm3 commented Oct 31, 2018

Working on #34 again and I can now reproduce the same error in my larger workflow.

Step 1 is split_reads which correctly scatters over the files now after the workaround proposed.

Step 2 scatters over those files and tries to generate a string for output_file from one of the files generated as part of step 1. I am using the following JavaScript to generate this string and it works in cwltool so I had assumed it was the correct approach:

      output_file:
        valueFrom: |
          ${  
            var s = inputs.R1_file.nameroot;
            s = s.replace(".R1","");
            return s + ".out";
          }   

However, the error I get with cwlexec is:

[var runtime={"tmpdir":"/home/jmichael/cwl-workdir/79cb5eaa-3438-497f-8be8-85fd9a5523c7","tmpdirSize":"15005232752754688","outdirSize":"15005232752754688","cores":"1","outdir":"/home/jmichael/cwl-workdir/79cb5eaa-3438-497f-8be8-85fd9a5523c7","ram":"1024"};, var inputs={"R
12:20:50.855 default [pool-5-thread-1] ERROR c.i.s.c.e.e.lsf.LSFBwaitExecutorTask - Failed to wait for job process_reads <66124407>, Failed to evaluate the expression "${
  var s = inputs.R1_file.nameroot;
  s = s.replace(".R1","");
  return s + ".out";
}
": TypeError: Cannot read property "replace" from undefined in <eval> at line number 3

so it looks like it is not correctly using inputs.R1_file. Am I using the correct approach here? It appears to be the same general issues as in #34 but I don't know that I can use the same workaround since I don't take anything in the inputs section in the scatter so I can't use that as source.

UndefinedVariableError.tar.gz

@skeeey
Copy link
Collaborator

skeeey commented Nov 1, 2018

@drjrm3 the root cause is still the inputs.R1_file (split_reads/read1_file) is an array, this because output_file does not participate in scatter, we use the original inputs value to build the javascript context.

For scatter case, we may need to build the javascript context after the scatter phase. I will try to fix this problem

skeeey pushed a commit that referenced this issue Nov 2, 2018
skeeey pushed a commit that referenced this issue Nov 2, 2018
skeeey pushed a commit that referenced this issue Nov 2, 2018
@skeeey skeeey closed this as completed Nov 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants