From 8e77e5772688885680620e8e1005ab53e0825662 Mon Sep 17 00:00:00 2001 From: Nathan Gaddis Date: Wed, 1 May 2024 22:12:59 +0000 Subject: [PATCH] Updates to t1dgrs2 pipeline --- .../v1.0/filter_gvcfs_by_consent.sh | 9 +++++--- t1dgrs2_pipeline/v1.0/merge_results_files.sh | 23 +++++++++++++++---- .../v1.0/t1dgrs2_pipeline_export.json | 12 +++++++--- .../v1.0/t1dgrs2_pipeline_sample.json | 2 +- t1dgrs2_pipeline/v1.0/t1dgrs2_tasks.json | 17 ++++++++++---- 5 files changed, 47 insertions(+), 16 deletions(-) diff --git a/t1dgrs2_pipeline/v1.0/filter_gvcfs_by_consent.sh b/t1dgrs2_pipeline/v1.0/filter_gvcfs_by_consent.sh index 5731670..7324778 100644 --- a/t1dgrs2_pipeline/v1.0/filter_gvcfs_by_consent.sh +++ b/t1dgrs2_pipeline/v1.0/filter_gvcfs_by_consent.sh @@ -136,9 +136,12 @@ echo "Successfully moved all consented files to gvcfs folder" #Move remaining gz files that don't have consent to the alternate folder remaining_files=$(ls $imported_gvcfs_dir*.gz |wc -l | cut -d ' ' -f1) -echo "Moving the remaining $remaining_files gvcf files. Along with the tbi files. Will remove them later" - -mv $imported_gvcfs_dir*.gz* $nonconsented_gvcfs_dir +echo "Moving the remaining $remaining_files gvcf files." +for file in $(ls $imported_gvcfs_dir*.gvcf.gz); do + mv $file $nonconsented_gvcfs_dir + file_name=$(basename "$file") + echo "Moved $file_name to $nonconsented_gvcfs_dir" +done echo "Successfully moved nonconsented gvcfs to nonconsent-gvcfs folder" ################################ diff --git a/t1dgrs2_pipeline/v1.0/merge_results_files.sh b/t1dgrs2_pipeline/v1.0/merge_results_files.sh index 2b37681..1556d06 100644 --- a/t1dgrs2_pipeline/v1.0/merge_results_files.sh +++ b/t1dgrs2_pipeline/v1.0/merge_results_files.sh @@ -1,7 +1,8 @@ #!/bin/bash sample_results_dir="" -output_file="" +output_result_file="" +output_control_file="" while [ "$1" != "" ]; do @@ -9,8 +10,11 @@ do --sample_results_dir ) shift sample_results_dir=$1 ;; - --output_file ) shift - output_file=$1 + --output_result_file ) shift + output_result_file=$1 + ;; + --output_control_file ) shift + output_control_file=$1 ;; esac shift @@ -20,10 +24,19 @@ sample_results_dir=$(echo $sample_results_dir | perl -ne 'chomp; if (substr($_, mkdir -p $sample_results_dir first_file=true -for file in $(ls $sample_results_dir*/*_for_export.tsv ); do +for file in $(ls $sample_results_dir*/*_for_export.tsv | grep -v qc ); do + if [ "$first_file" = true ] ; then + head -n 1 $file + first_file=false + fi + tail -n +2 $file +done > $output_result_file + +first_file=true +for file in $(ls $sample_results_dir*/*_for_export.tsv | grep qc ); do if [ "$first_file" = true ] ; then head -n 1 $file first_file=false fi tail -n +2 $file -done > $output_file +done > $output_control_file diff --git a/t1dgrs2_pipeline/v1.0/t1dgrs2_pipeline_export.json b/t1dgrs2_pipeline/v1.0/t1dgrs2_pipeline_export.json index 902541a..0b4359e 100644 --- a/t1dgrs2_pipeline/v1.0/t1dgrs2_pipeline_export.json +++ b/t1dgrs2_pipeline/v1.0/t1dgrs2_pipeline_export.json @@ -16,7 +16,12 @@ "default": "", "required": true }, - "output_file": { + "output_result_file": { + "type": "string", + "default": "", + "required": true + }, + "output_contorl_file": { "type": "string", "default": "", "required": true @@ -51,7 +56,8 @@ "entry_point": "merge_results", "entry_point_inputs": { "sample_results_dir": "", - "output_file": "" + "output_result_file": "", + "output_contorl_file": "" }, "pipeline": { "merge_results": { @@ -63,7 +69,7 @@ "sftp_server": "", "username": "", "password": "", - "results_file": "", + "results_file": "", "target_dir": "" } }, diff --git a/t1dgrs2_pipeline/v1.0/t1dgrs2_pipeline_sample.json b/t1dgrs2_pipeline/v1.0/t1dgrs2_pipeline_sample.json index 9b8ecac..61da026 100644 --- a/t1dgrs2_pipeline/v1.0/t1dgrs2_pipeline_sample.json +++ b/t1dgrs2_pipeline/v1.0/t1dgrs2_pipeline_sample.json @@ -142,7 +142,7 @@ "missing_file": "", "sample_id": "", "genedx_manifest": "", - "output_file": "_for_export.tsv" + "output_file": "_for_export.csv" } }, "returncode_1": { diff --git a/t1dgrs2_pipeline/v1.0/t1dgrs2_tasks.json b/t1dgrs2_pipeline/v1.0/t1dgrs2_tasks.json index ac3bbb3..8e66ff7 100644 --- a/t1dgrs2_pipeline/v1.0/t1dgrs2_tasks.json +++ b/t1dgrs2_pipeline/v1.0/t1dgrs2_tasks.json @@ -489,7 +489,10 @@ "sample_results_dir": { "type": "dir" }, - "output_file": { + "output_result_file": { + "type": "str" + }, + "output_control_file": { "type": "str" } }, @@ -497,13 +500,19 @@ "/opt/merge_results_files.sh", "--sample_results_dir", "", - "--output_file", - "" + "--output_result_file", + "", + "--output_control_file", + "" ], "outputs": { "results_file": { "type": "file", - "value": "" + "value": "" + }, + "control_file": { + "type": "file", + "value": "" }, "log": { "type": "file",