Question: CWL bwa create index to bwa mem alignment workflow
0
gravatar for Biowoogles
2.5 years ago by
Biowoogles20
United Kingdom
Biowoogles20 wrote:

Hi,

My question is about whether there exists any examples of how to create a workflow in CWL consisting of two steps:

  1. Create BWA indexes from input FASTA using BWA INDEX
  2. Pass indexes from step 1 to BWA MEM to perform an alignment

The issue I foresee is that BWA MEM in Step 2 expects a single reference FASTA as the command line input, and yet Step 1 creates a number of files which must be placed in the correct directory such that BWA MEM can access them. So, how does one cleanly pass the output of Step 1 into Step 2?

Thanks

cwl common workflow language • 1.6k views
ADD COMMENTlink modified 2.5 years ago by well30970 • written 2.5 years ago by Biowoogles20
3
gravatar for well309
2.5 years ago by
well30970
well30970 wrote:

There are examples available at official repository (https://github.com/common-workflow-language/workflows).

I also have publicly available CWL files for BWA made by myself here: https://github.com/labbcb/tool-bwa. I didd't find any example of workflow that uses these CWL files. Here an example using my CWL files (from a workflow I am working):

cwlVersion: v1.0
class: Workflow

requirements:
  ScatterFeatureRequirement: {}
  StepInputExpressionRequirement: {}
  InlineJavascriptRequirement: {}

inputs:
  files_R1: File[]
  files_R2: File[]
  ref: File
  M: boolean
  workers: int

outputs:
  aligned-files:
    type: File[]
    outputSource: align/output-file

steps:
  index:
    run: https://raw.githubusercontent.com/labbcb/tool-bwa/master/bwa-index.cwl
    in:
      file: ref
    out: [output]
  align:
    run: https://raw.githubusercontent.com/labbcb/tool-bwa/master/bwa-mem.cwl
    scatter: [file_R1, file_R2]
    scatterMethod: dotproduct
    in:
      file_R1: files_R1
      file_R2: files_R2
      output:
        valueFrom: $(inputs.file_R1.basename).sam
      idxbase: index/output
      M: M
      t: workers
    out: [output-file]

Input data:

files_R1:
  - class: File
    path: Sample_1_R1.fastq.gz
  - class: File
    path: Sample_2_R1.fastq.gz
files_R2:
  - class: File
    path: Sample_1_R2.fastq.gz
  - class: File
    path: Sample_2_R2.fastq.gz
workers: 4
ref:
  class: File
  path: genome.fasta
M: true
ADD COMMENTlink written 2.5 years ago by well30970
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1825 users visited in the last hour