Open sielerjm opened 2 years ago
Similar error in dada2_finish.R
at line 415.
### Building phylogenetic tree...
sh: -c: line 0: syntax error near unexpected token `2'
sh: -c: line 0: `export OMP_NUM_THREADS=9; /Users/michaelsieler/Dropbox/Mac (2)/Documents/Sharpton_Lab/Bioinformatics_files/Symlinks/FastTree -nt -nosupport -quote -gtr -gamma -log dada2_1.26.0_2022-11-15_output/fasttree.log dada2_1.26.0_2022-11-15_output/asv_and_guide_seqs.align > dada2_1.26.0_2022-11-15_output/asv_and_guide_seqs.nwk'
fasttree.path, " -nt -nosupport -quote -gtr -gamma -log ",
paste0("'", fasttree.path, "'"), " -nt -nosupport -quote -gtr -gamma -log ",
Background:
I'm running this script locally and ran into an issue where the absolute path name to my fastq files contains a space and consequently causes the
symlink_fastqs.R
to fail when parsing the path name to run commands on the command line usingsystem()
.Error Message
Error
The line of code where this error occurs is at line 117 in the
symlink_fastqs.R
function.cmd1 <- paste("ln -s", read1.file, lnName.r1)
Proposed solution
Change:
cmd1 <- paste("ln -s", read1.file, lnName.r1)
to:cmd1 <- paste("ln -s", paste0("'", read1.file, "'"), lnName.r1)
Adding
paste0("'", read1.file, "'")
wraps single quotes around the absolute path names.Lines needing changed