diff --git a/CHANGELOG.md b/CHANGELOG.md index 599997e647ecb00d1b6466b7215cac19435d0419..4e1b76a51fef019a747fd15f9037ab67a5469ab9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # v1.3.0 (in development) **User Facing** +* Check Design File for spaces in name and file contents **Background** * Add Nextflow Tower integration into CI (GHH's profile) diff --git a/workflow/main.nf b/workflow/main.nf index 8862991d57eec85dae8d55ecc7ac7001a187e671..37841165a1d4172e16210f0039670484ee020d5b 100755 --- a/workflow/main.nf +++ b/workflow/main.nf @@ -87,7 +87,11 @@ process checkDesignFile { """ hostname ulimit -a - python3 ${baseDir}/scripts/check_design.py -d ${designLocation} -f ${fastqList} + noSpaceDesign=\$(echo "${designLocation}" | tr -d ' ') + if [[ "\${noSpaceDesign}" != "${designLocation}" ]]; then + mv "${designLocation}" "\${noSpaceDesign}" + fi + python3 ${baseDir}/scripts/check_design.py -d \${noSpaceDesign} -f ${fastqList} """ } @@ -353,4 +357,4 @@ process multiqc { multiqc -c ${multiqcConf} . """ -} \ No newline at end of file +} diff --git a/workflow/scripts/check_design.py b/workflow/scripts/check_design.py index c5c679e58b2819e6fafb4f34e6181cdd62f8cdbd..4a4d84c80f74098e709817794218a29b7cec6b60 100755 --- a/workflow/scripts/check_design.py +++ b/workflow/scripts/check_design.py @@ -97,7 +97,7 @@ def main(): logger.addHandler(handler) # Read files as dataframes - design_df = pd.read_csv(args.design, sep=',') + design_df = pd.read_csv(args.design, sep=',', converters={'Sample': str.strip, 'fastq_R1': str.strip, 'fastq_R2': str.strip}) fastq_df = pd.read_csv(args.fastq, sep='\t', names=['name', 'path']) # Check design file @@ -107,4 +107,4 @@ def main(): new_design_df.to_csv('design.checked.csv', header=True, sep=',', index=False) if __name__ == '__main__': - main() \ No newline at end of file + main()