Hello all!
I work with cattle genome. I am trying to update INFO of my vcf files by using +fill-tag. It works with one file, but it does not work in the loop.
module unload bcftools
bcftools +fill-tags file.vcf -Oz -o file.vcf_ok.gz -- -t AF,AN,AC, AC_Hom,AC_Het,MAF,NS
When I want to work my loop script in the slurm job. I used this:
module unload bcftools
for file in ./*.vcf; do bcftools +fill-tags $file -Oz ${file%.*}.tagged_vcf.gz -- -t AF,AN,AC,AC_Hom,AC_Het,MAF,NS ; done
But it gave me this error message:
About: Set INFO tags AF, AC, AC_Hemi, AC_Hom, AC_Het, AN, ExcHet, HWE, MAF, NS.
Usage: bcftools +fill-tags [General Options] -- [Plugin Options]
Options:
run "bcftools plugin" for a list of common options
Plugin options:
-d, --drop-missing do not count half-missing genotypes "./1" as hemizygous
-l, --list-tags list available tags with description
-t, --tags LIST list of output tags. By default, all tags are filled.
-S, --samples-file FILE list of samples (first column) and comma-separated list of populations (second column)
Example:
bcftools +fill-tags in.bcf -Ob -o out.bcf
bcftools +fill-tags in.bcf -Ob -o out.bcf -- -t AN,AC
bcftools +fill-tags in.bcf -Ob -o out.bcf -- -d
bcftools +fill-tags in.bcf -Ob -o out.bcf -- -S sample-group.txt -t HWE
I do not know how to fix this issue. Any help will be welcomed!
What happens if you add quotes around
$file
likeNothing changed! Same error output.
Why are you unloading
bcftools
module in your code? Do you want to use an older/newer version ofbcftools
that is present elsewhere and is in your default$PATH
?I am currently using 1.9 version. The hpc has also older versions
Examples for
bcftools +fill-tags
showbcf
format files as well as an output file name. Take a look atbcftools +fill-tags -h
Shall I keep it?
module unload bcftools
By
unloading
the module we have no idea which version you are using. Normally peopleload
a module they want to use before running some code.It sounds like you are using your own version of bcftools. I don't know it is just the HPC or Slurm itself but if you type in
module unload
it will look like a module is being unloaded even if there wasn't one already loaded. Could you usewhich bcftools
? You might be able to see the path to where bcftools is installed. What will at least tell you if you're using your own version or the version your HPC probably has in some shared directoryI was working on Conda. I tried it by deactivating conda. As John mentioned in the comment, I also missed -o option in the loop. I have also included the BCFTOOLS_PLUGINS plugin environment to my slurm script.