SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Downloaden Sie, um offline zu lesen
Why	re-use	core	classes?
A	plea	to	developers	of	Bioconductor	packages
Levi	Waldron
Oct	16,	2017
What	is	Bioconductor?
1,400	packages	on	a	backbone	of	data	structures
The	Genomic	Ranges	algebra
Huber,	W.	et	al. Orchestrating	high-throughput	genomic	analysis	with	
Bioconductor.	Nat.	Methods 12, 115–121	(2015).
The	integrative	data	container	SummarizedExperiment
Why	do	core	classes	matter	to	developers?
Let’s	say	you	have	a	great	idea	for	an	improved	bicycle
New	rocket-powered	bikeraw	steel forge	frame
What	could	possibly	go	wrong?
Why	do	core	classes	matter	to	developers?
• What	could	possibly	go	wrong?
– Your	frame	has	limited	testing
– Your	frame	lacks	features	you	never	even	thought	of
Ouch!
Little	eyelets	allows	users	to	install	a	rack	and	fenders
Why	do	core	classes	matter	to	developers?
It’s	easy to	define	a	new	S4	class	in	R
> setClass("BicycleFrame",
representation(height = "numeric", color = "character"))
> my.new.frame <- new("BicycleFrame", height = 31, color = "red")
> my.new.frame
An object of class "BicycleFrame"
Slot "height":
[1] 31
Slot "color":
[1] "red”
> However,	it’s	very	difficult	to	define	a
robust	and	flexible data	class	for	genomic	data	analysis
Why	do	core	classes	matter	to	developers?
setClass(Class="phyloseq",
representation=representation(
otu_table="otu_tableOrNULL",
tax_table="taxonomyTableOrNULL",
sam_data="sample_dataOrNULL",
phy_tree="phyloOrNULL",
refseq = "XStringSetOrNULL")
)
From	phyloseq Bioconductor	package
Does	not	contain	any	base	class
It	is	a	list	with	elements	of	defined	class
Why	do	core	classes	matter	to	developers?
setClass("MRexperiment", contains=c("eSet"),
representation=representation(
expSummary = "environment"))
)
From	the	metagenomeSeq Bioconductor	package
Contains	the	eSet base	virtual	class
(since	outdated	by	SummarizedExperiment)
Load a metagenomeSeq class object
This loads an example object and demonstrates that it uses the
default show method defined for eSet. A custom show method
could be defined if desired.
suppressPackageStartupMessages(library(metagenomeSeq))
data(lungData)
lungData
## MRexperiment (storageMode: environment)
## assayData: 51891 features, 78 samples
## element names: counts
## protocolData: none
## phenoData
## sampleNames: CHK_6467_E3B11_BRONCH2_PREWASH_V1V2
## CHK_6467_E3B11_OW_V1V2 ... CHK_6467_E3B09_BAL_A_V1V2 (78
## total)
## varLabels: SampleType SiteSampled SmokingStatus
## varMetadata: labelDescription
## featureData
## featureNames: 1 2 ... 51891 (51891 total)
## fvarLabels: taxa
## fvarMetadata: labelDescription
## experimentData: use 'experimentData(object)'
## pubMedIds: 21680950
## Annotation:
Load a phyloseq class object
Do the same for a phyloseq class example data object, and
demonstrate its custom show method:
suppressPackageStartupMessages(library(phyloseq))
data(GlobalPatterns)
GlobalPatterns
## phyloseq-class experiment-level object
## otu_table() OTU Table: [ 19216 taxa and 26 samples ]
## sample_data() Sample Data: [ 26 samples by 7 sample variables ]
## tax_table() Taxonomy Table: [ 19216 taxa by 7 taxonomic ranks ]
## phy_tree() Phylogenetic Tree: [ 19216 tips and 19215 internal nodes ]
Inheritance of core methods: example 1
Since metagenomeSeq contains eSet, it automatically inherits core
methods like dim(). These would have to be defined separately for
the phyloseq class since it does not extend a core class.
dim(lungData)
## Features Samples
## 51891 78
dim(GlobalPatterns)
## NULL
Note that neither the phyloseq or the metagenomeSeq package
defines a dim() method, but metagenomeSeq got it for free by
extending eSet.
Inheritance of core methods: example 2
For core Bioconductor objects, $ generally accessess the sample
data, but for phyloseq objects the sample data must be explicitly
extracted first:
head(lungData$SampleType)
## CHK_6467_E3B11_BRONCH2_PREWASH_V1V2 CHK_6467_E3B11_OW_V1V2
## Bronch2.PreWash OW
## CHK_6467_E3B08_OW_V1V2 CHK_6467_E3B07_BAL_A_V1V2
## OW BAL.A
## CHK_6467_E3B11_BAL_A_V1V2 CHK_6467_E3B09_OP_V1V2
## BAL.A OP.Swab
## 12 Levels: BAL.1stReturn BAL.A BAL.B Bronch1.PostWash ... PSB
head(sample_data(GlobalPatterns)$SampleType)
## [1] Soil Soil Soil Feces Feces Skin
## 9 Levels: Feces Freshwater Freshwater (creek) Mock ... Tongue
Inheritance of core methods: example 2
subset(), [, and head() are core methods
they are defined for eSet and other core classes, so these
familiar operations work “out of the box”:
subset(lungData, lungData$SampleType=="OW")
lungData[, lungData$SampleType=="OW"]
lungData[, 1:5]
head(lungData)
Inheritance of core methods: example 2
phyloseq cannot use these, so a custom subset_samples()
method is defined instead:
subset_samples(GlobalPatterns, SampleType=="Ocean")
But square bracket subsetting, subset(), and head() are not
defined for phyloseq objects, and have no parent class to inherit
them from.
GlobalPatterns[, 1:5]
## Error in GlobalPatterns[, 1:5]: object of type 'S4' is not subsettable
subset(GlobalPatterns, 1:5)
## Error in subset.default(GlobalPatterns, 1:5): 'subset' must be logical
Relevance to multi-omics data analysis
The MultiAssayExperiment core class allows coordinated
representation and management of an open-ended set of assays,
as long as their data class provides basic methods:
dimnames()
[ subsetting
dim()
and preferably assay()
MultiAssayExperiment data management is modeled on
SummarizedExperiment but allows for multiple assays of
different row and column dimensions.
Relevance to multi-omics data analysis (cont’d)
With no special accommodations, the lungData object “just works”
in a MultiAssayExperiment:
suppressPackageStartupMessages(library(MultiAssayExperiment))
MultiAssayExperiment(list(lung=lungData))
## A MultiAssayExperiment object of 1 listed
## experiment with a user-defined name and respective class.
## Containing an ExperimentList class object of length 1:
## [1] lung: MRexperiment with 51891 rows and 78 columns
## Features:
## experiments() - obtain the ExperimentList instance
## colData() - the primary/phenotype DataFrame
## sampleMap() - the sample availability DataFrame
## `$`, `[`, `[[` - extract colData columns, subset, or experiment
## *Format() - convert into a long or wide DataFrame
## assays() - convert ExperimentList to a SimpleList of matrices
But GlobalPattern does not, because it is not derived from a core class:
MultiAssayExperiment(list(global=GlobalPatterns))
## Error in if (dim(object)[2] > 0 && is.null(colnames(object))) {: missing value where TRUE/FALSE needed
Inheritance of core methods
These are not isolated examples.Full-time, professional software
developers have developed many methods for core classes.
Classes containing core classes get all of these for free,
providing future advantages that you can not possibly imagine
in advance.
For example, SummarizedExperiment has more than 100
methods defined!
Inheritance of core methods (cont’d)
suppressPackageStartupMessages(library(SummarizedExperiment))
methods(class="SummarizedExperiment")
## [1] != [ [[ [[<- [<-
## [6] %in% < <= == >
## [11] >= $ $<- aggregate anyNA
## [16] append as.character as.complex as.data.frame as.env
## [21] as.integer as.list as.logical as.matrix as.numeric
## [26] as.raw assay assay<- assayNames assayNames<-
## [31] assays assays<- by cbind coerce
## [36] coerce<- colData colData<- countOverlaps dim
## [41] dimnames dimnames<- duplicated elementMetadata elementMetadata<-
## [46] eval expand expand.grid extractROWS findOverlaps
## [51] head intersect is.na length lengths
## [56] match mcols mcols<- merge metadata
## [61] metadata<- mstack names names<- NROW
## [66] overlapsAny parallelSlotNames pcompare rank rbind
## [71] realize relist rename rep rep.int
## [76] replaceROWS rev rowData rowData<- ROWNAMES
## [81] rowRanges<- seqlevelsInUse setdiff setequal shiftApply
## [86] show sort split split<- subset
## [91] subsetByOverlaps table tail tapply transform
## [96] union unique updateObject values values<-
## [101] window window<- with xtabs
## see '?methods' for accessing help and source code
SummarizedExperiment also provides great functionality like
out-of-the-box compatibility with on-disk data representation.
USE AND DERIVE FROM THESE CLASSES!
What	are	the	“core”	classes?
• Rectangular	feature	x	sample	data	(RNAseq count	matrix,	microarray,	…)
– SummarizedExperiment::SummarizedExperiment()
• Genomic	coordinates	(1-based,	closed	interval)
– GenomicRanges::GRanges()
• DNA	/	RNA	/	AA	sequences
– Biostrings::*Stringset()
• Gene	sets
– GSEABase::GeneSet()
– GSEABase::GeneSetCollection()
• Multi-omics	data
– MultiAssayExperiment::MultiAssayExperiment()
• Single	cell	data
– SingleCellExperiment::SingleCellExperiment()
• Mass	spectrometry	data
– MSnbase::MSnExp()
https://www.bioconductor.org/developers/how-to/commonMethodsAndClasses/
Core	classes	represent	years	of	work	and	
maintenance	by	experienced	developers
Bioconductor	core	team	members
– Martin	Morgan	(Project	Lead)
– Hervé Pagès
– James	MacDonald
– Valerie	Obenchain
– Andrzej	Oleś
– Marcel	Ramos
– Lori	Shepherd
– Nitesh Turaga
– Daniel	van	Twisk So	you	can	spend	less	time	frame-building
And	more	time	building	rocket	boosters

Weitere ähnliche Inhalte

Was ist angesagt?

Managing a shared_mysql_farm_phpday2011
Managing a shared_mysql_farm_phpday2011Managing a shared_mysql_farm_phpday2011
Managing a shared_mysql_farm_phpday2011
Combell NV
 
Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능
knight1128
 
Testing persistence in PHP with DbUnit
Testing persistence in PHP with DbUnitTesting persistence in PHP with DbUnit
Testing persistence in PHP with DbUnit
Peter Wilcsinszky
 
Scala ActiveRecord
Scala ActiveRecordScala ActiveRecord
Scala ActiveRecord
scalaconfjp
 
Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012
Michelangelo van Dam
 

Was ist angesagt? (20)

Advanced Php - Macq Electronique 2010
Advanced Php - Macq Electronique 2010Advanced Php - Macq Electronique 2010
Advanced Php - Macq Electronique 2010
 
Managing a shared_mysql_farm_phpday2011
Managing a shared_mysql_farm_phpday2011Managing a shared_mysql_farm_phpday2011
Managing a shared_mysql_farm_phpday2011
 
Agile database access with CakePHP 3
Agile database access with CakePHP 3Agile database access with CakePHP 3
Agile database access with CakePHP 3
 
Internationalizing CakePHP Applications
Internationalizing CakePHP ApplicationsInternationalizing CakePHP Applications
Internationalizing CakePHP Applications
 
Workshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfastWorkshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfast
 
Lean React - Patterns for High Performance [ploneconf2017]
Lean React - Patterns for High Performance [ploneconf2017]Lean React - Patterns for High Performance [ploneconf2017]
Lean React - Patterns for High Performance [ploneconf2017]
 
Introduction to julia
Introduction to juliaIntroduction to julia
Introduction to julia
 
Metaprogramming in julia
Metaprogramming in juliaMetaprogramming in julia
Metaprogramming in julia
 
How to Design a Great API (using flask) [ploneconf2017]
How to Design a Great API (using flask) [ploneconf2017]How to Design a Great API (using flask) [ploneconf2017]
How to Design a Great API (using flask) [ploneconf2017]
 
Java设置环境变量
Java设置环境变量Java设置环境变量
Java设置环境变量
 
Advanced Java - Praticals
Advanced Java - PraticalsAdvanced Java - Praticals
Advanced Java - Praticals
 
Drupal7 dbtng
Drupal7  dbtngDrupal7  dbtng
Drupal7 dbtng
 
Thinking Beyond ORM in JPA
Thinking Beyond ORM in JPAThinking Beyond ORM in JPA
Thinking Beyond ORM in JPA
 
PHP Traits
PHP TraitsPHP Traits
PHP Traits
 
Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능
 
Future of HTTP in CakePHP
Future of HTTP in CakePHPFuture of HTTP in CakePHP
Future of HTTP in CakePHP
 
The Origin of Lithium
The Origin of LithiumThe Origin of Lithium
The Origin of Lithium
 
Testing persistence in PHP with DbUnit
Testing persistence in PHP with DbUnitTesting persistence in PHP with DbUnit
Testing persistence in PHP with DbUnit
 
Scala ActiveRecord
Scala ActiveRecordScala ActiveRecord
Scala ActiveRecord
 
Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012
 

Ähnlich wie Why re-use core classes?

Linq 1224887336792847 9
Linq 1224887336792847 9Linq 1224887336792847 9
Linq 1224887336792847 9
google
 
Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8
PrinceGuru MS
 
EdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for JavaEdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for Java
Lisa Hua
 
INFORMATIVE ESSAYThe purpose of the Informative Essay assignme.docx
INFORMATIVE ESSAYThe purpose of the Informative Essay assignme.docxINFORMATIVE ESSAYThe purpose of the Informative Essay assignme.docx
INFORMATIVE ESSAYThe purpose of the Informative Essay assignme.docx
carliotwaycave
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The Enterprise
Daniel Egan
 

Ähnlich wie Why re-use core classes? (20)

M.TECH 1ST SEM COMPUTER SCIENCE ADBMS LAB PROGRAMS
M.TECH 1ST SEM COMPUTER SCIENCE ADBMS LAB PROGRAMSM.TECH 1ST SEM COMPUTER SCIENCE ADBMS LAB PROGRAMS
M.TECH 1ST SEM COMPUTER SCIENCE ADBMS LAB PROGRAMS
 
Introduction to Perl and BioPerl
Introduction to Perl and BioPerlIntroduction to Perl and BioPerl
Introduction to Perl and BioPerl
 
Passing java arrays in oracle stored procedure from mule esb flow
Passing java arrays in oracle stored procedure from mule esb flowPassing java arrays in oracle stored procedure from mule esb flow
Passing java arrays in oracle stored procedure from mule esb flow
 
Bt0082, visual basic
Bt0082, visual basicBt0082, visual basic
Bt0082, visual basic
 
Automatic and Interpretable Machine Learning with H2O and LIME
Automatic and Interpretable Machine Learning with H2O and LIMEAutomatic and Interpretable Machine Learning with H2O and LIME
Automatic and Interpretable Machine Learning with H2O and LIME
 
Linq 1224887336792847 9
Linq 1224887336792847 9Linq 1224887336792847 9
Linq 1224887336792847 9
 
Practical REPL-driven Development with Clojure
Practical REPL-driven Development with ClojurePractical REPL-driven Development with Clojure
Practical REPL-driven Development with Clojure
 
Effective Java with Groovy - How Language Influences Adoption of Good Practices
Effective Java with Groovy - How Language Influences Adoption of Good PracticesEffective Java with Groovy - How Language Influences Adoption of Good Practices
Effective Java with Groovy - How Language Influences Adoption of Good Practices
 
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMEREVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
 
Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8
 
EdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for JavaEdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for Java
 
The First C# Project Analyzed
The First C# Project AnalyzedThe First C# Project Analyzed
The First C# Project Analyzed
 
Data Exploration with Apache Drill: Day 1
Data Exploration with Apache Drill:  Day 1Data Exploration with Apache Drill:  Day 1
Data Exploration with Apache Drill: Day 1
 
Static code analysis: what? how? why?
Static code analysis: what? how? why?Static code analysis: what? how? why?
Static code analysis: what? how? why?
 
Object Oriented Programming in Matlab
Object Oriented Programming in Matlab Object Oriented Programming in Matlab
Object Oriented Programming in Matlab
 
Why you should be using the shiny new C# 6.0 features now!
Why you should be using the shiny new C# 6.0 features now!Why you should be using the shiny new C# 6.0 features now!
Why you should be using the shiny new C# 6.0 features now!
 
INFORMATIVE ESSAYThe purpose of the Informative Essay assignme.docx
INFORMATIVE ESSAYThe purpose of the Informative Essay assignme.docxINFORMATIVE ESSAYThe purpose of the Informative Essay assignme.docx
INFORMATIVE ESSAYThe purpose of the Informative Essay assignme.docx
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The Enterprise
 
Static analysis: Around Java in 60 minutes
Static analysis: Around Java in 60 minutesStatic analysis: Around Java in 60 minutes
Static analysis: Around Java in 60 minutes
 
Scala active record
Scala active recordScala active record
Scala active record
 

Mehr von Levi Waldron (6)

Towards Replicable and Genereralizable Genomic Prediction Models
Towards Replicable and Genereralizable Genomic Prediction ModelsTowards Replicable and Genereralizable Genomic Prediction Models
Towards Replicable and Genereralizable Genomic Prediction Models
 
The impact of different sources of heterogeneity on loss of accuracy from gen...
The impact of different sources of heterogeneity on loss of accuracy from gen...The impact of different sources of heterogeneity on loss of accuracy from gen...
The impact of different sources of heterogeneity on loss of accuracy from gen...
 
2018 05 24-waldron-itcr
2018 05 24-waldron-itcr2018 05 24-waldron-itcr
2018 05 24-waldron-itcr
 
Multi-omics methods and resources for Bioconductor
Multi-omics methods and resources for BioconductorMulti-omics methods and resources for Bioconductor
Multi-omics methods and resources for Bioconductor
 
2017 12-04 euro-biocsig
2017 12-04 euro-biocsig2017 12-04 euro-biocsig
2017 12-04 euro-biocsig
 
Multi-omics infrastructure and data for R/Bioconductor
Multi-omics infrastructure and data for R/BioconductorMulti-omics infrastructure and data for R/Bioconductor
Multi-omics infrastructure and data for R/Bioconductor
 

Kürzlich hochgeladen

Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
gajnagarg
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
amitlee9823
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 
➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men 🔝Ongole🔝 Escorts S...
➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men  🔝Ongole🔝   Escorts S...➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men  🔝Ongole🔝   Escorts S...
➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men 🔝Ongole🔝 Escorts S...
amitlee9823
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
amitlee9823
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
amitlee9823
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
karishmasinghjnh
 
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
gajnagarg
 
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
gajnagarg
 
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
amitlee9823
 
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
gajnagarg
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Kürzlich hochgeladen (20)

DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men 🔝Ongole🔝 Escorts S...
➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men  🔝Ongole🔝   Escorts S...➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men  🔝Ongole🔝   Escorts S...
➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men 🔝Ongole🔝 Escorts S...
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
 
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
 
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
 
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
 
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
 
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 

Why re-use core classes?

  • 4. Why do core classes matter to developers? • What could possibly go wrong? – Your frame has limited testing – Your frame lacks features you never even thought of Ouch! Little eyelets allows users to install a rack and fenders
  • 5. Why do core classes matter to developers? It’s easy to define a new S4 class in R > setClass("BicycleFrame", representation(height = "numeric", color = "character")) > my.new.frame <- new("BicycleFrame", height = 31, color = "red") > my.new.frame An object of class "BicycleFrame" Slot "height": [1] 31 Slot "color": [1] "red” > However, it’s very difficult to define a robust and flexible data class for genomic data analysis
  • 7. Why do core classes matter to developers? setClass("MRexperiment", contains=c("eSet"), representation=representation( expSummary = "environment")) ) From the metagenomeSeq Bioconductor package Contains the eSet base virtual class (since outdated by SummarizedExperiment)
  • 8. Load a metagenomeSeq class object This loads an example object and demonstrates that it uses the default show method defined for eSet. A custom show method could be defined if desired. suppressPackageStartupMessages(library(metagenomeSeq)) data(lungData) lungData ## MRexperiment (storageMode: environment) ## assayData: 51891 features, 78 samples ## element names: counts ## protocolData: none ## phenoData ## sampleNames: CHK_6467_E3B11_BRONCH2_PREWASH_V1V2 ## CHK_6467_E3B11_OW_V1V2 ... CHK_6467_E3B09_BAL_A_V1V2 (78 ## total) ## varLabels: SampleType SiteSampled SmokingStatus ## varMetadata: labelDescription ## featureData ## featureNames: 1 2 ... 51891 (51891 total) ## fvarLabels: taxa ## fvarMetadata: labelDescription ## experimentData: use 'experimentData(object)' ## pubMedIds: 21680950 ## Annotation:
  • 9. Load a phyloseq class object Do the same for a phyloseq class example data object, and demonstrate its custom show method: suppressPackageStartupMessages(library(phyloseq)) data(GlobalPatterns) GlobalPatterns ## phyloseq-class experiment-level object ## otu_table() OTU Table: [ 19216 taxa and 26 samples ] ## sample_data() Sample Data: [ 26 samples by 7 sample variables ] ## tax_table() Taxonomy Table: [ 19216 taxa by 7 taxonomic ranks ] ## phy_tree() Phylogenetic Tree: [ 19216 tips and 19215 internal nodes ]
  • 10. Inheritance of core methods: example 1 Since metagenomeSeq contains eSet, it automatically inherits core methods like dim(). These would have to be defined separately for the phyloseq class since it does not extend a core class. dim(lungData) ## Features Samples ## 51891 78 dim(GlobalPatterns) ## NULL Note that neither the phyloseq or the metagenomeSeq package defines a dim() method, but metagenomeSeq got it for free by extending eSet.
  • 11. Inheritance of core methods: example 2 For core Bioconductor objects, $ generally accessess the sample data, but for phyloseq objects the sample data must be explicitly extracted first: head(lungData$SampleType) ## CHK_6467_E3B11_BRONCH2_PREWASH_V1V2 CHK_6467_E3B11_OW_V1V2 ## Bronch2.PreWash OW ## CHK_6467_E3B08_OW_V1V2 CHK_6467_E3B07_BAL_A_V1V2 ## OW BAL.A ## CHK_6467_E3B11_BAL_A_V1V2 CHK_6467_E3B09_OP_V1V2 ## BAL.A OP.Swab ## 12 Levels: BAL.1stReturn BAL.A BAL.B Bronch1.PostWash ... PSB head(sample_data(GlobalPatterns)$SampleType) ## [1] Soil Soil Soil Feces Feces Skin ## 9 Levels: Feces Freshwater Freshwater (creek) Mock ... Tongue
  • 12. Inheritance of core methods: example 2 subset(), [, and head() are core methods they are defined for eSet and other core classes, so these familiar operations work “out of the box”: subset(lungData, lungData$SampleType=="OW") lungData[, lungData$SampleType=="OW"] lungData[, 1:5] head(lungData)
  • 13. Inheritance of core methods: example 2 phyloseq cannot use these, so a custom subset_samples() method is defined instead: subset_samples(GlobalPatterns, SampleType=="Ocean") But square bracket subsetting, subset(), and head() are not defined for phyloseq objects, and have no parent class to inherit them from. GlobalPatterns[, 1:5] ## Error in GlobalPatterns[, 1:5]: object of type 'S4' is not subsettable subset(GlobalPatterns, 1:5) ## Error in subset.default(GlobalPatterns, 1:5): 'subset' must be logical
  • 14. Relevance to multi-omics data analysis The MultiAssayExperiment core class allows coordinated representation and management of an open-ended set of assays, as long as their data class provides basic methods: dimnames() [ subsetting dim() and preferably assay() MultiAssayExperiment data management is modeled on SummarizedExperiment but allows for multiple assays of different row and column dimensions.
  • 15. Relevance to multi-omics data analysis (cont’d) With no special accommodations, the lungData object “just works” in a MultiAssayExperiment: suppressPackageStartupMessages(library(MultiAssayExperiment)) MultiAssayExperiment(list(lung=lungData)) ## A MultiAssayExperiment object of 1 listed ## experiment with a user-defined name and respective class. ## Containing an ExperimentList class object of length 1: ## [1] lung: MRexperiment with 51891 rows and 78 columns ## Features: ## experiments() - obtain the ExperimentList instance ## colData() - the primary/phenotype DataFrame ## sampleMap() - the sample availability DataFrame ## `$`, `[`, `[[` - extract colData columns, subset, or experiment ## *Format() - convert into a long or wide DataFrame ## assays() - convert ExperimentList to a SimpleList of matrices But GlobalPattern does not, because it is not derived from a core class: MultiAssayExperiment(list(global=GlobalPatterns)) ## Error in if (dim(object)[2] > 0 && is.null(colnames(object))) {: missing value where TRUE/FALSE needed
  • 16. Inheritance of core methods These are not isolated examples.Full-time, professional software developers have developed many methods for core classes. Classes containing core classes get all of these for free, providing future advantages that you can not possibly imagine in advance. For example, SummarizedExperiment has more than 100 methods defined!
  • 17. Inheritance of core methods (cont’d) suppressPackageStartupMessages(library(SummarizedExperiment)) methods(class="SummarizedExperiment") ## [1] != [ [[ [[<- [<- ## [6] %in% < <= == > ## [11] >= $ $<- aggregate anyNA ## [16] append as.character as.complex as.data.frame as.env ## [21] as.integer as.list as.logical as.matrix as.numeric ## [26] as.raw assay assay<- assayNames assayNames<- ## [31] assays assays<- by cbind coerce ## [36] coerce<- colData colData<- countOverlaps dim ## [41] dimnames dimnames<- duplicated elementMetadata elementMetadata<- ## [46] eval expand expand.grid extractROWS findOverlaps ## [51] head intersect is.na length lengths ## [56] match mcols mcols<- merge metadata ## [61] metadata<- mstack names names<- NROW ## [66] overlapsAny parallelSlotNames pcompare rank rbind ## [71] realize relist rename rep rep.int ## [76] replaceROWS rev rowData rowData<- ROWNAMES ## [81] rowRanges<- seqlevelsInUse setdiff setequal shiftApply ## [86] show sort split split<- subset ## [91] subsetByOverlaps table tail tapply transform ## [96] union unique updateObject values values<- ## [101] window window<- with xtabs ## see '?methods' for accessing help and source code SummarizedExperiment also provides great functionality like out-of-the-box compatibility with on-disk data representation. USE AND DERIVE FROM THESE CLASSES!
  • 18. What are the “core” classes? • Rectangular feature x sample data (RNAseq count matrix, microarray, …) – SummarizedExperiment::SummarizedExperiment() • Genomic coordinates (1-based, closed interval) – GenomicRanges::GRanges() • DNA / RNA / AA sequences – Biostrings::*Stringset() • Gene sets – GSEABase::GeneSet() – GSEABase::GeneSetCollection() • Multi-omics data – MultiAssayExperiment::MultiAssayExperiment() • Single cell data – SingleCellExperiment::SingleCellExperiment() • Mass spectrometry data – MSnbase::MSnExp() https://www.bioconductor.org/developers/how-to/commonMethodsAndClasses/
  • 19. Core classes represent years of work and maintenance by experienced developers Bioconductor core team members – Martin Morgan (Project Lead) – Hervé Pagès – James MacDonald – Valerie Obenchain – Andrzej Oleś – Marcel Ramos – Lori Shepherd – Nitesh Turaga – Daniel van Twisk So you can spend less time frame-building And more time building rocket boosters