File:Genotype phenotype regression.svg

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

Original file(SVG file, nominally 360 × 360 pixels, file size: 378 KB)

Summary

Description
English: Illustration of an association between phenotype and genotype. Data is simulated, actual associations detected in GWAS are usually much smaller. Fitted regression line shown in red and actual phenotype means for each genotype are shown in blue crosses.
Date
Source Own work
Author D Wells
SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with R.
 
The file size of this SVG plot may be irrationally large because its text has been converted to paths inhibiting translations.
Source code
InfoField

R code

library(ggplot2)
set.seed(5678)
n = 1000
allele_freq = 0.3
genotypes = rbinom(n, size = 2, p = allele_freq) # assuming HWE
mean_phenotype = function(genotype) 0.1 + 0.3 * genotype
phenotypes = rnorm(n, mean_phenotype(genotypes))

svg("genotype_phenotype_regression.svg", width=4, height=4)
ggplot(data.frame(phenotypes, genotypes), aes(genotypes, phenotypes)) +
  geom_jitter(alpha=0.2, width=0.3) +
  geom_smooth(method="lm", colour="red3", fullrange=T, se=F) +
  stat_summary(fun = mean,  geom="point", shape="+", size=7, colour="blue3") +
  scale_x_continuous(breaks=c(0, 1, 2), labels=c("0 (CC)","1 (CT)","2 (TT)"), limits=c(-1,3)) +
  coord_cartesian(xlim=c(-0.5, 2.5))+
  theme_classic() +
  xlab("Number of T alleles") + ylab("Phenotype")
dev.off()

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

Captions

Illustration of a hypothetical genotype by phenotype regression.

Items portrayed in this file

depicts

5 October 2021

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current22:58, 5 October 2021Thumbnail for version as of 22:58, 5 October 2021360 × 360 (378 KB)D WellsUploaded own work with UploadWizard
The following pages on the English Wikipedia use this file (pages on other projects are not listed):

Metadata