Skip to content

Commit

Permalink
Updates to t1dgrs2 pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ngaddis committed May 1, 2024
1 parent 9d270a3 commit 8e77e57
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 16 deletions.
9 changes: 6 additions & 3 deletions t1dgrs2_pipeline/v1.0/filter_gvcfs_by_consent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

################################
Expand Down
23 changes: 18 additions & 5 deletions t1dgrs2_pipeline/v1.0/merge_results_files.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
#!/bin/bash

sample_results_dir=""
output_file=""
output_result_file=""
output_control_file=""

while [ "$1" != "" ];
do
case $1 in
--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
Expand All @@ -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
12 changes: 9 additions & 3 deletions t1dgrs2_pipeline/v1.0/t1dgrs2_pipeline_export.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -51,7 +56,8 @@
"entry_point": "merge_results",
"entry_point_inputs": {
"sample_results_dir": "<inputs.results_dir>",
"output_file": "<inputs.output_file>"
"output_result_file": "<inputs.output_result_file>",
"output_contorl_file": "<inputs.output_contorl_file>"
},
"pipeline": {
"merge_results": {
Expand All @@ -63,7 +69,7 @@
"sftp_server": "<inputs.sftp_server>",
"username": "<inputs.username>",
"password": "<inputs.password>",
"results_file": "<inputs.output_file>",
"results_file": "<inputs.output_result_file>",
"target_dir": "<inputs.target_dir>"
}
},
Expand Down
2 changes: 1 addition & 1 deletion t1dgrs2_pipeline/v1.0/t1dgrs2_pipeline_sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"missing_file": "<steps.extract_gvcf_variants.outputs.missing>",
"sample_id": "<inputs.sample_id>",
"genedx_manifest": "<inputs.genedx_manifest>",
"output_file": "<inputs.output_dir><inputs.sample_id>_for_export.tsv"
"output_file": "<inputs.output_dir><inputs.sample_id>_for_export.csv"
}
},
"returncode_1": {
Expand Down
17 changes: 13 additions & 4 deletions t1dgrs2_pipeline/v1.0/t1dgrs2_tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -489,21 +489,30 @@
"sample_results_dir": {
"type": "dir"
},
"output_file": {
"output_result_file": {
"type": "str"
},
"output_control_file": {
"type": "str"
}
},
"cmd": [
"/opt/merge_results_files.sh",
"--sample_results_dir",
"<inputs.sample_results_dir>",
"--output_file",
"<inputs.output_file>"
"--output_result_file",
"<inputs.output_result_file>",
"--output_control_file",
"<inputs.output_control_file>"
],
"outputs": {
"results_file": {
"type": "file",
"value": "<inputs.output_file>"
"value": "<inputs.output_result_file>"
},
"control_file": {
"type": "file",
"value": "<inputs.output_control_file>"
},
"log": {
"type": "file",
Expand Down

0 comments on commit 8e77e57

Please sign in to comment.