Last active
December 28, 2015 23:39
-
-
Save DannyArends/7580930 to your computer and use it in GitHub Desktop.
Code for the presentation I gave at the Humboldt-Universität in Berlin on 21-11-2013
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library("qtl") # Load the library | |
| data(multitrait) # Load the data | |
| multitrait # Show the library | |
| pull.pheno(multitrait, pheno.col = 1) # Shows the phenotype values of phenotype 1 | |
| hist(pull.pheno(multitrait, pheno.col = 1)) # Create a histogram | |
| # Plot a map versus the other ones | |
| plot.map(multitrait, est.map(multitrait)) | |
| # Create a histogram using more breaks, add a red line for the cut-off | |
| hist(pull.pheno(multitrait, pheno.col = 1), breaks=100) | |
| abline(v=750, col='red', lty=2, lwd=3) | |
| # Calculate genotype probabilities | |
| multitrait <- calc.genoprob(multitrait) | |
| # Scan using the non parametric model | |
| npres <- scanone(multitrait, model="np", pheno.col=1) | |
| # Transform out values in a binary phenotype | |
| multitrait$pheno[,1] <- as.numeric(multitrait$pheno[,1] > 750) | |
| # Show the differences between binary and non parametric | |
| plot(scanone(multitrait, model="binary", pheno.col=1), npres, col=c("black", "blue")) | |
| # Reload the data, to undo the transformation of phenotype 1 | |
| data(multitrait) | |
| # Show where the difference comes from | |
| effectplot(multitrait,mname1="GA1",mname2="GH.117C") | |
| # Permutation of the first phenotype | |
| permutationResults <- scanone(multitrait, n.perm=1000) | |
| # Map all traits | |
| res <- scanone(multitrait, model="np", pheno.col=1:24) | |
| # Create a heatmap | |
| image(1:117, 1:24, as.matrix(res[,3:26]), breaks =c(0,3,5,10,1000), col=c("white","lightgray","lightblue","black"),xlab="Marker", ylab="Metabolite") | |
| box();grid() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment