@@ -608,41 +608,6 @@ task CollectQCMetrics {
608608 }
609609}
610610
611- task GetNumberOfSitesInChunk {
612- input {
613- File reference_chunk
614-
615- String docker
616- Int mem_gb = 6
617- Int cpu = 1
618- Int disk_size_gb = ceil (size (reference_chunk , "GiB" ) + 10 )
619- Int preemptible = 3
620- Int max_retries = 1
621- }
622-
623- command <<<
624- set -xeuo pipefail
625- /bin/GLIMPSE2_extract_num_sites_from_reference_chunk ~{reference_chunk } > n_sites.txt
626- cat n_sites.txt
627- grep "Lrare" n_sites.txt | sed 's/Lrare=//' > n_rare.txt
628- grep "Lcommon" n_sites.txt | sed 's/Lcommon=//' > n_common.txt
629- >>>
630-
631- runtime {
632- docker : docker
633- disks : "local-disk " + disk_size_gb + " HDD"
634- memory : mem_gb + " GiB"
635- cpu : cpu
636- preemptible : preemptible
637- maxRetries : max_retries
638- }
639-
640- output {
641- Int n_rare = read_int ("n_rare.txt" )
642- Int n_common = read_int ("n_common.txt" )
643- }
644- }
645-
646611task CountSamples {
647612 input {
648613 File vcf
@@ -668,50 +633,6 @@ task CountSamples {
668633 }
669634}
670635
671- task SelectResourceParameters {
672- input {
673- Int n_rare
674- Int n_common
675- Int n_samples
676- }
677-
678- command <<<
679- python3 << EOF
680- import math
681- n_rare = ~{n_rare }
682- n_common = ~{n_common }
683- n_samples = ~{n_samples }
684- n_sites = n_common + n_rare
685-
686- # try to keep expected runtime under 4 hours, but don't ask for more than 32 cpus, or 256 GB memory
687- #estimated_needed_threads = min(math.ceil(5e-6*n_sites*n_samples/240), 32)
688- estimated_needed_threads = 1 # hard coded to one for testing by jsoto
689- estimated_needed_memory_gb = min(math.ceil((800e-3 + 0.97e-6 * n_rare * estimated_needed_threads + 14.6e-6 * n_common * estimated_needed_threads + 6.5e-9 * (n_rare + n_common) * n_samples + 13.7e-3 * n_samples + 1.8e-6*(n_rare + n_common)*math.log(n_samples))), 256)
690-
691- # recalc allowable threads, may be some additional threads available due to rounding memory up
692- #threads_to_use = max(math.floor((estimated_needed_memory_gb - (800e-3 + 6.5e-9 * (n_rare + n_common) * n_samples + 13.7e-3 * n_samples + 1.8e-6*(n_rare + n_common)*math.log(n_samples)))/(0.97e-6 * n_rare + 14.6e-6 * n_common)), 1)
693- threads_to_use = 1 #hardcoded to 1 for testing by jsoto
694-
695- #estimated_needed_memory_gb = math.ceil(1.2 * estimated_needed_memory_gb)
696-
697- with open("n_cpus_request.txt", "w") as f_cpus_request:
698- f_cpus_request.write(f'{int(threads_to_use)}')
699-
700- with open("memory_gb.txt", "w") as f_mem:
701- f_mem.write(f'{int(estimated_needed_memory_gb)}')
702- EOF
703- >>>
704-
705- runtime {
706- docker : "us.gcr.io/broad-dsde-methods/python-data-slim:1.0"
707- }
708-
709- output {
710- Int memory_gb = read_int ("memory_gb.txt" )
711- Int request_n_cpus = read_int ("n_cpus_request.txt" )
712- }
713- }
714-
715636task CombineCoverageMetrics
716637 {
717638 input {
0 commit comments