snippy
snippy copied to clipboard
`--targets` option only works if absolute path is given
When trying to run snippy with calls to target sites of interest (in the form of a bed file), the freebayes-parallel part of the pipeline only works if the absolute path to the bed file is provide as the argument to the --targets
option, otherwise snippy creates the path to the bedfile as a subfile within the specified --outdir
.
For example,
snippy --targets my_sites.bed --outdir SAMPLE1 --R1 r1.fq --R2 r2.fq --ref myref.fa
Will create a freebayes command line with the following --targets
specification:
--targets '/path/to/where/snippy/was/run/SAMPLE1/my_sites.bed
whereas the correct specification should be:
--targets '/path/to/where/snippy/was/run/my_sites.bed
I'm not a perl hacker, but the problem seems to be this line in the snippy
source:
$fbopt .= sprintf " --targets '%s'", abs_path($targets) if $targets;
I think the fix is for abs_path
to be called before changing to outdir
.
A temporary work around is for the user or calling script to call snippy with the full path to the target bedfile.
@pmagwene you claim not to be a hacker but you have found both the source of the error and the fix for it :)
Very few people use that option it seems! I've never used it - it was a user request.
Thank you - will fix in next release.
@tseemann Well, not a perl hacker, but I've been programming in Python (and C++ before that!) since the late 90s. ;) Would have tried to submit a pull request but didn't trust myself not to write non-idiomatic perl code. Thanks for the quick fix!
I have this problem too, thanks.