Home > Agriculture, Funny science, R > More on polled

More on polled

iris.I’ve collected so far 23 answers to my little survey (by the way, a great “thank you” to all of you who answered). Just to remind to those of you who haven’t bet yet, why being polled and red carrier could be of interest for a breeder, here comes some R code. First you ‘ll have to download French’s holsteinĀ  gEBV here. Then start R in a terminal.

#Find file name (I suppose the file is unique and in the directory)
File=dir(pattern="export_genomiques_")

#read=file=========================================
gEBV=read.csv(file=File,header=TRUE,sep=";",skip=1)

#Polled genotype===================================
#create a vector of status "pp=>Normal,Pp=>heterozygous polled,PP=>Homozygous polled"
PO=rep("pp",dim(gEBV)[1])
#Identify heterozygous polled with grep applied to the name of the sire
PO[gEBV$NOTAUR[grep(" P | P$",gEBV$NOTAUR,perl=TRUE)]]="Pp"
#Identify homozygous polled
PO[gEBV$NOTAUR[grep(" PP | PP$",gEBV$NOTAUR,perl=TRUE)]]="PP"
#Draw a boxplot
boxplot(gEBV$X0 ~ PO ,col="blue")
#Add the Number of observation
for(i in 1:3){text(i,0.95*max(gEBV$X0),paste("N= ",table(PO)[i]))}

#=Now the Red factor================================
RF=rep("rr",dim(gEBV)[1])
RF[gEBV$NOTAUR[grep(" RF | RF$",gEBV$NOTAUR,perl=TRUE)]]="Rr"
RF[gEBV$NOTAUR[grep(" RED | RED$",gEBV$NOTAUR,perl=TRUE)]]="RR"
#Draw a boxplot
boxplot(gEBV$X0 ~ RF ,col="red")
#Add the Number of observation
for(i in 1:dim(table(RF))){text(i,0.95*max(gEBV$X0),paste("N= ",table(RF)[i]))}

So for a given genotype, chances to be in the “Elite” will vary a lot. Iris and her brother have pedigree (gEBV) of 155. Their parents reliability is .7.

mu=155 ; VarG=25 ; Rel=0.25*(0.7+0.7)
sigma=sqrt(1-Rel)*VarG
#Boxplot of gEBV depending on genotypes (in the actual sire population)
boxplot(gEBV$X0 ~ RF + PO ,col="grey",main="gEBV according to genotype")
#Add E(EBV) and trace a 90IC area
abline(h=155,col="green")
polygon(x=c(0,0,10,10),y=c(155-(1.96*sigma),155+(1.96*sigma),155+(1.96*sigma),155-(1.96*sigma)),col=rgb(0,0.8,0.1,0.1))

bpSo, we can clearly see that for Iris and her brother their career will mostly depend on the fact that they are red and polled carriers !

Advertisements
Categories: Agriculture, Funny science, R
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: