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

Summing up Array[Floats] #2650

Closed
jsotobroad opened this issue Sep 22, 2017 · 3 comments
Closed

Summing up Array[Floats] #2650

jsotobroad opened this issue Sep 22, 2017 · 3 comments

Comments

@jsotobroad
Copy link
Contributor

It would nice to have a way of summing up a list of floats like if you have a scatter task that you then want to gather the outputs of, its not straightforward on how you dynamically size that gather task. This is what we currently do (and if it's stupid let us know!)

scatter (bam in list_of_bams) {
  call MakeBam{
    inputs:
      bam
  }

  Float mapped_bam_size = size(MakeBam.output_bam, "GB")
}

call SumFloats {
  input:
    sizes = mapped_bam_size,
}

.....
task SumFloats {
  Array[Float] sizes

  command <<<
  python -c "print ${sep="+" sizes}"
  >>>
  output {
    Float total_size = read_float(stdout())
  }
  runtime {
    docker: "python:2.7"
    preemptible: preemptible_tries
  }
}
@geoffjentry
Copy link
Contributor

@jsotobroad Please file this in the wdl repo, not the cromwell repo

@katevoss
Copy link

Issue moved to broadinstitute/wdl #137 via ZenHub

@jsotobroad
Copy link
Contributor Author

I was told to put it here!! sorry

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

3 participants