diff --git a/t1dgrs2_pipeline/v2.0/Dockerfile b/t1dgrs2_pipeline/v2.0/Dockerfile index 61730d1..9e54050 100644 --- a/t1dgrs2_pipeline/v2.0/Dockerfile +++ b/t1dgrs2_pipeline/v2.0/Dockerfile @@ -83,3 +83,4 @@ WORKDIR /data RUN chown -R docker:staff /data ENTRYPOINT [ "/opt/entrypoint.sh" ] + diff --git a/t1dgrs2_pipeline/v2.0/pipeline_config/t1dgrs2_tasks.json b/t1dgrs2_pipeline/v2.0/pipeline_config/t1dgrs2_tasks.json index 012c0d8..04ac930 100644 --- a/t1dgrs2_pipeline/v2.0/pipeline_config/t1dgrs2_tasks.json +++ b/t1dgrs2_pipeline/v2.0/pipeline_config/t1dgrs2_tasks.json @@ -459,8 +459,8 @@ "", "--remove_file", "", - "--output_file", - "_export.csv", + "--out_prefix", + "", "--missing_hla_threshold", "", "--missing_non_hla_threshold", diff --git a/t1dgrs2_pipeline/v2.0/scripts/generate_file_for_export.pl b/t1dgrs2_pipeline/v2.0/scripts/generate_file_for_export.pl index 5d7711d..4215898 100755 --- a/t1dgrs2_pipeline/v2.0/scripts/generate_file_for_export.pl +++ b/t1dgrs2_pipeline/v2.0/scripts/generate_file_for_export.pl @@ -7,7 +7,7 @@ my $t1dgrs2_results_file = ''; my $missingness_summary_file = ''; my $remove_file = ''; -my $output_file = ''; +my $out_prefix = ''; my $missing_hla_threshold = 1; my $missing_non_hla_threshold = 3; @@ -15,7 +15,7 @@ 't1dgrs2_results_file=s' => \$t1dgrs2_results_file, 'missingness_summary_file=s' => \$missingness_summary_file, 'remove_file=s' => \$remove_file, - 'output_file=s' => \$output_file, + 'out_prefix=s' => \$out_prefix, 'missing_hla_threshold:i' => \$missing_hla_threshold, 'missing_non_hla_threshold:i' => \$missing_non_hla_threshold, ) or die("Invalid options"); @@ -44,9 +44,13 @@ } close REMOVE; -# Open output file for writing -open(OUTPUT_FILE, ">".$output_file); -print OUTPUT_FILE join(",", "RTI_Accession","GRS2","Missingness_Filter")."\n"; +# Open sample output file for writing +open(SAMPLE_OUTPUT_FILE, ">".$out_prefix.".csv"); +print SAMPLE_OUTPUT_FILE join(",", "RTI_Accession","GRS2","Missingness_Filter")."\n"; + +# Open control output file for writing +open(CONTROL_OUTPUT_FILE, ">".$out_prefix."_controls.csv"); +print CONTROL_OUTPUT_FILE join(",", "RTI_Accession","GRS2","Missingness_Filter")."\n"; # Process t1dgrs2 results file open(T1DGRS2_RESULTS, $t1dgrs2_results_file); @@ -54,21 +58,24 @@ while() { chomp; @F = split("\t"); - if (!exists($remove{$F[0]})) { - my $missingness = "?"; - if (exists($missing_hla_counts{$F[0]})) { - if ( - $missing_hla_counts{$F[0]} < $missing_hla_threshold - && $missing_non_hla_counts{$F[0]} < $missing_non_hla_threshold - ) { - $missingness = "PASS"; - } else { - $missingness = "FAIL"; - } + my $missingness = "?"; + if (exists($missing_hla_counts{$F[0]})) { + if ( + $missing_hla_counts{$F[0]} < $missing_hla_threshold + && $missing_non_hla_counts{$F[0]} < $missing_non_hla_threshold + ) { + $missingness = "PASS"; + } else { + $missingness = "FAIL"; } - print OUTPUT_FILE join(",", $F[0], $F[2], $missingness)."\n"; + } + if (exists($remove{$F[0]})) { + print CONTROL_OUTPUT_FILE join(",", $F[0], $F[2], $missingness)."\n"; + } else { + print SAMPLE_OUTPUT_FILE join(",", $F[0], $F[2], $missingness)."\n"; } } close T1DGRS2_RESULTS; -close OUTPUT_FILE; +close SAMPLE_OUTPUT_FILE; +close CONTROL_OUTPUT_FILE;