slt666666 / NLRtracker

NLR annotation tool
MIT License
23 stars 4 forks source link

NLRtracker.R - `outdir` prepended twice to name of `..._NLRtracker.tsv`, cannot open file #19

Open kmlhpk opened 7 months ago

kmlhpk commented 7 months ago

In the source code of NLRtracker.R it appears that outdir, which is the -o flag to NLRtracker.sh, is prepended twice to _NLRtracker.tsv:

write.table(paste0(outdir, "/", outdir, "_NLRtracker.tsv"), sep="\t", row.names = FALSE, col.names = TRUE, na = "", quote=FALSE)

However, when -o is a filepath, like /opt/software/test-nlrt this causes issues:

In file(file, ifelse(append, "a", "w")):
    cannot open file '/opt/software/test-nlrt//opt/software/test-nlrt_NLRtracker.tsv': No such file or directory

I would suggest implementing either some string manipulation to remove most of the filepath, or simply not bothering with prepending the name of the output directory to the output file itself, which already lives in the output directory.

slt666666 commented 7 months ago

Hi, thank you for your comments, I modified output file path in NLRtracker.R to be simpler.