########################################################################### # Sandrine Dudoit # # Demo script for marrayClasses package -- Classes and methods for cDNA microarray data # # mysource("marrayClasses.demo.R", echo=TRUE, ask=TRUE) ########################################################################### # Load all the marray packages library(marrayPlots) # Load the swirl dataset data(swirl) # Description of swirl dataset ? swirl ########################################################################### # Microarray classes ########################################################################### # marrayRaw class class(swirl) getClassDef("marrayRaw") slotNames("marrayRaw") slotNames(swirl) # Other microarray classes getClassDef("marrayLayout") getClassDef("marrayInfo") getClassDef("marrayNorm") getClassDef("marraySpots") getClassDef("marrayTwo") # See help files for greater details # ? marrayRaw ######################### # Access slots of formal classes # Using @ operator swirl@maLayout # Using slot function slot(swirl, "maLayout") ######################### # Creating instances of a class L<- new("marrayLayout") L L@maNspots<-100 L ########################################################################### # Microarray methods # Slot accessor methods L<-maLayout(swirl) L maNspots(L) maNspots(swirl) ######################### # Slot assignment methods L<-maLayout(swirl) maPlate(L) maPlate(L)<-maCompPlate(swirl,n=384) maPlate(L) tabulate(maPlate(L)) maPlate(swirl)<-maCompPlate(swirl,n=384) swirl ######################### # Printing methods # We've used them all along! swirl maLayout(swirl) maTargets(swirl) maGnames(swirl) ######################### # Subsetting methods swirl[1:100,2:3] L[1:100] ######################### # Coercing methods # From marrayRaw to marrayNorm swirl.norm<-as(swirl, "marrayNorm") swirl.norm # From marrayRaw to exprSet (see Biobase package) as(swirl, "exprSet") ######################### # Functions for computing layout parameters tabulate(maCompPlate(swirl,n=384)) tabulate(maPrintTip(swirl)) ######################### # All methods for marrayRaw class showMethods(classes="marrayRaw") # Print methods showMethods("print") # Accessor and assignment methods for maNgr slot showMethods("maNgr") showMethods("maNgr<-") ###########################################################################