Share
Embed
Optimizing The Design of New Microbes Using Elasticsearch
Zymergen has developed a new, industrialized process to create microbes capable of fermenting chemicals, pharmaceuticals and more. Success depends on insights gleaned from large volumes of possible DNA modifications. This talk will cover how Elasticsearch powers this revolution in scientific data analysis.
Elastic Co
February 19, 2016
Transcript
127 slides
-
Kiyan Ahmadizadeh, Senior Software Engineer February 19, 2016 [email protected] Optimizing
The Design Of New Microbes Using Elasticsearch -
Industrial Fermenta/on “The inten&onal use of fermenta&on by microorganisms
such as bacteria and fungi to make products useful to humans.” -
Produc/vity is on the rise "Time for New DNA Synthesis
and Sequencing Cost Curves", Rob Carlson -
Produc/vity is on the rise "Time for New DNA Synthesis
and Sequencing Cost Curves", Rob Carlson Moore’s Law -
Produc/vity is on the rise "Time for New DNA Synthesis
and Sequencing Cost Curves", Rob Carlson The number of base pairs one person can sequence in a day using modern equipment and techniques. -
Produc/vity is on the rise "Time for New DNA Synthesis
and Sequencing Cost Curves", Rob Carlson The number of base pairs one person can synthesize in a day using modern equipment and techniques. -
Costs are falling "Time for New DNA Synthesis and Sequencing
Cost Curves", Rob Carlson Cost to sequence a base pair -
Costs are falling "Time for New DNA Synthesis and Sequencing
Cost Curves", Rob Carlson Cost to synthesize a base pair -
What can we do as our abili/es grow? Amplify exis&ng
pathways. Unlock new pathways. -
Genome op/miza/on is hard! How do you search the space
of possibili&es? -
Zymergen’s Op/miza/on Workflow DESIGN New DNA constructs BUILD Microbes with
new DNA TEST Evaluate microbe performance ANALYZE Incorporate test results Into next design phase -
This used to be a very manual and serial
wet lab process. -
We’re using soTware and automa/on to parallelize and
industrialize this process. -
SoTware: Design a campaign of changes. hostStrain = dnaForStrain(“e-coli-461”)
promoters = load(“promoter-lib-02-13-2015.gb”) genes = locateGenes(hostStrain, “YFG*”) create replacePromoter[x](genes, promoters) -
Automa/on: Build new strains in parallel. Photo: J. Tyson McDonald
-‐-‐ h9p://jtyson.bol.ucla.edu/ -
DNA Components Genomes and modifica&ons to
genomes 120K 5M 60M Some sta/s/cs from our system. Wells Used to build and test genomes and strains Measurements Taken while building and tes&ng new strains. -
Our data is growing quickly. 14Q4 15Q1 15Q2
15Q3 15Q4 16Q1 Well Counts Over Time -
Our data is growing quickly. 14Q4 15Q1 15Q2
15Q3 15Q4 16Q1 Measurement Counts Over Time -
When the data about your factory is big and
growing fast… -
How do you ask ques/ons about the state of
the factory today? -
How do you ask ques/ons about the past so
you can learn from it? -
Data Model Implica/ons For End Users Asking ques&ons requires
in&mate knowledge of the data model. -
Data Model Implica/ons For End Users Asking ques&ons requires
in&mate knowledge of the data model. Asking ques&ons requires in&mate knowledge of SQL. -
The SQL Answer SELECT p.id AS
plate_id FROM strains st LEFT JOIN samples sa ON sa.content_id = st.id LEFT JOIN aliquot_components ac ON ac.item_id = sa.id AND ac.canceled = 0 LEFT JOIN aliquots a ON a.id = ac.aliquot_id LEFT JOIN wells w ON w.ac&ve_aliquot_id = a.id LEFT JOIN plates p ON p.id = w.plate_id WHERE st.id = 7000000000 -
Elas/csearch supports our use cases. Denormaliza&on at index &me,
combined with the Search Lite DSL, makes it easy for our users to ask ques&ons. -
Architecture Factory Web Applica&on Zymergen REST API
Rela&onal Database Elas&csearch -
Architecture Factory Web Applica&on Zymergen REST API
Rela&onal Database Elas&csearch Built in Java -
Architecture Factory Web Applica&on Zymergen REST API
Rela&onal Database Elas&csearch Uses Hibernate for DB interac&on -
Architecture Factory Web Applica&on Zymergen REST API
Rela&onal Database Elas&csearch Jackson library for JSON descriptors -
Architecture Factory Web Applica&on Zymergen REST API
Rela&onal Database Elas&csearch Use Java annota&ons on descriptors to control type mapping and search document serializa&on. -
Search Annota/ons: Marking Descriptors as Search Documents @SearchDocument
public class StrainDescriptor { // Descriptor implementation // … } -
Search Annota/ons: Marking Descriptors as Search Documents @SearchDocument
public class StrainDescriptor { // Descriptor implementation // … } Indicates this type will be indexed for search. -
Search Annota/ons: Indexing Descriptor Fields @IndexedField public long getId()
{ return this.id; } @IndexedField(name = “desc”) public String getDescription() { return this.name; } -
Search Annota/ons: Indexing Descriptor Fields @IndexedField public long getId()
{ return this.id; } @IndexedField(name = “desc”) public String getDescription() { return this.name; } Indicates this field will be included in the search document. -
Search Annota/ons: Indexing Descriptor Fields @IndexedField public long getId()
{ return this.id; } @IndexedField(name = “desc”) public String getDescription() { return this.name; } Control name of field in search document. -
Search Annota/ons: Document References @SearchDocumentReference(type=UserDescriptor.class, fields={
@IncludeField(src="username", target="design_user") }) public Long getDesignUserId() { return this.designUserId; } -
Search Annota/ons: Document References @SearchDocumentReference(type=UserDescriptor.class, fields={
@IncludeField(src="username", target="design_user") }) public Long getDesignUserId() { return this.designUserId; } Marks method getDesignUserId as returning the ID of a related type. -
Search Annota/ons: Document References @SearchDocumentReference(type=UserDescriptor.class, fields={
@IncludeField(src="username", target="design_user") }) public Long getDesignUserId() { return this.designUserId; } Iden&fies the related type. -
Search Annota/ons: Document References @SearchDocumentReference(type=UserDescriptor.class, fields={
@IncludeField(src="username", target="design_user") }) public Long getDesignUserId() { return this.designUserId; } The field to include from the related type -
The Denormalizer Interface // Add arbitrary fields to a search
document. public interface Denormalizer<T> { // Declares arbitrary fields to add to document. Map<String, Class<?>> getFieldTypes(); // Provides values for those fields. Map<String, Object> getFieldValues(Dao<T> dao, T dto); } -
The Denormalizer Interface // Add arbitrary fields to a search
document. public interface Denormalizer<T> { // Declares arbitrary fields to add to document. Map<String, Class<?>> getFieldTypes(); // Provides values for those fields. Map<String, Object> getFieldValues(Dao<T> dao, T dto); } -
The Denormalizer Interface // Add arbitrary fields to a search
document. public interface Denormalizer<T> { // Declares arbitrary fields to add to document. Map<String, Class<?>> getFieldTypes(); // Provides values for those fields. Map<String, Object> getFieldValues(Dao<T> dao, T dto); } -
The Denormalizer Interface // Add arbitrary fields to a search
document. public interface Denormalizer<T> { // Declares arbitrary fields to add to document. Map<String, Class<?>> getFieldTypes(); // Provides values for those fields. Map<String, Object> getFieldValues(Dao<T> dao, T dto); } Descriptor being transformed into search document. -
The Denormalizer Interface // Add arbitrary fields to a search
document. public interface Denormalizer<T> { // Declares arbitrary fields to add to document. Map<String, Class<?>> getFieldTypes(); // Provides values for those fields. Map<String, Object> getFieldValues(Dao<T> dao, T dto); } Database can be used to generate field values. -
Search Annota/ons: Denormalizers @SearchDocument(denormalizer=PlateDenormalizer.class) public class PlateDescriptor {
// Descriptor implementation // … } -
Search Annota/ons: Denormalizers @SearchDocument(denormalizer=PlateDenormalizer.class) public class PlateDescriptor {
// Descriptor implementation // … } Afach a denormalizer to a type. -
Type Mapping Genera/on @SearchDocument(denormalizer=PlateDenormalizer.class) public class PlateDescriptor {
@IndexedField public Long getId() {} @IndexedField public String getDescription {} @SearchDocumentReference(type=UserDescriptor.class, fields={ @IncludeField(src="username", target="design_user") }) public Long getDesignUserId() {} } -
@SearchDocument(denormalizer=PlateDenormalizer.class) public class PlateDescriptor { @IndexedField
public Long getId() {} @IndexedField public String getDescription {} @SearchDocumentReference(type=UserDescriptor.class, fields={ @IncludeField(src="username", target="design_user") }) public Long getDesignUserId() {} } Type Mapping Genera/on -
@SearchDocument(denormalizer=PlateDenormalizer.class) public class PlateDescriptor { @IndexedField
public Long getId() {} @IndexedField public String getDescription {} @SearchDocumentReference(type=UserDescriptor.class, fields={ @IncludeField(src="username", target="design_user") }) public Long getDesignUserId() {} } Type Mapping Genera/on Type Mapping Generator (Java Code) -
@SearchDocument(denormalizer=PlateDenormalizer.class) public class PlateDescriptor { @IndexedField
public Long getId() {} @IndexedField public String getDescription {} @SearchDocumentReference(type=UserDescriptor.class, fields={ @IncludeField(src="username", target="design_user") }) public Long getDesignUserId() {} } Type Mapping Genera/on Type Mapping Generator (Uses Annota&ons, Method Names, and Return Types) -
@SearchDocument(denormalizer=PlateDenormalizer.class) public class PlateDescriptor { @IndexedField
public Long getId() {} @IndexedField public String getDescription {} @SearchDocumentReference(type=UserDescriptor.class, fields={ @IncludeField(src="username", target="design_user") }) public Long getDesignUserId() {} } Type Mapping Genera/on Type Mapping Generator (Uses Field Mapping From Reference Documents) -
@SearchDocument(denormalizer=PlateDenormalizer.class) public class PlateDescriptor { @IndexedField
public Long getId() {} @IndexedField public String getDescription {} @SearchDocumentReference(type=UserDescriptor.class, fields={ @IncludeField(src="username", target="design_user") }) public Long getDesignUserId() {} } Type Mapping Genera/on Type Mapping Generator (Calls getFieldTypes() on the Denormalizer) public interface Denormalizer<T> { Map<String, Class<?>> getFieldTypes(); Map<String, Object> getFieldValues(Dao<T> dao, T dto); } -
@SearchDocument(denormalizer=PlateDenormalizer.class) public class PlateDescriptor { @IndexedField
public Long getId() {} @IndexedField public String getDescription {} @SearchDocumentReference(type=UserDescriptor.class, fields={ @IncludeField(src="username", target="design_user") }) public Long getDesignUserId() {} } Type Mapping Genera/on Type Mapping Generator "plate": { "properties": { “id": { "type": “long“ } “description": { "type": "string“ } “design_user”: { “type”: “string” } } } -
@SearchDocument(denormalizer=PlateDenormalizer.class) public class PlateDescriptor { @IndexedField
public Long getId() {} @IndexedField public String getDescription {} @SearchDocumentReference(type=UserDescriptor.class, fields={ @IncludeField(src="username", target="design_user") }) public Long getDesignUserId() {} } Document Serializa/on -
@SearchDocument(denormalizer=PlateDenormalizer.class) public class PlateDescriptor { @IndexedField
public Long getId() {} @IndexedField public String getDescription {} @SearchDocumentReference(type=UserDescriptor.class, fields={ @IncludeField(src="username", target="design_user") }) public Long getDesignUserId() {} } Document Serializa/on Document Serializer (Custom Jackson Serializer) -
@SearchDocument(denormalizer=PlateDenormalizer.class) public class PlateDescriptor { @IndexedField
public Long getId() {} @IndexedField public String getDescription {} @SearchDocumentReference(type=UserDescriptor.class, fields={ @IncludeField(src="username", target="design_user") }) public Long getDesignUserId() {} } Document Serializa/on Document Serializer (Calls Methods To Get Field Values) -
@SearchDocument(denormalizer=PlateDenormalizer.class) public class PlateDescriptor { @IndexedField
public Long getId() {} @IndexedField public String getDescription {} @SearchDocumentReference(type=UserDescriptor.class, fields={ @IncludeField(src="username", target="design_user") }) public Long getDesignUserId() {} } Document Serializa/on Document Serializer (Retrieve Reference Fields From Database) Rela&onal Database -
@SearchDocument(denormalizer=PlateDenormalizer.class) public class PlateDescriptor { @IndexedField
public Long getId() {} @IndexedField public String getDescription {} @SearchDocumentReference(type=UserDescriptor.class, fields={ @IncludeField(src="username", target="design_user") }) public Long getDesignUserId() {} } Document Serializa/on Document Serializer (Call getFieldValues() on Denormalizer) Rela&onal Database public interface Denormalizer<T> { Map<String, Class<?>> getFieldTypes(); Map<String, Object> getFieldValues(Dao<T> dao, T dto); } -
@SearchDocument(denormalizer=PlateDenormalizer.class) public class PlateDescriptor { @IndexedField
public Long getId() {} @IndexedField public String getDescription {} @SearchDocumentReference(type=UserDescriptor.class, fields={ @IncludeField(src="username", target="design_user") }) public Long getDesignUserId() {} } Document Serializa/on Document Serializer { “id”: 2000000000, “description”: “My Plate”, “design_user”: “Kiyan” } -
Fulfilling Search Queries Factory Web Applica&on Zymergen REST
API Rela&onal Database Elas&csearch Query sent to REST endpoint. -
Fulfilling Search Queries Factory Web Applica&on Zymergen REST
API Rela&onal Database Elas&csearch Elas&csearch queried for IDs of matching documents. -
Fulfilling Search Queries Factory Web Applica&on Zymergen REST
API Rela&onal Database Elas&csearch IDs of matching documents used to query database. -
Fulfilling Search Queries Factory Web Applica&on Zymergen REST
API Rela&onal Database Elas&csearch Results sent to frontend interface. -
Industrial biofactories are unlocking the future of chemical
and material produc/on.