Add workflow to generate single chromosome fastqs
[arvados-tutorial.git] / make-singlechromfastq / bam2singlechromfastq.cwl
1 $namespaces:
2  s: https://schema.org/
3  edam: http://edamontology.org/
4  arv: "http://arvados.org/cwl#"
5 s:codeRepository: https://github.com/arvados/arvados-tutorial
6 s:license: https://www.gnu.org/licenses/agpl-3.0.en.html
7 cwlVersion: v1.1
8 class: CommandLineTool
9 label: Convert one chromosome of bam to fastqs
10 requirements:
11   ShellCommandRequirement: {}
12 hints:
13   DockerRequirement:
14     dockerPull: curii/bwa-samtools
15   ResourceRequirement:
16     ramMin: 20000
17     coresMin: 4
18   arv:RuntimeConstraints:
19     keep_cache: 9216
20     outputDirType: keep_output_dir
21   SoftwareRequirement:
22     packages:
23       Samtools:
24         specs: [ "https://identifiers.org/rrid/RRID:SCR_002105" ]
25         version: [ "1.10" ]
26 inputs:
27   bam:
28     type: File
29     #format: edam:format_2572 # BAM
30     label: Alignments in BAM format
31     secondaryFiles: [.bai]
32   sample:
33     type: string
34     label: Sample name
35   chrom:
36     type: string
37     label: Chromosome name
38 outputs:
39   fastq1:
40     type: File
41     #format: edam:format_1930 # FASTQ
42     label: One of set of pair-end FASTQs (R1)
43     outputBinding:
44       glob: "*_1.fastq.gz"
45   fastq2:
46     type: File
47     #format: edam:format_1930 # FASTQ
48     label: One of set of pair-end FASTQs (R2)
49     outputBinding:
50       glob: "*_2.fastq.gz"
51 baseCommand: [samtools, view]
52 arguments:
53   - "-b"
54   - $(inputs.bam)
55   - $(inputs.chrom)
56   - shellQuote: false
57     valueFrom: "|"
58   - "samtools"
59   - "sort"
60   - "-n"
61   - "-"
62   - shellQuote: false
63     valueFrom: "|"
64   - "samtools"
65   - "fastq"
66   - "-@"
67   - $(runtime.cores)
68   - "-"
69   - "-N"
70   - prefix: "-0"
71     valueFrom: "/dev/null"
72   - prefix: "-s"
73     valueFrom: "/dev/null"
74   - prefix: "-1"
75     valueFrom: $(inputs.sample)_1.fastq.gz
76   - prefix: "-2"
77     valueFrom: $(inputs.sample)_2.fastq.gz