This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Convert bcf to vcf and run snp2hla tool in windows subsytem for linux

i have 2 bcf files from chr 1 to chr 22 . I want to convert it to vcf and then use snp2hla tool to get the hla. I would like to use bcf tool for coversion. Is it possible through wsl for linux?

snp2hla vcf bcf

1 answer

when you run bcftools you get the choice of the output via the -O flag

-O, --output-type u|b|v|z[0-9] u/b: un/compressed BCF, v/z: un/compressed VCF, 0-9: compression level [v]

simply a

 bcftools view -O v input.bcf > output.vcf

should suffice

i convert the bcf to vcf by using:

for file in *.bcf; do
    bcftools view -O v -o "${file%.bcf}.vcf" "$file"
done

but I want to merge them all in one folder also I want to use snp2hla to get hla?

use bcftools merge in the next step to merge different samples, or bcftools concat to concatenate when the samples are the same

ok . how can I use snp2hla tool for impuation based on vcf files

different questions need to go into their separate threads to keep the concepts isolated and focused on on topic

this thread is about converting bcf to vcf, if that step is successful but now you have new questions you need to open a new thread specifically about those

Log in to answer this question.