Entering edit mode
4 months ago
giulia.trauzzi
▴
30
Hi everyone,
I am trying to remove duplicated SNPs from my pgen dataset. These duplicated SNPs are the result of splitting multiallelic loci but now I just want to retain only the genotype that has higher maf, the most common. Is there a way to do this with Plink2? Considering that the most common genotype is not always the first instance in the data so I cannot use the --rm-dup first etc... Is there a way I can do this?
Many thanks.
Giulia
Since the MAF values are different, is it possible to filter your result based on MAF first? And then see whether the duplicates are still there or not.
Hi! That is exactly what I ended up doing. I filtered based on MAF and was left with a bunch of multiallelic SNPs... for some of them the first occurrence was the allele with lower AF and for some it wasn't, but in the end, I had like 8 multiallelic SNPs left in the data compared to the 60000 of the dataset so I just used rm-dup as is.
Thanks!
Python script to process the frequency file:
Create the final filtered dataset
I generated this answer using amplicon.ai, a tool I've been building to make writing biofinformatics code easier. Feel free to try it out
Hi, this is actually pretty cool and useful! Thanks for posting this. I did not use this for my preliminary analyses but I will definitely look this up in the future. Many thanks!
I would combine this with logic to generate a new .pvar, with MAFs included in the variant IDs. --extract cannot distinguish between two variants with identical IDs.