Kevin thanks I was experimenting with the following since I already pursued most of the approaches you mentioned and, in practice, they are either leading to corrupted outputs or generating some form of bias.
Anyway, I attempted something similar to this
Use bcftools merge --merge all, but first normalize contig names (e.g., remove _hap suffixes) to align chromosomes. Watch for overlapping positions—run bcftools norm -m+any afterward to handle multi-allelic sites.
but instead of -m+any I used -m-any. For some reason, I'm now incurring in the following error prior to the step of bcftools merge:
The REF prefixes differ: CCCAA vs A (5,1)
Failed to merge alleles at chr1:3870 in clone0_prt-output-split-hap2.vcf.gz
since the hap1 has been aligned and called against the haplotype 1 of this genome, which is causing the problem above when attempting to merge while using different references.
Is there a way to fix it? I was looking into bcftools norm -f [FASTA1] [VCF1] > [VCF1_norm] and bcftools norm -f [FASTA2] [VCF2] > [VCF2_norm] to left-align indels before merging, but the error persists...
Another option would be to call variants (rerunning DV) for haplotype 2 using haplotype 1 as reference – if DV doesn't complain about potential discrepancies between the BAM and the reference – to get, ultimately, the same set of coordinates before merging.
Let me know, thanks again for the constructive advices!
It sounds like you are calling variants with respect to a "phased assembly" (e.g. a diploid assembly has both a maternal and paternal haploid genome assembly). are you aligning the sample against itself e.g. the reads used to create the assembly are aligned against the assembly itself?
@cmdcolin indeed, you're correct! We do have a parental cell line which was used to build the two phased assemblies with
Verkko, then this same cell line has been exposed to different conditions and de novo sequenced.By aligning the reads used to assemble the two haplotypes as well as those exposed to different experimental conditions, we are looking to better understand mutational patterns taking advantage of the ground truth in our two assemblies.
that is quite a cool experiment. I am not actually sure of the best approach (sorry to disappoint). I think that if you look up "phased assembly variant calling" there are some discussions like in Variant calling analysis on phased assembly
I think that aligning to a graph that is composed of both phased assemblies is, at least theoretically, pretty ideal. the other solutions like you describe above seem to be a bit more complex...you have to consider whether the aligner would understand having extremely similar sequences if you align reads to the concatenation of both the maternal and paternal haplotypes....or you would have to consider the penalties involved for the aligner to align to both the maternal and paternal haplotype separately, which would implicitly align e.g. maternal reads to the paternal haplotype, and vice versa. So, tricky problem!