elowy01
11/15/2019 - 12:18 PM

Nextflow process to create a channel that emits values from a command that prints to stdout

process make_windows {
        /*
        Process to run SAMTools depth on params.pos_file and get a
        pos file that will be used later
        */

        memory '500 MB'
        executor 'local'
        cpus 1

        output:
        stdout ivals_path

        """
        bedtools makewindows -g human.hg38.genome -w 10000000 |awk -F'\t' '{p\
rint \$1":"\$2"-"\$3}' -
        """
}

// splitText() returns the lines with a newline each.
// This, may be not what we want, so if we want to get rid of the
// newline we need to use the map function
ivals_path.splitText().map{it -> it.trim()}.set { ival_ch }

process foo {
  input:
  val x from ival_ch

  script:
  """
  echo $x
  """
}