SlideShare a Scribd company logo
1 of 25
A short introduction to MongoDB For Bioinformatics Pierre Lindenbaum PhD UMR915 – Institut du thorax Nantes, France @yokofakun http://plindenbaum.blogspot.com
http://www.mongodb.org/
Document Oriented Database
http://bytesforlunch.wordpress.com/2011/01/26/meet-an-agile-friend-from-the-nosql-ecosystem-mongodb-part-one/
 
null
true
42
“ chr22”
[ “rs25”,null,42]
{ “ name”:“rs25”, “ chrom”:”chr22”, “ position”:1234 }
{ “ name”:“rs25”, “ chrom”:”chr22”, “ position”:1234, “ comments:[ “ hello”,  { “ lang”:”fr”, ” msg”:”Bonjour” } ] }
Pubmed http://plindenbaum.blogspot.com/2010/09/mongodb-and-ncbi-pubmed-inserting.html
article={ _id : 20665232, pmid: 20665232, created: { year: 2010, month: 8, day: 10 }, title: "Charles Darwin's beagle voyage...", issue: "2", volume: "43", pgn: "363-99", journal: { title: "Journal of the history of biology", abbr: "J Hist Biol", issn: "0022-5010" }, doi: "10.1007/s10739-009-9189-9", lang: "eng", authors: [ { firstName: "Paul D", lastName: "Brinkman" } ], mesh: [ "Animals", "Fossils", "History, 19th Century", "Natural History", "Phylogeny", "Vertebrates" ] }; article=db.articles.save(article);
db.articles.ensureIndex({pmid:1}, {unique: true}); db.articles.ensureIndex({created:1}); db.articles.ensureIndex({authors:1}); db.articles.ensureIndex({mesh:1}); db.articles.ensureIndex({journal:1}); Indexes
Retrieving Records > db.articles.find().limit(3).forEach(printjson); { "_id" : 20665232, "pmid" : 20665232, "created" : { "year" : 2010, "month" : 8, "day" : 10 }, "title" : "Charles Darwin's beagle voyage, fossil vertebrate succession, and amp;quot;the gradual birth & death of speciesamp;quot;.", "issue" : "2", "volume" : "43", "pgn" : "363-99", "journal" : { "title" : "Journal of the history of biology", "abbr" : "J Hist Biol", "issn" : "0022-5010" }, (...)
Count > db.articles.find().limit(20).count(); 327 > db.articles.find().limit(20).size(); 20
Get by pmid > db.articles.findOne({pmid:20180452}); { "_id" : 20180452, "pmid" : 20180452, "created" : { "year" : 2010, "month" : 2, "day" : 25 }, "title" : "[Darwin's hidden feeling for emotions of the species]", "issue" : "50-51", "volume" : "106", "pgn" : "3443-6",
Find “Lactose Intolerance[MESH]” > db.articles.find( {mesh:'Lactose Intolerance'} ).forEach(printjson); { "_id" : 17575947, "pmid" : 17575947, "created" : { "year" : 2007, "month" : 6, "day" : 19 }, "title" : "Darwin's illness: a final diagnosis.", "issue" : "1", "volume" : "61", "pgn" : "23-9", "journal" : { "title" : "Notes and records of the Royal Society of London", "abbr" : "Notes Rec R Soc Lond", "issn" : "0035-9149" }, "lang" : "eng", "authors"
FIND 'Evolution' AND 'Religion' AND 'History, 19th Century' >db.articles.find( { mesh:{$all:["Evolution","History, 19th Century","Religion"]}} ).limit(2).forEach(printjson); { "_id" : 20503821, "pmid" : 20503821, "created" : { "year" : 2010, "month" : 5, "day" : 27 }, "title" : "Darwin and the popularization of evolution.", "issue" : "1", "volume" : "64", "pgn" : "5-24", "journal" : { "title" : "Notes and records of the Royal Society of London", "abbr" : "Notes Re...
Search all, only return the title and the pmid, limit 5 > db.articles.find({},{"title":1,"pmid":1}).limit(5).forEach(printjson); { "_id" : 20665232, "pmid" : 20665232, "title" : "Charles Darwin's beagle voyage, fossil vertebrate succession, and amp;quot;the gradual birth & death of speciesamp;quot;." }, { "_id" : 20626121, "pmid" : 20626121, "title" : "[The biomedical legacy of Charles Darwin]" }, { "_id" : 20503821, "pmid" : 20503821, "title" : "Darwin and the popularization of evolution." }
Using javascript $where: articles starting with 'DARWIN' > db.articles.find( {$where:"this.title.substr(0,6)==amp;quot;DARWINamp;quot;"},{title:1} ).limit(5).forEach(printjson); { "_id" : 14341734, "title" : "DARWIN AS THE SOURCE OF FREUD'S NEO-LAMARCKIANISM." } { "_id" : 14275525, "title" : "DARWIN'S ILLNESS." } { "_id" : 14248443, "title" : "DARWIN'S HEALTH IN RELATION TO HIS VOYAGE TO SOUTH AMERICA." } { "_id" : 14217140, "title" : "DARWIN'S ILLNESS." }
GROUP operator: the number of articles per journal having mesh='Evolution' and having a number of articles greater than 2 > db.articles.group( { key: { }, cond: { mesh: &quot;Evolution&quot; }, initial: { journal: { }, total: 0 }, reduce: function(object, aggregate){ varcount=aggregate.journal[ object.journal.title ];if(!count){ count=0; }count++;aggregate.journal[ object.journal.title ]=count;aggregate.total++; }, finalize: function(aggregate){ for(jinaggregate.journal){ if(aggregate.journal[ j ]<3){ deleteaggregate.journal[ j ]; } } } }) [ { &quot;journal&quot; : { &quot;Comptes rendus biologies&quot; : 5, &quot;Läkartidningen&quot; : 6 (...)
Update(criteria, objNew, upsert, multi ) > db.articles.update( {&quot;journal.title&quot;:&quot;Nature&quot;}, {$unset:{title:1,authors:1,created:1,mesh:1}},false,true)
AYE

More Related Content

What's hot

Schema design short
Schema design shortSchema design short
Schema design shortMongoDB
 
ETL for Pros: Getting Data Into MongoDB
ETL for Pros: Getting Data Into MongoDBETL for Pros: Getting Data Into MongoDB
ETL for Pros: Getting Data Into MongoDBMongoDB
 
Monitoring MongoDB (MongoSV)
Monitoring MongoDB (MongoSV)Monitoring MongoDB (MongoSV)
Monitoring MongoDB (MongoSV)Boxed Ice
 
MongoDB Europe 2016 - ETL for Pros – Getting Data Into MongoDB The Right Way
MongoDB Europe 2016 - ETL for Pros – Getting Data Into MongoDB The Right WayMongoDB Europe 2016 - ETL for Pros – Getting Data Into MongoDB The Right Way
MongoDB Europe 2016 - ETL for Pros – Getting Data Into MongoDB The Right WayMongoDB
 
Teri's Resume
Teri's ResumeTeri's Resume
Teri's Resumeteri louk
 
Powerful Analysis with the Aggregation Pipeline
Powerful Analysis with the Aggregation PipelinePowerful Analysis with the Aggregation Pipeline
Powerful Analysis with the Aggregation PipelineMongoDB
 
I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)Joel Lord
 
ConFoo - Migrating To Mongo Db
ConFoo - Migrating To Mongo DbConFoo - Migrating To Mongo Db
ConFoo - Migrating To Mongo DbContext.IO
 
I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)Joel Lord
 
MongoDB Europe 2016 - Advanced MongoDB Aggregation Pipelines
MongoDB Europe 2016 - Advanced MongoDB Aggregation PipelinesMongoDB Europe 2016 - Advanced MongoDB Aggregation Pipelines
MongoDB Europe 2016 - Advanced MongoDB Aggregation PipelinesMongoDB
 
a hands on guide to django
a hands on guide to djangoa hands on guide to django
a hands on guide to djangoswee meng ng
 
Swift Cloud Workshop - Codable, the key to Fullstack Swift
Swift Cloud Workshop - Codable, the key to Fullstack SwiftSwift Cloud Workshop - Codable, the key to Fullstack Swift
Swift Cloud Workshop - Codable, the key to Fullstack SwiftChris Bailey
 
Getting groovy
Getting groovyGetting groovy
Getting groovyNick Dixon
 

What's hot (14)

Schema design short
Schema design shortSchema design short
Schema design short
 
ETL for Pros: Getting Data Into MongoDB
ETL for Pros: Getting Data Into MongoDBETL for Pros: Getting Data Into MongoDB
ETL for Pros: Getting Data Into MongoDB
 
Monitoring MongoDB (MongoSV)
Monitoring MongoDB (MongoSV)Monitoring MongoDB (MongoSV)
Monitoring MongoDB (MongoSV)
 
MongoDB Europe 2016 - ETL for Pros – Getting Data Into MongoDB The Right Way
MongoDB Europe 2016 - ETL for Pros – Getting Data Into MongoDB The Right WayMongoDB Europe 2016 - ETL for Pros – Getting Data Into MongoDB The Right Way
MongoDB Europe 2016 - ETL for Pros – Getting Data Into MongoDB The Right Way
 
Teri's Resume
Teri's ResumeTeri's Resume
Teri's Resume
 
Powerful Analysis with the Aggregation Pipeline
Powerful Analysis with the Aggregation PipelinePowerful Analysis with the Aggregation Pipeline
Powerful Analysis with the Aggregation Pipeline
 
Doc data
Doc dataDoc data
Doc data
 
I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)
 
ConFoo - Migrating To Mongo Db
ConFoo - Migrating To Mongo DbConFoo - Migrating To Mongo Db
ConFoo - Migrating To Mongo Db
 
I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)
 
MongoDB Europe 2016 - Advanced MongoDB Aggregation Pipelines
MongoDB Europe 2016 - Advanced MongoDB Aggregation PipelinesMongoDB Europe 2016 - Advanced MongoDB Aggregation Pipelines
MongoDB Europe 2016 - Advanced MongoDB Aggregation Pipelines
 
a hands on guide to django
a hands on guide to djangoa hands on guide to django
a hands on guide to django
 
Swift Cloud Workshop - Codable, the key to Fullstack Swift
Swift Cloud Workshop - Codable, the key to Fullstack SwiftSwift Cloud Workshop - Codable, the key to Fullstack Swift
Swift Cloud Workshop - Codable, the key to Fullstack Swift
 
Getting groovy
Getting groovyGetting groovy
Getting groovy
 

Viewers also liked

Limits of RDBMS and Need for NoSQL in Bioinformatics
Limits of RDBMS and Need for NoSQL in BioinformaticsLimits of RDBMS and Need for NoSQL in Bioinformatics
Limits of RDBMS and Need for NoSQL in BioinformaticsDan Sullivan, Ph.D.
 
Benefits of Using MongoDB Over RDBMSs
Benefits of Using MongoDB Over RDBMSsBenefits of Using MongoDB Over RDBMSs
Benefits of Using MongoDB Over RDBMSsMongoDB
 
MySQL and bioinformatics
MySQL and bioinformatics MySQL and bioinformatics
MySQL and bioinformatics Arindam Ghosh
 
An overview of Neo4j Internals
An overview of Neo4j InternalsAn overview of Neo4j Internals
An overview of Neo4j InternalsTobias Lindaaker
 
databases in bioinformatics
databases in bioinformaticsdatabases in bioinformatics
databases in bioinformaticsnadeem akhter
 
MongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World ExamplesMongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World ExamplesMike Friedman
 

Viewers also liked (6)

Limits of RDBMS and Need for NoSQL in Bioinformatics
Limits of RDBMS and Need for NoSQL in BioinformaticsLimits of RDBMS and Need for NoSQL in Bioinformatics
Limits of RDBMS and Need for NoSQL in Bioinformatics
 
Benefits of Using MongoDB Over RDBMSs
Benefits of Using MongoDB Over RDBMSsBenefits of Using MongoDB Over RDBMSs
Benefits of Using MongoDB Over RDBMSs
 
MySQL and bioinformatics
MySQL and bioinformatics MySQL and bioinformatics
MySQL and bioinformatics
 
An overview of Neo4j Internals
An overview of Neo4j InternalsAn overview of Neo4j Internals
An overview of Neo4j Internals
 
databases in bioinformatics
databases in bioinformaticsdatabases in bioinformatics
databases in bioinformatics
 
MongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World ExamplesMongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World Examples
 

Similar to Introduction to mongodb for bioinformatics

Using Yahoo Pipes
Using Yahoo PipesUsing Yahoo Pipes
Using Yahoo PipesAnna Gerber
 
Scala 3camp 2011
Scala   3camp 2011Scala   3camp 2011
Scala 3camp 2011Scalac
 
development, ruby, conferences, frameworks, ruby on rails, confreaks, actsasc...
development, ruby, conferences, frameworks, ruby on rails, confreaks, actsasc...development, ruby, conferences, frameworks, ruby on rails, confreaks, actsasc...
development, ruby, conferences, frameworks, ruby on rails, confreaks, actsasc...ActsAsCon
 
Relaxing With CouchDB
Relaxing With CouchDBRelaxing With CouchDB
Relaxing With CouchDBleinweber
 
Jsonsaga
JsonsagaJsonsaga
Jsonsaganohmad
 
The JSON Saga
The JSON SagaThe JSON Saga
The JSON Sagakaven yan
 
Arquitetura Java em 2007 (Java Architecture in 2007)
Arquitetura Java em 2007 (Java Architecture in 2007)Arquitetura Java em 2007 (Java Architecture in 2007)
Arquitetura Java em 2007 (Java Architecture in 2007)Phil Calçado
 
JSUG - TU Wien Castor Project by Lukas Lang
JSUG - TU Wien Castor Project by Lukas LangJSUG - TU Wien Castor Project by Lukas Lang
JSUG - TU Wien Castor Project by Lukas LangChristoph Pickl
 
Python And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And PythonwinPython And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And PythonwinChad Cooper
 
Avro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAvro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAlexandre Victoor
 
JSARToolKit / LiveChromaKey / LivePointers - Next gen of AR
JSARToolKit / LiveChromaKey / LivePointers - Next gen of ARJSARToolKit / LiveChromaKey / LivePointers - Next gen of AR
JSARToolKit / LiveChromaKey / LivePointers - Next gen of ARYusuke Kawasaki
 
Real-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @MoldcampReal-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @MoldcampAlexei Gorobets
 
Fighting fraud: finding duplicates at scale
Fighting fraud: finding duplicates at scaleFighting fraud: finding duplicates at scale
Fighting fraud: finding duplicates at scaleAlexey Grigorev
 
Significant Characteristics In Planets Manfred Thaller
Significant Characteristics In Planets Manfred ThallerSignificant Characteristics In Planets Manfred Thaller
Significant Characteristics In Planets Manfred ThallerDigitalPreservationEurope
 
Couch Db.0.9.0.Pub
Couch Db.0.9.0.PubCouch Db.0.9.0.Pub
Couch Db.0.9.0.PubYohei Sasaki
 
Searching the Now
Searching the NowSearching the Now
Searching the Nowlucasjosh
 
MongoDB - Monitoring and queueing
MongoDB - Monitoring and queueingMongoDB - Monitoring and queueing
MongoDB - Monitoring and queueingBoxed Ice
 

Similar to Introduction to mongodb for bioinformatics (20)

Using Yahoo Pipes
Using Yahoo PipesUsing Yahoo Pipes
Using Yahoo Pipes
 
Scala 3camp 2011
Scala   3camp 2011Scala   3camp 2011
Scala 3camp 2011
 
development, ruby, conferences, frameworks, ruby on rails, confreaks, actsasc...
development, ruby, conferences, frameworks, ruby on rails, confreaks, actsasc...development, ruby, conferences, frameworks, ruby on rails, confreaks, actsasc...
development, ruby, conferences, frameworks, ruby on rails, confreaks, actsasc...
 
Relaxing With CouchDB
Relaxing With CouchDBRelaxing With CouchDB
Relaxing With CouchDB
 
Jsonsaga
JsonsagaJsonsaga
Jsonsaga
 
The JSON Saga
The JSON SagaThe JSON Saga
The JSON Saga
 
Arquitetura Java em 2007 (Java Architecture in 2007)
Arquitetura Java em 2007 (Java Architecture in 2007)Arquitetura Java em 2007 (Java Architecture in 2007)
Arquitetura Java em 2007 (Java Architecture in 2007)
 
JSUG - TU Wien Castor Project by Lukas Lang
JSUG - TU Wien Castor Project by Lukas LangJSUG - TU Wien Castor Project by Lukas Lang
JSUG - TU Wien Castor Project by Lukas Lang
 
Python And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And PythonwinPython And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And Pythonwin
 
Avro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAvro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSON
 
JSARToolKit / LiveChromaKey / LivePointers - Next gen of AR
JSARToolKit / LiveChromaKey / LivePointers - Next gen of ARJSARToolKit / LiveChromaKey / LivePointers - Next gen of AR
JSARToolKit / LiveChromaKey / LivePointers - Next gen of AR
 
Embedded Metadata working group
Embedded Metadata working groupEmbedded Metadata working group
Embedded Metadata working group
 
Real-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @MoldcampReal-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @Moldcamp
 
Fighting fraud: finding duplicates at scale
Fighting fraud: finding duplicates at scaleFighting fraud: finding duplicates at scale
Fighting fraud: finding duplicates at scale
 
Fantom and Tales
Fantom and TalesFantom and Tales
Fantom and Tales
 
Significant Characteristics In Planets Manfred Thaller
Significant Characteristics In Planets Manfred ThallerSignificant Characteristics In Planets Manfred Thaller
Significant Characteristics In Planets Manfred Thaller
 
Javascript Basic
Javascript BasicJavascript Basic
Javascript Basic
 
Couch Db.0.9.0.Pub
Couch Db.0.9.0.PubCouch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
 
Searching the Now
Searching the NowSearching the Now
Searching the Now
 
MongoDB - Monitoring and queueing
MongoDB - Monitoring and queueingMongoDB - Monitoring and queueing
MongoDB - Monitoring and queueing
 

More from Pierre Lindenbaum

More from Pierre Lindenbaum (20)

Next Generation Sequencing file Formats ( 2017 )
Next Generation Sequencing file Formats ( 2017 )Next Generation Sequencing file Formats ( 2017 )
Next Generation Sequencing file Formats ( 2017 )
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
Mum, I 3D printed a gel comb !
Mum, I 3D printed a gel comb !Mum, I 3D printed a gel comb !
Mum, I 3D printed a gel comb !
 
"Mon make à moi", (tout sauf Galaxy)
"Mon make à moi", (tout sauf Galaxy)"Mon make à moi", (tout sauf Galaxy)
"Mon make à moi", (tout sauf Galaxy)
 
Advanced NCBI
Advanced NCBI Advanced NCBI
Advanced NCBI
 
File formats for Next Generation Sequencing
File formats for Next Generation SequencingFile formats for Next Generation Sequencing
File formats for Next Generation Sequencing
 
Building a Simple LIMS with the Eclipse Modeling Framework (EMF) ,my notebook
Building a Simple LIMS with the Eclipse Modeling Framework (EMF) ,my notebookBuilding a Simple LIMS with the Eclipse Modeling Framework (EMF) ,my notebook
Building a Simple LIMS with the Eclipse Modeling Framework (EMF) ,my notebook
 
Make
MakeMake
Make
 
XML for bioinformatics
XML for bioinformaticsXML for bioinformatics
XML for bioinformatics
 
20120423.NGS.Rennes
20120423.NGS.Rennes20120423.NGS.Rennes
20120423.NGS.Rennes
 
Sketching 20120412
Sketching 20120412Sketching 20120412
Sketching 20120412
 
Biostar17037
Biostar17037Biostar17037
Biostar17037
 
Tweeting for the BioStar Paper
Tweeting for the BioStar PaperTweeting for the BioStar Paper
Tweeting for the BioStar Paper
 
Variation Toolkit
Variation ToolkitVariation Toolkit
Variation Toolkit
 
Bioinformatician 2.0
Bioinformatician 2.0Bioinformatician 2.0
Bioinformatician 2.0
 
Analyzing Exome Data with KNIME
Analyzing Exome Data with KNIMEAnalyzing Exome Data with KNIME
Analyzing Exome Data with KNIME
 
NOTCH2 backstage
NOTCH2 backstageNOTCH2 backstage
NOTCH2 backstage
 
Bioinfo tweets
Bioinfo tweetsBioinfo tweets
Bioinfo tweets
 
Post doctoriales 2011
Post doctoriales 2011Post doctoriales 2011
Post doctoriales 2011
 
20110114 Next Generation Sequencing Course
20110114 Next Generation Sequencing Course20110114 Next Generation Sequencing Course
20110114 Next Generation Sequencing Course
 

Recently uploaded

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 

Introduction to mongodb for bioinformatics

  • 1. A short introduction to MongoDB For Bioinformatics Pierre Lindenbaum PhD UMR915 – Institut du thorax Nantes, France @yokofakun http://plindenbaum.blogspot.com
  • 5.  
  • 8. 42
  • 11. { “ name”:“rs25”, “ chrom”:”chr22”, “ position”:1234 }
  • 12. { “ name”:“rs25”, “ chrom”:”chr22”, “ position”:1234, “ comments:[ “ hello”, { “ lang”:”fr”, ” msg”:”Bonjour” } ] }
  • 14. article={ _id : 20665232, pmid: 20665232, created: { year: 2010, month: 8, day: 10 }, title: &quot;Charles Darwin's beagle voyage...&quot;, issue: &quot;2&quot;, volume: &quot;43&quot;, pgn: &quot;363-99&quot;, journal: { title: &quot;Journal of the history of biology&quot;, abbr: &quot;J Hist Biol&quot;, issn: &quot;0022-5010&quot; }, doi: &quot;10.1007/s10739-009-9189-9&quot;, lang: &quot;eng&quot;, authors: [ { firstName: &quot;Paul D&quot;, lastName: &quot;Brinkman&quot; } ], mesh: [ &quot;Animals&quot;, &quot;Fossils&quot;, &quot;History, 19th Century&quot;, &quot;Natural History&quot;, &quot;Phylogeny&quot;, &quot;Vertebrates&quot; ] }; article=db.articles.save(article);
  • 15. db.articles.ensureIndex({pmid:1}, {unique: true}); db.articles.ensureIndex({created:1}); db.articles.ensureIndex({authors:1}); db.articles.ensureIndex({mesh:1}); db.articles.ensureIndex({journal:1}); Indexes
  • 16. Retrieving Records > db.articles.find().limit(3).forEach(printjson); { &quot;_id&quot; : 20665232, &quot;pmid&quot; : 20665232, &quot;created&quot; : { &quot;year&quot; : 2010, &quot;month&quot; : 8, &quot;day&quot; : 10 }, &quot;title&quot; : &quot;Charles Darwin's beagle voyage, fossil vertebrate succession, and amp;quot;the gradual birth & death of speciesamp;quot;.&quot;, &quot;issue&quot; : &quot;2&quot;, &quot;volume&quot; : &quot;43&quot;, &quot;pgn&quot; : &quot;363-99&quot;, &quot;journal&quot; : { &quot;title&quot; : &quot;Journal of the history of biology&quot;, &quot;abbr&quot; : &quot;J Hist Biol&quot;, &quot;issn&quot; : &quot;0022-5010&quot; }, (...)
  • 17. Count > db.articles.find().limit(20).count(); 327 > db.articles.find().limit(20).size(); 20
  • 18. Get by pmid > db.articles.findOne({pmid:20180452}); { &quot;_id&quot; : 20180452, &quot;pmid&quot; : 20180452, &quot;created&quot; : { &quot;year&quot; : 2010, &quot;month&quot; : 2, &quot;day&quot; : 25 }, &quot;title&quot; : &quot;[Darwin's hidden feeling for emotions of the species]&quot;, &quot;issue&quot; : &quot;50-51&quot;, &quot;volume&quot; : &quot;106&quot;, &quot;pgn&quot; : &quot;3443-6&quot;,
  • 19. Find “Lactose Intolerance[MESH]” > db.articles.find( {mesh:'Lactose Intolerance'} ).forEach(printjson); { &quot;_id&quot; : 17575947, &quot;pmid&quot; : 17575947, &quot;created&quot; : { &quot;year&quot; : 2007, &quot;month&quot; : 6, &quot;day&quot; : 19 }, &quot;title&quot; : &quot;Darwin's illness: a final diagnosis.&quot;, &quot;issue&quot; : &quot;1&quot;, &quot;volume&quot; : &quot;61&quot;, &quot;pgn&quot; : &quot;23-9&quot;, &quot;journal&quot; : { &quot;title&quot; : &quot;Notes and records of the Royal Society of London&quot;, &quot;abbr&quot; : &quot;Notes Rec R Soc Lond&quot;, &quot;issn&quot; : &quot;0035-9149&quot; }, &quot;lang&quot; : &quot;eng&quot;, &quot;authors&quot;
  • 20. FIND 'Evolution' AND 'Religion' AND 'History, 19th Century' >db.articles.find( { mesh:{$all:[&quot;Evolution&quot;,&quot;History, 19th Century&quot;,&quot;Religion&quot;]}} ).limit(2).forEach(printjson); { &quot;_id&quot; : 20503821, &quot;pmid&quot; : 20503821, &quot;created&quot; : { &quot;year&quot; : 2010, &quot;month&quot; : 5, &quot;day&quot; : 27 }, &quot;title&quot; : &quot;Darwin and the popularization of evolution.&quot;, &quot;issue&quot; : &quot;1&quot;, &quot;volume&quot; : &quot;64&quot;, &quot;pgn&quot; : &quot;5-24&quot;, &quot;journal&quot; : { &quot;title&quot; : &quot;Notes and records of the Royal Society of London&quot;, &quot;abbr&quot; : &quot;Notes Re...
  • 21. Search all, only return the title and the pmid, limit 5 > db.articles.find({},{&quot;title&quot;:1,&quot;pmid&quot;:1}).limit(5).forEach(printjson); { &quot;_id&quot; : 20665232, &quot;pmid&quot; : 20665232, &quot;title&quot; : &quot;Charles Darwin's beagle voyage, fossil vertebrate succession, and amp;quot;the gradual birth & death of speciesamp;quot;.&quot; }, { &quot;_id&quot; : 20626121, &quot;pmid&quot; : 20626121, &quot;title&quot; : &quot;[The biomedical legacy of Charles Darwin]&quot; }, { &quot;_id&quot; : 20503821, &quot;pmid&quot; : 20503821, &quot;title&quot; : &quot;Darwin and the popularization of evolution.&quot; }
  • 22. Using javascript $where: articles starting with 'DARWIN' > db.articles.find( {$where:&quot;this.title.substr(0,6)==amp;quot;DARWINamp;quot;&quot;},{title:1} ).limit(5).forEach(printjson); { &quot;_id&quot; : 14341734, &quot;title&quot; : &quot;DARWIN AS THE SOURCE OF FREUD'S NEO-LAMARCKIANISM.&quot; } { &quot;_id&quot; : 14275525, &quot;title&quot; : &quot;DARWIN'S ILLNESS.&quot; } { &quot;_id&quot; : 14248443, &quot;title&quot; : &quot;DARWIN'S HEALTH IN RELATION TO HIS VOYAGE TO SOUTH AMERICA.&quot; } { &quot;_id&quot; : 14217140, &quot;title&quot; : &quot;DARWIN'S ILLNESS.&quot; }
  • 23. GROUP operator: the number of articles per journal having mesh='Evolution' and having a number of articles greater than 2 > db.articles.group( { key: { }, cond: { mesh: &quot;Evolution&quot; }, initial: { journal: { }, total: 0 }, reduce: function(object, aggregate){ varcount=aggregate.journal[ object.journal.title ];if(!count){ count=0; }count++;aggregate.journal[ object.journal.title ]=count;aggregate.total++; }, finalize: function(aggregate){ for(jinaggregate.journal){ if(aggregate.journal[ j ]<3){ deleteaggregate.journal[ j ]; } } } }) [ { &quot;journal&quot; : { &quot;Comptes rendus biologies&quot; : 5, &quot;Läkartidningen&quot; : 6 (...)
  • 24. Update(criteria, objNew, upsert, multi ) > db.articles.update( {&quot;journal.title&quot;:&quot;Nature&quot;}, {$unset:{title:1,authors:1,created:1,mesh:1}},false,true)
  • 25. AYE