Skip to content

Commit

Permalink
try to make dockstore happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Soto committed Oct 1, 2024
1 parent 7a5039e commit 1f3dc74
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 38 deletions.
17 changes: 12 additions & 5 deletions .dockstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,29 @@ workflows:
email: [email protected]

- subclass: WDL
name: ReshapeReferencePanel
primaryDescriptorPath: /pipelines/imputation/scientificValidation/ReshapeReferencePanel.wdl
name: DuplicateVcfAndMerge
primaryDescriptorPath: /pipelines/imputation/simulatedData/DuplicateVcfAndMerge.wdl
authors:
- name: Terra Scientific Services
email: [email protected]

- subclass: WDL
name: DuplicateVcfAndMerge
primaryDescriptorPath: /pipelines/imputation/simulatedData/DuplicateVcfAndMerge.wdl
name: CreateImputationRefPanelBeagle
primaryDescriptorPath: /pipelines/imputation/simulatedData/CreateImputationRefPanelBeagle.wdl
authors:
- name: Terra Scientific Services
email: [email protected]

- subclass: WDL
name: ReshapeReferencePanel
primaryDescriptorPath: /pipelines/imputation/scientificValidation/ReshapeReferencePanel.wdl
authors:
- name: Terra Scientific Services
email: [email protected]

- subclass: WDL
name: SubsetVcfByBedFile
primaryDescriptorPath: /pipelines/imputation/simulatedData/SubsetVcfByBedFile.wdl
primaryDescriptorPath: /pipelines/imputation/scientificValidation/SubsetVcfByBedFile.wdl
authors:
- name: Terra Scientific Services
email: [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ workflow CreateImputationRefPanelBeagle {
input {
Array[File] ref_vcf
Array[File] ref_vcf_index
Array[String] chromosomes
Boolean create_brefs = true
Boolean create_interval_lists = true
Boolean create_bed_files = true
File ref_dict
# this is used to chunk up the input vcfs to create interval lists from them in a timely manner
Int chunkLength = 2500000
Expand All @@ -14,59 +18,63 @@ workflow CreateImputationRefPanelBeagle {
Float chunkLengthFloat = chunkLength

scatter (idx in range(length(ref_vcf))) {
Int chr = idx + 1
String custom_basename_with_chr = output_basename + ".chr" + chr
String chromosome = "chr" + chr
String chromosome = chromosomes[idx]
String custom_basename_with_chr = output_basename + "." + chromosome

call CalculateChromosomeLength {
input:
ref_dict = ref_dict,
chrom = chromosome
}

# the sim data only has a length of 124478211 in the header for chr1 (should be fixed at some point)
Int num_chunks = if (chr == 1) then (ceil(124478211 / chunkLengthFloat) - 1) else ceil(CalculateChromosomeLength.chrom_length / chunkLengthFloat)
Int num_chunks = ceil(CalculateChromosomeLength.chrom_length / chunkLengthFloat)

scatter (i in range(num_chunks)) {
String custom_basename_with_chr_and_chunk = output_basename + ".chr" + chr + ".chunk_" + i
if (create_interval_lists || create_bed_files){
scatter (i in range(num_chunks)) {
String custom_basename_with_chr_and_chunk = output_basename + chromosome + ".chunk_" + i

Int start = (i * chunkLength) + 1
Int end = if (CalculateChromosomeLength.chrom_length < ((i + 1) * chunkLength)) then CalculateChromosomeLength.chrom_length else ((i + 1) * chunkLength)
Int start = (i * chunkLength) + 1
Int end = if (CalculateChromosomeLength.chrom_length < ((i + 1) * chunkLength)) then CalculateChromosomeLength.chrom_length else ((i + 1) * chunkLength)

call CreateRefPanelIntervalLists {
input:
ref_panel_vcf = ref_vcf[idx],
ref_panel_vcf_index = ref_vcf_index[idx],
output_basename = custom_basename_with_chr_and_chunk,
chrom = chromosome,
start = start,
end = end
call CreateRefPanelIntervalLists {
input:
ref_panel_vcf = ref_vcf[idx],
ref_panel_vcf_index = ref_vcf_index[idx],
output_basename = custom_basename_with_chr_and_chunk,
chrom = chromosome,
start = start,
end = end
}
}
}

call GatherIntervalLists as GatherChunkedIntervalLists {
input:
basename = custom_basename_with_chr,
interval_lists = CreateRefPanelIntervalLists.interval_list
call GatherIntervalLists as GatherChunkedIntervalLists {
input:
basename = custom_basename_with_chr,
interval_lists = CreateRefPanelIntervalLists.interval_list
}
}

call CreateRefPanelBedFiles {
input:
ref_panel_interval_list = GatherChunkedIntervalLists.interval_list,
basename = custom_basename_with_chr,
if (create_bed_files){
call CreateRefPanelBedFiles {
input:
ref_panel_interval_list = select_first([GatherChunkedIntervalLists.interval_list]),
basename = custom_basename_with_chr,
}
}

call BuildBref3 {
input:
vcf = ref_vcf[idx],
basename = custom_basename_with_chr
if (create_brefs){
call BuildBref3 {
input:
vcf = ref_vcf[idx],
basename = custom_basename_with_chr
}
}
}

output {
Array[File] interval_lists = GatherChunkedIntervalLists.interval_list
Array[File] bed_files = CreateRefPanelBedFiles.bed_file
Array[File] brefs = BuildBref3.bref3
Array[File?] interval_lists = select_first([GatherChunkedIntervalLists.interval_list, []])
Array[File?] bed_files = select_first([CreateRefPanelBedFiles.bed_file, []])
Array[File?] brefs = select_first([BuildBref3.bref3, []])
}
}

Expand Down

0 comments on commit 1f3dc74

Please sign in to comment.