I have some software which takes fastas as the input. I need to include SNVs and InDels from a VCF into the reference hg38 and then use this.The problem is, I don't know of an algorithmically sound way to do this.Are there any existing software packages which could do this efficiently? Is it easier to output a FASTA, or a bam (and then convert to a FASTA)? What about if I wanted to do the same with a bedpe of germline structural variants? 
How to manipulate a reference FASTA or bam to include variants from a VCF?
bam;fasta;vcf;variants;reference genome
You could convert VCF to BED via vcf2bed --snvs, vcf2bed --insertions, and vcf2bed --deletions, and then use samtools faidx by way of a wrapper script to convert BED to FASTA, e.g.:$ vcf2bed --snvs < variants.vcf | bed2faidxsta.pl > snvs.fa$ vcf2bed --insertions < variants.vcf | bed2faidxsta.pl > insertions.fa$ vcf2bed --deletions < variants.vcf | bed2faidxsta.pl > deletions.faYou need FASTA files for your reference genome, which have been indexed with samtools faidx, e.g., for hg38:$ cd /foo/bar/baz$ wget ftp://hgdownload.cse.ucsc.edu/goldenPath/hg38/chromosomes/*.fa.gz$ for fn in `ls *.fa.gz`; do gunzip $fn; done$ for fn in `ls *.fa`; do samtools faidx $fn; doneOnce you have indexed FASTA files somewhere on your file system, you can pipe BED to the bed2faidxsta.pl script, to get out FASTA sequences.