Skip to content

Commit

Permalink
Remove old sample output. Update sample output. Add Docker hints. Rem…
Browse files Browse the repository at this point in the history
…ove ENTRYPOINT.
  • Loading branch information
adthrasher committed Nov 17, 2023
1 parent 560b8ec commit ec820d6
Show file tree
Hide file tree
Showing 48 changed files with 217 additions and 146 deletions.
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,4 @@ COPY --chmod=755 --from=builder /opt/picard /opt/picard
COPY --chmod=755 --from=builder /opt/xenocp /opt/xenocp
COPY --chmod=755 --from=builder /opt/xenocp/bin/* /usr/local/bin/

COPY --chmod=755 cwl /opt/xenocp/cwl

ENTRYPOINT ["cwl-runner", "--parallel", "--outdir", "results", "--no-container", "/opt/xenocp/cwl/xenocp.cwl"]
COPY --chmod=755 cwl /opt/xenocp/cwl
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ $ docker build --tag xenocp .

The Docker image uses `cwl-runner cwl/xenocp.cwl` as its entrypoint.

The image assumes three working directories: `/data` for inputs, `/references` for
reference files, and `/results` for outputs. `/data` and `/references` can be
The image assumes three working directories: `/data` for inputs, `/reference` for
reference files, and `/results` for outputs. `/data` and `/reference` can be
read-only, where as `/results` needs write access.

The paths given in the input parameters file must be from inside the
Expand All @@ -197,7 +197,10 @@ container, not the host, e.g.,
bam:
class: File
path: /data/sample.bam
ref_db_prefix: /reference/ref.fa
ref_db_prefix: ref.fa
index:
class: Directory
path: /reference
aligner: "bwa aln"
```

Expand All @@ -213,6 +216,11 @@ $ docker run \
--mount type=bind,source=/path/to/reference,target=/reference,readonly \
--mount type=bind,source=$(pwd)/results,target=/results \
xenocp \
cwl-runner \
--parallel \
--outdir results \
--no-container \
/opt/xenocp/cwl/xenocp.cwl \
/data/inputs.yml
```

Expand Down
8 changes: 8 additions & 0 deletions cwl/bwa_alignse_onlymapped.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ hints:
specs: ["bwa aln", "bwa samse"]
tweak_sam:
specs: ["java.sh org.stjude.compbio.sam.TweakSam"]
DockerRequirement:
dockerPull: "ghcr.io/stjude/xenocp:latest"

inputs:
ref_db_prefix:
type: string
inputBinding:
position: 1
valueFrom: |
${
return inputs.index.path + "/" + self;
}
input_fastq:
type: File
inputBinding:
Expand All @@ -26,6 +32,8 @@ inputs:
label: Must be an output bam file name, not an absolute path
inputBinding:
position: 3
index:
type: Directory

outputs:
bam:
Expand Down
8 changes: 8 additions & 0 deletions cwl/bwa_mem_onlymapped.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ hints:
specs: ["bwa mem"]
tweak_sam:
specs: ["java.sh org.stjude.compbio.sam.TweakSam"]
DockerRequirement:
dockerPull: "ghcr.io/stjude/xenocp:latest"

requirements:
ResourceRequirement:
Expand All @@ -22,6 +24,10 @@ inputs:
type: string
inputBinding:
position: 1
valueFrom: |
${
return inputs.index.path + "/" + self;
}
input_fastq:
type: File
inputBinding:
Expand All @@ -31,6 +37,8 @@ inputs:
label: Must be an output bam file name, not an absolute path
inputBinding:
position: 3
index:
type: Directory

outputs:
bam:
Expand Down
6 changes: 5 additions & 1 deletion cwl/cat.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ doc: |
Merge a set of files into file using the cat utility.

requirements:
- class: InlineJavascriptRequirement
InlineJavascriptRequirement: {}

hints:
DockerRequirement:
dockerPull: "ghcr.io/stjude/xenocp:latest"

baseCommand: cat

Expand Down
2 changes: 2 additions & 0 deletions cwl/create_contam_lists.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ hints:
packages:
create_contam_list:
specs: [ "java.sh org.stjude.compbio.xenocp.CreateContamLists" ]
DockerRequirement:
dockerPull: "ghcr.io/stjude/xenocp:latest"

inputs:
input_bam:
Expand Down
9 changes: 9 additions & 0 deletions cwl/extract.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ steps:
out: [out_bam]
run:
class: CommandLineTool
hints:
DockerRequirement:
dockerPull: "ghcr.io/stjude/xenocp:latest"
stdout: other.bam
inputs:
bam:
Expand All @@ -62,6 +65,9 @@ steps:
scatter: chroms
run:
class: CommandLineTool
hints:
DockerRequirement:
dockerPull: "ghcr.io/stjude/xenocp:latest"
inputs:
chroms:
type: string
Expand All @@ -88,6 +94,9 @@ steps:
out: [unmapped_bam]
run:
class: CommandLineTool
hints:
DockerRequirement:
dockerPull: "ghcr.io/stjude/xenocp:latest"
stdout: unmapped.bam
inputs:
bam:
Expand Down
2 changes: 2 additions & 0 deletions cwl/get_chroms.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ hints:
packages:
bam_to_chr:
specs: ["bam_to_chrs.sh"]
DockerRequirement:
dockerPull: "ghcr.io/stjude/xenocp:latest"

baseCommand: bam_to_chrs.sh

Expand Down
4 changes: 4 additions & 0 deletions cwl/merge_markdup_index.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ doc: |
requirements:
- class: InlineJavascriptRequirement

hints:
DockerRequirement:
dockerPull: "ghcr.io/stjude/xenocp:latest"

baseCommand: merge_markdup_index.sh

inputs:
Expand Down
2 changes: 2 additions & 0 deletions cwl/qc_bam.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ hints:
packages:
qclib:
specs: ["qclib.sh"]
DockerRequirement:
dockerPull: "ghcr.io/stjude/xenocp:latest"

inputs:
bam:
Expand Down
2 changes: 2 additions & 0 deletions cwl/sort_flagstat.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ hints:
samtools:
specs: ["samtools flagstat"]
version: ["1.3.1"]
DockerRequirement:
dockerPull: "ghcr.io/stjude/xenocp:latest"

inputs:
input_bam:
Expand Down
2 changes: 2 additions & 0 deletions cwl/split_sam.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ hints:
packages:
SplitSam:
specs: [ "SplitSam.java" ]
DockerRequirement:
dockerPull: "ghcr.io/stjude/xenocp:latest"

inputs:
suffix_length:
Expand Down
8 changes: 7 additions & 1 deletion cwl/star_onlymapped.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ hints:
specs: ["STAR"]
tweak_sam:
specs: ["java.sh org.stjude.compbio.sam.TweakSam"]
DockerRequirement:
dockerPull: "ghcr.io/stjude/xenocp:latest"

inputs:
ref_db_prefix:
type: string
inputBinding:
position: 1
position: 4
input_fastq:
type: File
inputBinding:
Expand All @@ -31,6 +33,10 @@ inputs:
label: Must be an output bam file name, not an absolute path
inputBinding:
position: 3
index:
type: Directory
inputBinding:
position: 1

outputs:
bam:
Expand Down
2 changes: 2 additions & 0 deletions cwl/tweak_sam.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ hints:
packages:
create_contam_list:
specs: [ "java.sh org.stjude.compbio.sam.TweakSam" ]
DockerRequirement:
dockerPull: "ghcr.io/stjude/xenocp:latest"

inputs:
input_bam:
Expand Down
2 changes: 2 additions & 0 deletions cwl/view_awk_picard.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ hints:
samtools:
specs: ["samtools view"]
version: ["1.3.1"]
DockerRequirement:
dockerPull: "ghcr.io/stjude/xenocp:latest"

inputs:
input_bam:
Expand Down
9 changes: 7 additions & 2 deletions cwl/xenocp.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ inputs:
type: enum
symbols: ["bwa aln", "bwa mem", "star"]
name: aligner
index:
type: Directory
# See doc in split_sam.cwl for the meaning of the following arguments
suffix_length:
type: int?
Expand Down Expand Up @@ -84,6 +86,7 @@ steps:
in:
aligner: aligner
ref_db_prefix: ref_db_prefix
index: index
input_fastq: mapped-fastq/fastq
output_bam:
valueFrom: $(inputs.input_fastq.nameroot).contam.bam
Expand All @@ -101,6 +104,7 @@ steps:
in:
aligner: aligner
ref_db_prefix: ref_db_prefix
index: index
input_fastq: mapped-fastq/fastq
output_bam:
valueFrom: $(inputs.input_fastq.nameroot).contam.bam
Expand All @@ -118,6 +122,7 @@ steps:
in:
aligner: aligner
ref_db_prefix: ref_db_prefix
index: index
input_fastq: mapped-fastq/fastq
output_bam:
valueFrom: $(inputs.input_fastq.nameroot).contam.bam
Expand Down Expand Up @@ -160,7 +165,7 @@ steps:
out: [cleaned_bam]

# Step05b: sort tie BAMs prior to merge
sort-bams:
sort_tie_bams:
run: bio-cwl-tools:picard/picard_SortSam.cwl
in:
alignments: contamination/output_tie_bam
Expand Down Expand Up @@ -190,7 +195,7 @@ steps:
run: merge_markdup_index.cwl
in:
input_bams:
source: [cleanse/cleaned_bam, split/unmapped]
source: sort_tie_bams/sorted_alignments
linkMerge: merge_flattened
output_bam:
source: bam
Expand Down
5 changes: 4 additions & 1 deletion sample_data/input_data/inputs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
bam:
class: File
path: /data/SJRB001_X.subset.bam
ref_db_prefix: /reference/MGSCv37/MGSCv37.fa
ref_db_prefix: MGSCv37.fa
index:
class: Directory
path: /reference/MGSCv37
aligner: "bwa aln"
5 changes: 4 additions & 1 deletion sample_data/input_data/inputs_local.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
bam:
class: File
path: SJRB001_X.subset.bam
ref_db_prefix: /path/to/reference
ref_db_prefix: MGSCv37.fa
index:
class: Directory
path: ../../reference/MGSCv37
aligner: "bwa aln"
Loading

0 comments on commit ec820d6

Please sign in to comment.