diff --git a/cwl/samples_fillout_workflow.cwl b/cwl/samples_fillout_workflow.cwl index 5c22526..51b6a63 100644 --- a/cwl/samples_fillout_workflow.cwl +++ b/cwl/samples_fillout_workflow.cwl @@ -136,7 +136,30 @@ steps: fasta="${ return inputs.ref_fasta.path; }" vcf="${ return inputs.targets_vcf.path }" fillout_vcf="fillout.vcf" - GetBaseCountsMultiSample --fasta "\${fasta}" --vcf "\${vcf}" --maq 20 --baq 20 --filter_improper_pair 0 --thread 8 --output "\${fillout_vcf}" \${bams_arg} + num_lines="\$(grep -v '^[#]' \${input_maf} | wc -l)" + more_than_zero="\$(( \${num_lines} > 0))" + if [ "\${more_than_zero}" == "1" ] + then + GetBaseCountsMultiSample --fasta "\${fasta}" --vcf "\${vcf}" --maq 20 --baq 20 --filter_improper_pair 0 --thread 8 --output "\${fillout_vcf}" \${bams_arg} + else + cat << EOF > "\${fillout_vcf}" + ##fileformat=VCFv4.2 + ##FORMAT= + ##FORMAT= + ##FORMAT= + ##FORMAT= + ##FORMAT= + ##FORMAT= + ##FORMAT= + ##FORMAT= + ##FORMAT= + ##FORMAT= + ##FORMAT= + ##FORMAT= + ##FORMAT= + #CHROM POS ID REF ALT QUAL FILTER INFO FORMAT P-\${sample_id} \${sample_id} + EOF + fi inputs: sample_ids: string[] ref_fasta: