Skip to content

Commit

Permalink
Test_13: Pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreRico committed Oct 21, 2024
1 parent 0572b99 commit f92235b
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions pipeline/PharmCAT_Pipeline.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,11 @@ task pipeline_task {
# cohorts, such as UK Biobank). Input VCF files must at least comply with
# Variant Call Format (VCF) Version >= 4.2.

# Resolver a variável `vcf_file` fora do bloco condicional
vcf_file="~{vcf_file}"

# option 1: User add on VCF or TSV file in the vcf_file input
if [[ -n "~{vcf_file}" && -f ~{vcf_file} ]]; then
if [[ -n ~{vcf_file} && -f ~{vcf_file} ]]; then
# mkdir -p data
cp ~{vcf_file} wf/data
echo "Processing list of VCF files as a single block from: ~{vcf_file}" >> $log_file
Expand All @@ -276,33 +279,31 @@ task pipeline_task {
eval $cmd

# Option 2: None VCF or TSV input. Check directory content to process

elif [[ -z "~{vcf_file}" ]]; then
# if [[ $(ls wf/data/*.vcf.* 2>/dev/null | wc -l) -gt 0 ]]; then
# echo "Processing all individual VCF files in the directory: wf/data/" >> $log_file

# VCFs_list="wf/VCFs_list.txt"
# ls wf/data/*.vcf.* > $VCFs_list

# while read -r vcf_file; do
# echo "Processing individual VCF file: $vcf_file" >> $log_file
# cmd="pharmcat_pipeline $vcf_file $arg"
# echo "Running command: $cmd" >> $log_file
# eval $cmd
# done < $VCFs_list
# else
# echo "No VCF files found in files/input_directory. Exiting." >> $log_file
# exit 1
# fi

echo "dentro da opcao de diretorio" >> $log_file
elif [[ -z "$vcf_file" ]]; then
if [[ $(ls wf/data/*.vcf.* 2>/dev/null | wc -l) -gt 0 ]]; then
echo "Processing all individual VCF files in the directory: wf/data/" >> $log_file

VCFs_list="wf/VCFs_list.txt"
ls wf/data/*.vcf.* > $VCFs_list

while read -r vcf_file; do
echo "Processing individual VCF file: $vcf_file" >> $log_file
cmd="pharmcat_pipeline $vcf_file $arg"
echo "Running command: $cmd" >> $log_file
eval $cmd
done < $VCFs_list
else
echo "No VCF files found in wf/data/. Exiting." >> $log_file
exit 1
fi

else
echo "No VCF or list of VCFs provided or found in directory. Exiting." >> $log_file
exit 1
fi



# Run the command
echo "Pharmcat_pipeline finished" >> $log_file

Expand Down

0 comments on commit f92235b

Please sign in to comment.