Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Generate Haplotype 1 and 2 FASTA Files Using Phased VCF from HiPhase #2310

Open
ClarenceHsiang opened this issue Oct 24, 2024 · 1 comment

Comments

@ClarenceHsiang
Copy link

ClarenceHsiang commented Oct 24, 2024

Dear bcftools :
I attempted to use bcftools to generate haplotype sequences using the phased.vcf (from HiPhase), but the process was unsuccessful. Are there alternative solutions available? Below is the code I used:
bcftools consensus -f reference_genome.fasta -H 1 output_phased_variants.vcf.gz > haplotype1.fasta
bcftools consensus -f reference_genome.fasta -H 2 output_phased_variants.vcf.gz > haplotype2.fasta

The error information as below, May you give me some suggestion and help?


[Clarence]$ /data/share/tools/bcftools-1.9/bcftools consensus -f 221021hap1_assembly.fa -H 1 hap1.out_phased.vcf.gz > hap1_phased_haplotype1.fasta
The site Chr1_1:4195225 overlaps with another variant, skipping...
The site Chr1_1:4201421 overlaps with another variant, skipping...
The site Chr1_1:4202106 overlaps with another variant, skipping...
The site Chr1_1:28824762 overlaps with another variant, skipping...
The site Chr1_1:30388601 overlaps with another variant, skipping...
The fasta sequence does not match the REF allele at Chr2_1:28577524:
.vcf: [A]
.vcf: [ATATTATTTTACTATGCAAATG] <- (ALT)
.fa: [G]TATTATTTGCAAACGTATAGCCGGGCGGCTATACTGTTTAAATGCGGCGGTACTATAACACTTTATAAACACACCCAAAACCCATCATTACACACACTCAAAACTCATTTATAAACACACCCAAAAAGTTGACTTTAGGGTTAATTTTGGGTGTGTTTCTATGTTTAAATAGTGCTTGGGTTTTTTTATAAATACATGTCTAGGATTGGGTTTATTTATAAATTTGTATTAAATCTATTCTTTTTAAACGTACAACCGCGCGGCTATAATATTTACAACGATGATAAAGGGTTTCTTTTTGTCATCATCCTCAGCCATGAGTTCTGTCATAGACACTCTATTTACTTAAGTTTACAATGTAAATAAGGAAGTATCCCCTATTTGGATTCAAATAAAAATGCTAGAAAATCAAATTCCCACCAAATCAAAATATAAAAAATCGGTTTTAGTGCAAAATACGATTTAGGCTAAAAATGATGGCTCATTAAGTCAATATATACTTTATACTAAAATTCCATAAAATCAAGTTTTCTTATTTGATGTGTAAAGAATAAAAGCCGCCAAAAATTATCTTGAGAAAATGATTATTTTGACAAACCATTTTTCATACTTAGTCAATATTTTTATATAAAATATTTTTTTCATGTATGATATGAATGCATGAAGGGACCTAAGGTTTTTTTTAGTTTGTGAAATTTTGATTTTTTTTCTTTCTATTGGGTTTAATAGGGGAAAAGGCTTTAAAGATATTTGCTAAATCGCTACTCTTTGTCTATCTCTTACAATTTTTCTTGCTTAAAATGTATTTGTCTATCTATTTGTCGAGGACAATTATGATTGCAACCAATAAGCAATAAATTCTTGACATATGTGATATATATATATATATACTATTTTTCGTATGTATTGTGAGTTCGAACTTTTGATTCTTTATAATTTATAAGAGGCCCCCACACACATGAAATCATGACTTCGCCATTGGTTCTGTTAATGGGGTTTTGTAAGATTCAGTTTA

Sincerely,

Clarence

@pd3
Copy link
Member

pd3 commented Oct 31, 2024

You are using a very old version of bcftools, we are at 1.21 now.

If the problem persists, the error message indicates that the allele in the REF column does not match the corresponding base in the fasta reference file. So possibly a reference build mismatch, the fasta file does not correspond to the VCF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants