This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Plotting genotype frequency distribution

Hi All,

I am planning to detect possible strand issues by checking genotype frequencies against population allele frequencies. for this, I am using Plugin af-dist from BCFtools.

I am following all the steps as mentioned in manual HERE. But, I am not able to plot The genotype frequency distribution, in this case, the data is

PROB_DIST   0.000000    0.100000    100618
PROB_DIST   0.100000    0.200000    144103
PROB_DIST   0.200000    0.300000    214923
PROB_DIST   0.300000    0.400000    320721
PROB_DIST   0.400000    0.500000    817965
PROB_DIST   0.500000    0.600000    84027
PROB_DIST   0.600000    0.700000    86531
PROB_DIST   0.700000    0.800000    97986
PROB_DIST   0.800000    0.900000    108776
PROB_DIST   0.900000    1.000000    176755

please help me in plotting this, I am looking to plot something like This

Thanks a lot for your help

Have a great day,

Dave!

af-dist plot distribution

Please provide headers to your columns for others to understand

1 answer

Dave, this should give you a good start:

plot(test[,2], type="l", xlab="Genotype Probability (HWE)", ylab="Frequency", lwd=3, col="orange")
lines(test[,3], type="l", lwd=2.5, col="skyblue")
legend("bottomright", bty="n", c("incorrect strand","correct strand"), fill=c("orange","skyblue"))

f

If you want to add extra axes a ticks, then just use something like:

axis(side=4, labels=FALSE)

You can take a look at these functions to see all other available options.

Kevin

Log in to answer this question.