Where to store external links and IDs?
¶
When registering data in LaminDB, you might want to store a reference link or ID to indicate the source of the collection.
We have reference and reference_type fields for this purpose, they are available for Collection, Transform, Run and Record.
# !pip install lamindb
!lamin init --storage testreference
Show code cell output
→ initialized lamindb: testuser1/testreference
import lamindb as ln
Show code cell output
→ connected lamindb: testuser1/testreference
Let’s say we have a few donor samples that came form Vendor X, in order to chase back the orders, I’d like to keep track the donor ids provided by the vendor:
ln.Record(
name="donor 001", reference="VX984545", reference_type="Donor ID from Vendor X"
)
Show code cell output
Record(uid='ryLC2EBitsVQ3Jx1', is_type=False, name='donor 001', description=None, reference='VX984545', reference_type='Donor ID from Vendor X', extra_data=None, branch_id=1, space_id=1, created_by_id=3, type_id=None, schema_id=None, run_id=None, created_at=<django.db.models.expressions.DatabaseDefault object at 0x7fed5ee4ff90>, is_locked=False)
!lamin delete --force testreference