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
→ initialized lamindb: testuser1/testreference
import lamindb as ln
→ 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"
)
Record(uid='mDcGUwOQ9VKRck4R', name='donor 001', is_type=False, description=None, reference='VX984545', reference_type='Donor ID from Vendor X', branch_id=1, space_id=1, created_by_id=1, type_id=None, schema_id=None, run_id=None, created_at=<django.db.models.expressions.DatabaseDefault object at 0x7ff2e636a590>, is_locked=False)
!lamin delete --force testreference
• deleting instance testuser1/testreference