@@ -100,6 +100,10 @@ workflow upstream {
100100 runtime_attributes = default_runtime_attributes
101101 }
102102
103+ if (defined (sex ) && (mosdepth .inferred_sex != sex )) {
104+ String qc_sex = "~{sample_id }: Reported sex ~{sex } does not match inferred sex ~{mosdepth .inferred_sex }."
105+ }
106+
103107 call DeepVariant .deepvariant {
104108 input :
105109 sample_id = sample_id ,
@@ -114,7 +118,7 @@ workflow upstream {
114118
115119 call Sawfish .sawfish_discover {
116120 input :
117- sex = select_first ([ sex , mosdepth .inferred_sex ]) ,
121+ sex = mosdepth .inferred_sex ,
118122 aligned_bam = aligned_bam_data ,
119123 aligned_bam_index = aligned_bam_index ,
120124 ref_fasta = ref_map ["fasta" ], # !FileCoercion
@@ -128,7 +132,7 @@ workflow upstream {
128132 call Trgt .trgt {
129133 input :
130134 sample_id = sample_id ,
131- sex = select_first ([ sex , mosdepth .inferred_sex ]) ,
135+ sex = mosdepth .inferred_sex ,
132136 aligned_bam = aligned_bam_data ,
133137 aligned_bam_index = aligned_bam_index ,
134138 ref_fasta = ref_map ["fasta" ], # !FileCoercion
@@ -151,7 +155,7 @@ workflow upstream {
151155 call Hificnv .hificnv {
152156 input :
153157 sample_id = sample_id ,
154- sex = select_first ([ sex , mosdepth .inferred_sex ]) ,
158+ sex = mosdepth .inferred_sex ,
155159 aligned_bam = aligned_bam_data ,
156160 aligned_bam_index = aligned_bam_index ,
157161 vcf = deepvariant .vcf ,
@@ -239,5 +243,8 @@ workflow upstream {
239243 String stat_cnv_DEL_count = hificnv .stat_DEL_count
240244 String stat_cnv_DUP_sum = hificnv .stat_DUP_sum
241245 String stat_cnv_DEL_sum = hificnv .stat_DEL_sum
246+
247+ # qc messages
248+ String ? msg_qc_sex = qc_sex
242249 }
243250}
0 commit comments