Register LNPs from Benchling

# pip install git+https://github.com/laminlabs/sentseqdb.git
import lamindb as ln
import sentseqdb as sq
from sentseqdb.benchling import BenchlingConnector
 connected lamindb: testuser1/test-sentseqdb

Initialize the BenchlingConnector

from benchling_sdk.benchling import Benchling
from benchling_sdk.auth.client_credentials_oauth2 import ClientCredentialsOAuth2
import os

# create a benchling object
benchling = Benchling(
    url="https://navatx.benchling.com/",
    auth_method=ClientCredentialsOAuth2(
        client_id=os.environ["BENCHLING_CLIENT_ID"],
        client_secret=os.environ["BENCHLING_CLIENT_SECRET"],
    ),
)
connector = BenchlingConnector(benchling)

Get a record from Benchling

# Benchling id of a record
uid = "bfi_JXLZkNm4"
orm = sq.LNPFormulation

benchling_record = connector.get(uid, orm)
benchling_record.to_dict()
{'url': '/navatx_org/f/lib_6o0vJed2-registry/bfi_JXLZkNm4-asu-2-1-55-001/edit',
 'aliases': [],
 'apiURL': 'https://navatx.benchling.com/api/v2/custom-entities/bfi_JXLZkNm4',
 'archiveRecord': None,
 'authors': [{'handle': 'njustice', 'id': 'ent_opnJziEm', 'name': ''}],
 'createdAt': '2024-05-10T06:49:00.230799+00:00',
 'creator': {'handle': 'njustice', 'id': 'ent_opnJziEm', 'name': ''},
 'customFields': {'original LNP result ID': {'value': '3d430cd7-b475-4405-8c21-6f6feb23aca4'},
  'original entry of LNP result': {'value': 'EXP24000102'},
  'original mrna container ID': {'value': 'con_jN64CCvg'},
  'original mrna tube barcode': {'value': 'TUBE1806'}},
 'entityRegistryId': 'LNP_Form3668',
 'fields': {'5th Lipid Component Lot': {'displayValue': None,
   'isMulti': False,
   'textValue': None,
   'type': 'entity_link',
   'value': None},
  'Barcode': {'displayValue': 'GCTCAGCCTA',
   'isMulti': False,
   'textValue': 'GCTCAGCCTA',
   'type': 'entity_link',
   'value': 'seq_umV7zs9O'},
  'Cholesterol Lot': {'displayValue': 'Cholesterol-LOT001',
   'isMulti': False,
   'textValue': 'Cholesterol-LOT001',
   'type': 'entity_link',
   'value': 'mol_T0WRBAzR'},
  'Formulation Process': {'displayValue': 'Legacy Spark',
   'isMulti': False,
   'textValue': 'Legacy Spark',
   'type': 'entity_link',
   'value': 'bfi_u3wGuqKP'},
  'Ionizable Lipid Lot': {'displayValue': 'NAVA-101-LOT001',
   'isMulti': False,
   'textValue': 'NAVA-101-LOT001',
   'type': 'entity_link',
   'value': 'mol_iMmkNmWo'},
  'LNP Identity': {'displayValue': 'ASU-2.1.55',
   'isMulti': False,
   'textValue': 'ASU-2.1.55',
   'type': 'entity_link',
   'value': 'bfi_2sqCPJJV'},
  'Notes': {'displayValue': 'created as part of may 2024 data migration',
   'isMulti': False,
   'textValue': 'created as part of may 2024 data migration',
   'type': 'long_text',
   'value': 'created as part of may 2024 data migration'},
  'PEG Lot': {'displayValue': '14:0 PEG2000 PE-LOT001',
   'isMulti': False,
   'textValue': '14:0 PEG2000 PE-LOT001',
   'type': 'entity_link',
   'value': 'mol_imgZb5OV'},
  'Phospholipid Lot': {'displayValue': 'DSPC-LOT001',
   'isMulti': False,
   'textValue': 'DSPC-LOT001',
   'type': 'entity_link',
   'value': 'mol_gXfrJUeH'},
  'Study': {'displayValue': None,
   'isMulti': False,
   'textValue': None,
   'type': 'entity_link',
   'value': None},
  'Targeting Epitope Lot': {'displayValue': None,
   'isMulti': False,
   'textValue': None,
   'type': 'entity_link',
   'value': None},
  'mRNA Lot': {'displayValue': 'Dual_HA_Batch5',
   'isMulti': False,
   'textValue': 'Dual_HA_Batch5',
   'type': 'entity_link',
   'value': 'bfi_4VJpk1gB'},
  'sgRNA Lot': {'displayValue': None,
   'isMulti': False,
   'textValue': None,
   'type': 'entity_link',
   'value': None}},
 'folderId': 'lib_MLtpK6QT',
 'id': 'bfi_JXLZkNm4',
 'modifiedAt': '2024-09-28T12:32:37.387142+00:00',
 'name': 'ASU-2.1.55-001',
 'registrationOrigin': {'originEntryId': None,
  'registeredAt': '2024-05-10T06:49:00.230799+00:00'},
 'registryId': 'src_8XcPMnUA',
 'schema': {'id': 'ts_SKDXt9OA', 'name': 'LNP Formulation'},
 'webURL': 'https://navatx.benchling.com/navatx_org/f/lib_6o0vJed2-registry/bfi_JXLZkNm4-asu-2-1-55-001/edit'}

Register an LNPFormulation record in LaminDB

This automatically populates all related records.

lamindb_record = connector.save_to_lamindb(benchling_record)
! Field lot_number not found in CompoundLot, skipping
! Field molecular_weight not found in CompoundLot, skipping
! Field sku_catalog_ not found in CompoundLot, skipping
! Field formulation_process not found in LNPFormulation, skipping
! Field lot_number not found in CompoundLot, skipping
! Field molecular_weight not found in CompoundLot, skipping
! Field sku_catalog_ not found in CompoundLot, skipping
! Field cargo_targeting_epitope_ratio not found in LNPIdentity, skipping
! Field n_p_ratio not found in LNPIdentity, skipping
! Field mrna not found in LNPIdentity, skipping
! Field sgrna not found in LNPIdentity, skipping
! Field lot_number not found in CompoundLot, skipping
! Field molecular_weight not found in CompoundLot, skipping
! Field sku_catalog_ not found in CompoundLot, skipping
! Field lot_number not found in CompoundLot, skipping
! Field molecular_weight not found in CompoundLot, skipping
! Field sku_catalog_ not found in CompoundLot, skipping
! Field notes not found in mRNAlot, skipping
! Field plasmid not found in mRNAlot, skipping
! Field plasmid_lot not found in mRNAlot, skipping
! Field synthesis_protocols not found in mRNAlot, skipping
! Field n3_utr not found in mRNA, skipping
! Field n5_utr not found in mRNA, skipping
! Field plasmid not found in mRNA, skipping

Check direct fields:

lamindb_record.uid
'bfi_JXLZkNm4'
lamindb_record.name
'ASU-2.1.55-001'
lamindb_record.notes
'created as part of may 2024 data migration'

Check related records:

lamindb_record.lnp_identity
LNPIdentity(uid='bfi_2sqCPJJV', name='ASU-2.1.55', ionizable_lipid_mole_=45.0, cholesterol_mole_=44.0, peg_lipid_mole_=2.0, phospholipid_mole_=9.0, space_id=1, ionizable_lipid_id_id=2, cholesterol_id_id=1, peg_lipid_id_id=3, phospholipid_id_id=4)
lamindb_record.cholesterol_lot
CompoundLot(uid='mol_T0WRBAzR', name='Cholesterol-LOT001', vendor='Avanti Lipids', formula_mass=386.664, initial_nmr='[]', initial_lcms='[]', reaction_path='[]', additional_attachments='[]', space_id=1, compound_id=1)
lamindb_record.peg_lot
CompoundLot(uid='mol_imgZb5OV', name='14:0 PEG2000 PE-LOT001', vendor='Avanti Polar Lipids', formula_mass=2693.32, initial_nmr='[]', initial_lcms='[]', reaction_path='[]', additional_attachments='[]', space_id=1, compound_id=3)
lamindb_record.phospholipid_lot
CompoundLot(uid='mol_gXfrJUeH', name='DSPC-LOT001', vendor='Avanti Lipids', formula_mass=790.145, initial_nmr='[]', initial_lcms='[]', reaction_path='[]', additional_attachments='[]', space_id=1, compound_id=4)
lamindb_record.barcode
Barcode(uid='seq_umV7zs9O', name='GCTCAGCCTA', space_id=1)

Check all added records in LaminDB:

ln.view(modules="sentseqdb")
ADTBarcodes
uid name concentration clone species_reactivity payload_sentseq_align space_id _aux _branch_code
id
1 seq_oigcgwiR aVHH-isotype None Rabbit IgG control sfso_N2OJeFSS None 1 None 1
Barcode
uid name description space_id _aux _branch_code
id
1 seq_umV7zs9O GCTCAGCCTA None 1 None 1
Compound
uid name type number_of_ionizable_amines structure has_this_lipid_been_previously_screened design_series design_set space_id _aux _branch_code
id
4 mol_EGPd7ouY DSPC sfso_ptdVXfbi NaN ['72dee15c-fa38-4a8b-a4f2-2e9b02c68538'] None sfso_DdB7k1wm N/A 1 None 1
3 mol_1oHdLCNI 14:0 PEG2000 PE sfso_zZeX1DAt NaN ['a0453622-5b01-4320-aa4d-72207ac83af2'] None sfso_DdB7k1wm N/A 1 None 1
2 mol_PcjiZpzx PME-002-191 sfso_WnhcaabR 2.0 ['3c5b726e-d3e8-447d-ae48-b18d46841741'] sfso_HbjQc34F sfso_7l71Cx9A Maleimides 1 None 1
1 mol_OEAHjTyc Cholesterol sfso_rA0D4rtZ NaN ['cbcd28ab-a82b-4101-a92b-713c23b15894'] None sfso_DdB7k1wm N/A 1 None 1
CompoundLot
uid name vendor formula_mass salt initial_nmr initial_lcms purity_ total_synthesis_amount_mg reaction_path additional_attachments vendor_and_sku_catalog_ vendor_lot space_id compound_id _aux _branch_code
id
4 mol_gXfrJUeH DSPC-LOT001 Avanti Lipids 790.145 None [] [] None None [] [] None None 1 4 None 1
3 mol_imgZb5OV 14:0 PEG2000 PE-LOT001 Avanti Polar Lipids 2693.320 None [] [] None None [] [] None None 1 3 None 1
2 mol_iMmkNmWo NAVA-101-LOT001 None 774.360 None ['00a1b548-6313-4c80-8cc8-50f9d51ea0c7'] [] None None [] [] None None 1 2 None 1
1 mol_T0WRBAzR Cholesterol-LOT001 Avanti Lipids 386.664 None [] [] None None [] [] None None 1 1 None 1
HTObarcodes
uid name antibody concentration clone species_reactivity space_id _aux _branch_code
id
1 seq_3zTG56qb DEPRICATED Mouse HTO 1 H-2 1.0 M1/42 sfso_30Eey9Vx 1 None 1
LNPFormulation
uid name notes space_id lnp_identity_id ionizable_lipid_lot_id cholesterol_lot_id peg_lot_id phospholipid_lot_id n5th_lipid_component_lot_id targeting_epitope_lot_id mrna_lot_id sgrna_lot_id barcode_id study_id _aux _branch_code
id
1 bfi_JXLZkNm4 ASU-2.1.55-001 created as part of may 2024 data migration 1 1 2 1 3 4 None None 1 None 1 None None 1
LNPIdentity
uid name lnp_number chemical_class screen_number iteration_number ionizable_lipid_mole_ cholesterol_mole_ peg_lipid_mole_ phospholipid_mole_ n5th_lipid_component_mole_ lipid_rna_mass_ratio space_id ionizable_lipid_id_id cholesterol_id_id peg_lipid_id_id phospholipid_id_id n5th_lipid_component_id_id targeting_epitope_identity_id _aux _branch_code
id
1 bfi_2sqCPJJV ASU-2.1.55 None None None None 45.0 44.0 2.0 9.0 None None 1 2 1 3 4 None None None 1
mRNA
uid name description cleancap notes space_id _aux _branch_code
id
1 seq_dvBAh0Yt Dual_HA_aVHH_mRNA None None None 1 None 1
mRNAlot
uid name manufacture_date vendor vendor_lot space_id mrna_id _aux _branch_code
id
1 bfi_4VJpk1gB Dual_HA_Batch5 None None None 1 1 None 1

Bionty registries

Create a Bionty record from public ontology:

import bionty as bt
tissue = bt.Tissue.from_source(name="brain")
tissue.save()
Tissue(uid='1fIFAQJY', name='brain', ontology_id='UBERON:0000955', description='The Brain Is The Center Of The Nervous System In All Vertebrate, And Most Invertebrate, Animals. Some Primitive Animals Such As Jellyfish And Starfish Have A Decentralized Nervous System Without A Brain, While Sponges Lack Any Nervous System At All. In Vertebrates, The Brain Is Located In The Head, Protected By The Skull And Close To The Primary Sensory Apparatus Of Vision, Hearing, Balance, Taste, And Smell[Wp].', space_id=1, created_by_id=1, source_id=41, created_at=2025-03-11 14:49:48 UTC)
sq_tissue = sq.Tissue(bionty_id=tissue.id, uid=tissue.uid, name=tissue.name).save()
sq_tissue.bionty
Tissue(uid='1fIFAQJY', name='brain', ontology_id='UBERON:0000955', description='The Brain Is The Center Of The Nervous System In All Vertebrate, And Most Invertebrate, Animals. Some Primitive Animals Such As Jellyfish And Starfish Have A Decentralized Nervous System Without A Brain, While Sponges Lack Any Nervous System At All. In Vertebrates, The Brain Is Located In The Head, Protected By The Skull And Close To The Primary Sensory Apparatus Of Vision, Hearing, Balance, Taste, And Smell[Wp].', space_id=1, created_by_id=1, source_id=41, created_at=2025-03-11 14:49:48 UTC)
Hide code cell content
# clean up test instance
ln.setup.delete("test-sentseqdb", force=True)
!rm -rf test-sentseqdb