Anatomy of .missnp Files in PLINK
This guide explains the structure of .missnp files, detailing why certain SNPs are flagged during dataset merging and how to resolve strand flips biologically and computationally using PLINK commands.Excellent โ now weโll do a complete anatomy of .missnp like a forensic lab.
Iโll explain:
-
EXACT types inside
.missnp -
For each type:
- what it really means biologically
- what
--flipdoes - whether it is legally rescuable
-
Why iterative merge โ new
.missnp(2)is the correct logic.
๐งช 1) What is .missnp in one sentence
.missnp= โSNPs for which PLINK could not prove compatibility between A and B.โ
It is NOT only strand problems โ it is a mixed crime scene.
๐งฌ 2) The 5 REAL categories inside missnp
TYPE 1 โ Simple strand flip (RESOLVABLE)
Example
Dataset A
rs100 A G
Dataset B
rs100 T C
These are complements:
A โ T
G โ C
Why in missnp?
Because --bmerge by itself does not auto-flip.
What --flip does
For every genotype at rs100:
| Before | After |
|---|---|
| AA | TT |
| AG | TC |
| GG | CC |
Now alleles become A/G โ match A.
LEGAL?
โ 100% legal No biological assumption.
TYPE 2 โ Ambiguous AT/CG (NOT RESOLVABLE)
Example
A:
rs200 A T
B:
rs200 T A
Why impossible?
If you flip B:
T/A โ A/T
โ looks identical again.
You cannot know:
- real orientation difference?
- or true opposite allele coding?
What --flip does
It flips but result still mismatches โ remains in missnp(2).
LEGAL?
โ Not safely resolvable without external manifest.
TYPE 3 โ True allele conflict (NOT RESOLVABLE)
Example
A:
rs300 A G
B:
rs300 A C
These represent:
- different mutation
- different build
- mis-annotation
- genotyping error.
Flip result
Flip B โ T/G Still not {A,G}.
LEGAL?
โ Must be removed.
TYPE 4 โ Multiallelic in one dataset
Example
B:
rs400 A G T
A:
rs400 A G
Why?
- sequencing called third allele
- conversion artifact.
Flip result
Still multiallelic โ unmergeable.
LEGAL?
โ Remove.
TYPE 5 โ Position/ID discordance
Same rsid but:
A:
chr1:1000
B:
chr1:1020
Flip cannot help
โ structural conflict.
LEGAL?
โ Remove.
๐ง 3) What --flip ACTUALLY does per type
| Type | After flip |
|---|---|
| Type1 resolvable | โ becomes compatible |
| Type2 AT/CG | โ still ambiguous |
| Type3 conflict | โ still conflict |
| Type4 multi | โ still multi |
| Type5 pos | โ unchanged |
So:
ONLY Type1 is rescued.
๐ 4) Why iterative merge is CORRECT
Your idea is exactly right.
Step A
merge โ missnp1
Step B
flip missnp1
merge again โ missnp2
Step C
exclude missnp2
This workflow:
- rescues Type1
- isolates Types 2โ5.
๐งฉ 5) Detailed walk-through example
Assume missnp1 contains:
rs1 โ type1
rs2 โ type2
rs3 โ type3
rs4 โ type1
rs5 โ type4
After:
plink --flip missnp1
Merge again
- rs1 โ fixed
- rs4 โ fixed
- rs2, rs3, rs5 โ still bad
missnp2 now contains:
rs2
rs3
rs5
These are the TRUE unresolvable set.
๐งพ 6) Legal philosophy
Allowed operations
- strand complement
- allele order swap
- removal of impossible sites.
Forbidden operations
- inventing allele to match A
- guessing AT/CG orientation
- forcing multiallelic โ biallelic.
๐งฎ 7) Visual genotype examples
Type1 person genotype
B before:
TC
After flip:
AG
Matches A โ real rescue.
Type2 person genotype
B before:
TA
After flip:
AT
Still indistinguishable โ unsafe.
Type3
B before:
AC
After flip:
TG
Never equals AG โ must die.
8) Answer to your question
โshould not we try to merge again to create another missnp(2) and then exclude those SNPs?โ
YES โ that is EXACTLY the correct and legal workflow.
Because:
- First missnp = mixture
- After flip โ separation
- Second missnp = genuinely unfixable.
๐งช 9) Final decision table
| missnp type | Flip? | Keep? |
|---|---|---|
| Complementary | YES | YES |
| AT/CG | NO | NO |
| Allele conflict | NO | NO |
| Multiallelic | NO | NO |
| Position clash | NO | NO |
๐ Bottom line
.missnp is NOT โstrand errors.โ
It is:
the set of SNPs where PLINK cannot establish a bijection between allele sets.
Only a subset can be legally salvaged.
If you want next, I can help you:
- parse PLINK log lines that reveal the exact reason
- classify your real missnp into the 5 types with a script.
Just paste 20 lines of your .missnp and matching .bim ๐