brentp / vcfanno

annotate a VCF with other VCFs/BEDs/tabixed files
https://genomebiology.biomedcentral.com/articles/10.1186/s13059-016-0973-5
MIT License
357 stars 55 forks source link

Leading / added to filename from config file #97

Closed barrymoore closed 5 years ago

barrymoore commented 5 years ago

Looks like vcfanno is adding a '/' to the beginning of a file name (note the file is a symbolic link) that I provided in the conf file. When I point the conf to to absolute path everything works fine. Not sure if the issue is the symbolic link or the fact that I gave a relative path? I'm pretty sure that I've used relative paths successfully in the past, so maybe this is a symlink issue.

Conf file :

[[annotation]] file="gnomad.genomes.r2.0.2.sites.norm.vcf.gz" fields = ["AF"] ops=["self"] names=["gnomad_af"]

Command line and error message:

vcfanno -p 15 gnomad.conf my_data.vcf.gz

============================================= vcfanno version 0.2.9 [built with go1.10]

see: https://github.com/brentp/vcfanno

vcfanno.go:112: [Flatten] unable to open file: /gnomad.genomes.r2.0.2.sites.vcf.gz in

This conf file works (absolute path - no symlink):

[[annotation]] file="/scratch/ucgd/lustre/common/data/GnomAD/r2.0.2/gnomad.genomes.r2.0.2.sites.norm.vcf.gz" fields = ["AF"] ops=["self"] names=["gnomad_af"]

brentp commented 5 years ago

hmm. it should only adjust the path if it doesn't find it unaltered. I'll have a look at how symlinks are working.

brentp commented 5 years ago

maybe it is something with NFS as symlinks seems to work ok.

m-crown commented 2 years ago

Hi I am getting this same issue and it is not clear to me how this issue was solved when it was closed ?

brentp commented 2 years ago

Hi, the message is misleading, but this means that vcfanno is not able to find the file. If you use a relative path, it will be relative to the directory where you run vcfanno (not to the conf file). So you should be able to do ls -lh ${basepath}${file} from the directory where you run vcfanno and see the file.