setwd("C:/Users/kenrice/Desktop/SISG/SISG-14/exercises") source("http://bioconductor.org/biocLite.R") biocLite() # all the base packages ## ## Splots ## source("http://bioconductor.org/biocLite.R") biocLite("splots") library("splots") vignette(package="splots") vignette(topic="splotsHOWTO", package="splots") getwd() dir() # make sure ribogreen.rda is there! list.files(pattern="rda") load("ribogreen.rda") # restarts a saved R session ls() str(ribogreen) plotScreen(ribogreen) ## other options ?plotScreen ## show NAs more clearly plotScreen(ribogreen,na.fill="green") ## show problematic samples more clearly plotScreen(ribogreen, zrange=c(10,150),na.fill="green") ## ## Hexbin ## source("http://bioconductor.org/biocLite.R") biocLite("hexbin") # if you haven't already got this package library("hexbin") library("Biobase") # for the openVignette function openVignette("hexbin") #the vignette example, cut-and-pasted x <- rnorm(20000) y <- rnorm(20000) hbin <- hexbin(x, y, xbins = 40) plot(hbin, main="Made-up data, x and y are N(0,1)") #using hexbin on the niehs example niehs <- read.csv("http://faculty.washington.edu/kenrice/sisg/niehs.csv") #which columns are trt, ctrl? (or use Session 6 commands) trt <- grep("T", names(niehs)) ctrl <- grep("C", names(niehs)) means <- data.frame( trt.mean = rowMeans(niehs[, trt], na.rm=T), ctrl.mean = rowMeans(niehs[,ctrl], na.rm=T) ) hbin2 <- with(means, hexbin(y=trt.mean, x=ctrl.mean) ) plot(hbin2, main="NIEHS data") plot(hbin2, main="NIEHS data",style="centroids") plot(trt.mean~ctrl.mean, data=means) ## source("http://bioconductor.org/biocLite.R") biocLite("biomaRt") biocLite("GenomeGraphs") biocLite("annotate") biocLite("hgu95av2.db") biocLite("GO.db") library("annotate") library("hgu95av2.db") library("GO.db") vignette(package="annotate") vignette("GOusage") library(help="hgu95av2.db") help(package="hgu95av2.db") get("F5",hgu95av2ALIAS2PROBE) get("AGT", hgu95av2ALIAS2PROBE) get("35245_at",hgu95av2GO) get("GO:0007155",hgu95av2GO2PROBE) #biocLite("biomaRt") library("biomaRt") human = useMart("ensembl", dataset = "hsapiens_gene_ensembl") mouse = useMart("ensembl", dataset = "mmusculus_gene_ensembl") listAttributes(human) getBM(attributes="go_id",filters="hgnc_symbol", values="F5",mart=human) listFilters(human) getBM(attributes="hgnc_symbol", filters="go_id",values="GO:0007155",mart=human) ### 4. #biocLite("GenomeGraphs") library("GenomeGraphs") help(package="GenomeGraphs") gene <- makeGene(id = "AGT", type = "hgnc_symbol", biomart = human) transcript<-makeTranscript(id="AGT",type="hgnc_symbol", biomart=human) ideogram <- makeIdeogram(chromosome ="1") gdPlot(list(ideogram,gene)) gdPlot(list(ideogram,gene,transcript)) minbase<-230000000 maxbase<-231000000 genesplus <- makeGeneRegion(start = minbase, end = maxbase, strand = "+", chromosome = "1", biomart = human) genesminus <- makeGeneRegion(start = minbase, end = maxbase, strand = "-", chromosome = "1", biomart = human) genomeAxis <- makeGenomeAxis(add53 = TRUE, add35 = TRUE) gdPlot(list(ideogram,genesplus,genomeAxis,genesminus,gene)) ### getBM(attributes=c("chromosome_name","start_position","end_position"),filters="mgi_symbol",values="Cxcl5",mart=mouse) horse = useMart("ensembl", dataset = "ecaballus_gene_ensembl") listFilters(horse) getBM("GYS1", filters="wikigene_name", attributes="chromosome_name",mart=horse) stckl = useMart("ensembl", dataset = "gaculeatus_gene_ensembl") listFilters(stckl)