Entering edit mode
4.1 years ago
storm1907
▴
30
Hi,
I need to convert vcf to fasta and after make multifasta file. However I am stuck in getting empty output files with this script
I would like to ask for a help
#!bin/bash
for file in $inpath/*.filtered ;
do
echo $file
bname=$(basename $file)
echo "base name is $bname"
bfile=$outpath1/$bname".gz"
outfile=$outpath/$bname".fasta"
bgzip -c $file > $bfile
bcftools index $bfile
samtools faidx $reference | bcftools consensus -s $bfile -o $outfile
done
What kind of file is $bfile? a compressed vcf? Doesn't bcf consensus need to be told what the fasta reference is?
bfile is a compressed vcf. I wrote syntax like samtools faidx $reference NC_045512.2:1-29903 but still nothing