Created
June 17, 2022 17:28
-
-
Save davidaknowles/2542292782b77dda9b2f6920a9c9a9a3 to your computer and use it in GitHub Desktop.
Make a dummy vcf with all SNPs being heterozygous for one individual. SOME_SAMPLE needs to be set to one of the sample names in the input.vcf.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
bcftools view -H input.vcf.gz | \ | |
awk '{print $1 "\t" $2 "\t" $3 "\t" $4 "\t" $5 "\t" $6 "\t" $7 "\t" $8 "\t" $9 "\t" "0/1"}' | \ | |
cat <(bcftools view -h -s SOME_SAMPLE input.vcf.gz) - | \ | |
bgzip > \ | |
output.vcf.gz | |
bcftools view -H output.vcf.gz | awk '{ print $1 "\t" $2 - 1 "\t" $2 }' | bgzip > output.bed.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment