<p>Currently you have <strong>phred-scaled genotype likelihoods</strong> or <strong>PL</strong> values. Genotype likelihoods give the likelihood of observing the read data (i.e. the number of reads which map to either the ref or alt allele), given a particular underlying genotype (0/0, 0/1, 1/1 at a bi-allelic locus); <span class="math-container">$GL = p(G|D)$</span>. Phred scaling simply scales it like <span class="math-container">$PL = -10 * log(GL)$</span>. These are usually given by a genotype caller.</p>
<p><strong>Genotype probabilities</strong> are slightly different in that they are posterior probabilities that the genotype is correct, given either other genotypes from a population or trio and a prior distribution for the allele frequencies. Therefore, you can't trivially go from likelihoods to probabilities without accounting for this external information and the prior. As suggested by JRodrigoF, you should use something like <a href="https://gatk.broadinstitute.org/hc/en-us/articles/360036730531-CalculateGenotypePosteriors" rel="nofollow noreferrer">CalculateGenotypePosteriors</a> to do this, maybe including 1000 genomes allele counts.</p>

CC BY-SA 4.0
2022-09-24T19:31:36.613Z
2022-09-24T19:31:36.613Z
user438383
<p>I have a vcf info formatted in GT:PL.</p>
<p><code>chr22  49994037    .   G   A   345.64  PASS    AC=1;AF=0.500;AN=2;BaseQRankSum=-3.605;DP=35;ExcessHet=3.0103;FS=1.377;MLEAC=1;MLEAF=0.500;MQ=60.00;MQRankSum=0.000;QD=10.17;ReadPosRankSum=-0.035;SOR=0.392    GT:AD:DP:GQ:PL  0/1:20,14:34:99:353,0,588</code></p>
<p>I want to convert it into GT:GP. But I have to write a script for that. Is there any way to do it fast and simple?</p>
<p>Note:</p>
<p>GT:Genotype</p>
<p>PL: Phred-scaled Genotype Likelihoods</p>
<p>GP: Genotype Probabilities</p>
<p>check the link below for all the info tags</p>
<p><a href="https://samtools.github.io/hts-specs/VCFv4.2.pdf" rel="nofollow noreferrer">https://samtools.github.io/hts-specs/VCFv4.2.pdf</a></p>

CC BY-SA 4.0
2022-09-22T14:18:30.177Z
Seems like you may be confusing genotype probability and genotype likelihood? That's how you convert GL to PL, not GP to PL.
user438383
CC BY-SA 4.0
2022-09-22T16:08:15.103Z
I think I am right. GP limits to 0 to 1 probability. GL is genotype likelihoods comprised of comma-separated floating point log10-scaled likelihoods and PL is a Phred-scaled likelihood. So, the conversion formulae should be like this. Can u clarify what I have done wrong?
Shafayet Rahat
CC BY-SA 4.0
2022-09-22T16:11:07.577Z
It says ``PL : the phred-scaled genotype likelihoods``, not genotype probabilities. You said you want genotype probabilities, not genotype likelihoods. Why are you trying to convert PL to GP anyway? Genotype probabilities are usually posterior probabilities from imputation and genotype/phred-scaled likelihoods are what you get from variant callers.
user438383
CC BY-SA 4.0
2022-09-22T16:11:50.370Z
to compare my imputation accuracy with true genotype.
Shafayet Rahat
CC BY-SA 4.0
2022-09-22T16:14:06.427Z
So the line you shared is presumably the true genotype, since it doesn't look like it's been imputed? Either way, you want to use dosages for that, not genotype probabilities. Why do you want genotype probabilities?
user438383
CC BY-SA 4.0
2022-09-22T16:15:40.620Z
If u want to use IQS https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0009697#pone-0009697-t002 then u will need all the genotype probabilities. the r squared relation has some disadvantage in lower minor allele frequency
Shafayet Rahat
CC BY-SA 4.0
2022-09-22T16:20:46.340Z
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/139381/discussion-between-user438383-and-shafayet-rahat).
user438383
CC BY-SA 4.0
2022-09-23T11:20:14.923Z
Use this tool from GATK to obtain the posterior probabilities and then use bcftools to keep the only the FORMAT fields you want (e.g. GT:GP, ... )

 https://gatk.broadinstitute.org/hc/en-us/articles/360036730531-CalculateGenotypePosteriors
JRodrigoF
<vcf><format-conversion><conversion>
convert GT:PL format to GT:GP format
# convert GT:PL format to GT:GP format

(Asked by: username_0 on 2022-09-21)

I have a vcf info formatted in GT:PL.

`chr22 49994037 . G A 345.64 PASS AC=1;AF=0.500;AN=2;BaseQRankSum=-3.605;DP=35;ExcessHet=3.0103;FS=1.377;MLEAC=1;MLEAF=0.500;MQ=60.00;MQRankSum=0.000;QD=10.17;ReadPosRankSum=-0.035;SOR=0.392 GT:AD:DP:GQ:PL 0/1:20,14:34:99:353,0,588`

I want to convert it into GT:GP. But I have to write a script for that. Is there any way to do it fast and simple?

Note:

GT:Genotype

PL: Phred-scaled Genotype Likelihoods

GP: Genotype Probabilities

check the link below for all the info tags

<https://samtools.github.io/hts-specs/VCFv4.2.pdf>

**Tags:** vcf, format-conversion, conversion
> **Comments:**
> **username_1**: Seems like you may be confusing genotype probability and genotype likelihood? That's how you convert GL to PL, not GP to PL.  
> **username_0**: I think I am right. GP limits to 0 to 1 probability. GL is genotype likelihoods comprised of comma-separated floating point log10-scaled likelihoods and PL is a Phred-scaled likelihood. So, the conversion formulae should be like this. Can u clarify what I have done wrong?  
> **username_1**: It says ``PL : the phred-scaled genotype likelihoods``, not genotype probabilities. You said you want genotype probabilities, not genotype likelihoods. Why are you trying to convert PL to GP anyway? Genotype probabilities are usually posterior probabilities from imputation and genotype/phred-scaled likelihoods are what you get from variant callers.  
> **username_0**: to compare my imputation accuracy with true genotype.  
> **username_1**: So the line you shared is presumably the true genotype, since it doesn't look like it's been imputed? Either way, you want to use dosages for that, not genotype probabilities. Why do you want genotype probabilities?  
> **username_0**: If u want to use IQS https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0009697#pone-0009697-t002 then u will need all the genotype probabilities. the r squared relation has some disadvantage in lower minor allele frequency  
> **username_1**: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/139381/discussion-between-user438383-and-shafayet-rahat).  
> **username_2**: Use this tool from GATK to obtain the posterior probabilities and then use bcftools to keep the only the FORMAT fields you want (e.g. GT:GP, ... )   https://gatk.broadinstitute.org/hc/en-us/articles/360036730531-CalculateGenotypePosteriors  

---

## 1 answers

### Answer by username_1 on 2022-09-24. Score: 1 | Accepted answer

Currently you have **phred-scaled genotype likelihoods** or **PL** values. Genotype likelihoods give the likelihood of observing the read data (i.e. the number of reads which map to either the ref or alt allele), given a particular underlying genotype (0/0, 0/1, 1/1 at a bi-allelic locus); $GL = p(G|D)$. Phred scaling simply scales it like $PL = -10 \* log(GL)$. These are usually given by a genotype caller.

**Genotype probabilities** are slightly different in that they are posterior probabilities that the genotype is correct, given either other genotypes from a population or trio and a prior distribution for the allele frequencies. Therefore, you can't trivially go from likelihoods to probabilities without accounting for this external information and the prior. As suggested by JRodrigoF, you should use something like [CalculateGenotypePosteriors](https://gatk.broadinstitute.org/hc/en-us/articles/360036730531-CalculateGenotypePosteriors) to do this, maybe including 1000 genomes allele counts.


---

