Skip to content

Commit

Permalink
Making comments in code consistent; added a table showing the workflo…
Browse files Browse the repository at this point in the history
…w in `02-workflow-plan.Rmd`
  • Loading branch information
laderast committed Mar 15, 2024
1 parent 51b5774 commit 5d37756
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 22 deletions.
4 changes: 2 additions & 2 deletions 01-intro.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ task do_something {
head ~{fastq} >> output.txt
>>>
output {
File first_ten_lines = "output.txt" #output variable for task
File first_ten_lines = "output.txt" ## output variable for task
}
}
Expand All @@ -129,7 +129,7 @@ workflow my_workflow {
}
output {
File ten_lines = do_something.first_ten_lines #referring to task output here
File ten_lines = do_something.first_ten_lines ## referring to task output here
}
}
```
Expand Down
13 changes: 8 additions & 5 deletions 02-workflow-plan.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ The workflow diagram:

The tasks involved:

1. `BwaMem` aligns the samples to the reference genome (hg19). (outputs a `.bam` file)
2. `MarkDuplicates` marks PCR duplicates. (outputs a `.bam` file)
3. `ApplyBaseRecalibrator` perform base quality recalibration. (outputs a `.bam` file)
4. `Mutect2` performs paired somatic mutation calling. (outputs a `.vcf` file)
5. `annovar` annotates the called somatic mutations. (outputs a `.vcf` file)
|Task|Function|Inputs|Outputs|
|----|--------|------|-------|
|`BwaMem`|aligns the samples to the reference genome (hg19)|FASTA (`.fa`) file|`.bam` file|
|`MarkDuplicates|marks PCR duplicates|`.bam` file|marked `.bam` file|
|`ApplyBaseRecalibrator`|performs base quality recalibration|marked `.bam` file|`.bam` file|
|`Mutect2`|performs paired somatic mutation calling|`.bam` file|`.vcf` file|
|`annovar`|annotates the called somatic mutations|`.vcf` file with somatic mutations|annotated `.vcf` file|


## Workflow testing strategy

Expand Down
2 changes: 1 addition & 1 deletion 03-first-task.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ task BwaMem {
String read_group_id = "ID:" + base_file_name
String sample_name = "SM:" + base_file_name
String platform = "illumina"
String platform_info = "PL:" + platform # Create the platform information
String platform_info = "PL:" + platform ## Create the platform information
command <<<
set -eo pipefail
Expand Down
6 changes: 3 additions & 3 deletions 04-linear-chain.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ task BwaMem {
String read_group_id = "ID:" + base_file_name
String sample_name = "SM:" + base_file_name
String platform = "illumina"
String platform_info = "PL:" + platform # Create the platform information
String platform_info = "PL:" + platform ## Create the platform information
command <<<
Expand Down Expand Up @@ -331,7 +331,7 @@ task BwaMem {
}
}
# Mark duplicates
## Mark duplicates
task MarkDuplicates {
input {
File input_bam
Expand Down Expand Up @@ -415,7 +415,7 @@ task ApplyBaseRecalibrator {
-R ~{ref_fasta_local} \
#finds the current sort order of this bam file
## finds the current sort order of this bam file
samtools view -H ~{base_file_name}.recal.bam | grep @SQ | sed 's/@SQ\tSN:\|LN://g' > ~{base_file_name}.sortOrder.txt
>>>
Expand Down
22 changes: 11 additions & 11 deletions 05-structs.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ struct referenceGenome {
workflow minidata_mutation_calling_v1 {
input {
File sampleFastq
referenceGenome refGenome
referenceGenome refGenome ## our struct
...
}
# Map reads to reference
## Map reads to reference
call BwaMem {
input:
input_fastq = sampleFastq,
refGenome = refGenome
refGenome = refGenome ## our struct
}
}
```
Expand Down Expand Up @@ -81,13 +81,13 @@ task BwaMem {
String read_group_id = "ID:" + base_file_name
String sample_name = "SM:" + base_file_name
String platform = "illumina"
String platform_info = "PL:" + platform # Create the platform information
String platform_info = "PL:" + platform ## Create the platform information
command <<<
set -eo pipefail
#can we iterate through a struct??
## can we iterate through a struct??
mv ~{refGenome.ref_fasta} .
mv ~{refGenome.ref_fasta_index} .
mv ~{refGenome.ref_dict} .
Expand Down Expand Up @@ -167,7 +167,7 @@ workflow minidata_mutation_calling_v1 {
call BwaMem {
input:
input_fastq = sampleFastq,
refGenome = refGenome
refGenome = refGenome ## our struct
}
call MarkDuplicates {
Expand All @@ -183,7 +183,7 @@ workflow minidata_mutation_calling_v1 {
dbSNP_vcf_index = dbSNP_vcf_index,
known_indels_sites_VCFs = known_indels_sites_VCFs,
known_indels_sites_indices = known_indels_sites_indices,
refGenome = refGenome
refGenome = refGenome ## our struct
}
call Mutect2TumorOnly {
Expand Down Expand Up @@ -229,7 +229,7 @@ workflow minidata_mutation_calling_v1 {
task BwaMem {
input {
File input_fastq
referenceGenome refGenome
referenceGenome refGenome ## our struct
}
String base_file_name = basename(input_fastq, ".fastq")
Expand All @@ -238,7 +238,7 @@ task BwaMem {
String read_group_id = "ID:" + base_file_name
String sample_name = "SM:" + base_file_name
String platform = "illumina"
String platform_info = "PL:" + platform # Create the platform information
String platform_info = "PL:" + platform ## Create the platform information
command <<<
Expand Down Expand Up @@ -315,7 +315,7 @@ task ApplyBaseRecalibrator {
File dbSNP_vcf_index
File known_indels_sites_VCFs
File known_indels_sites_indices
referenceGenome refGenome
referenceGenome refGenome ## our struct
}
String base_file_name = basename(input_bam, ".duplicates_marked.bam")
Expand Down Expand Up @@ -357,7 +357,7 @@ task ApplyBaseRecalibrator {
-R ~{ref_fasta_local} \
#finds the current sort order of this bam file
# finds the current sort order of this bam file
samtools view -H ~{base_file_name}.recal.bam | grep @SQ | sed 's/@SQ\tSN:\|LN://g' > ~{base_file_name}.sortOrder.txt
>>>
Expand Down

0 comments on commit 5d37756

Please sign in to comment.