Am using the Python package to create some samples using the domain API.
Here is some example code:
from labkey.api_wrapper import APIWrapper
labkey_server = 'localhost:8443'
container_path = 'T Cell Cloning Samples/Sequencing'
contextPath = None
schema = 'samples'
table = 'tcc_sample_handover'
api = APIWrapper(labkey_server, container_path, contextPath)
definition = {
"kind": "SampleSet",
"domainDesign": {
"name": "tcc_sample_handover",
"description": "TCC Sample Handover",
"fields": [
{"name": "Name", "rangeURI": "string"},
{"name": "hla_restriction", "rangeURI": "string"},
{"name": "tcc_sample_id", "rangeURI": "string"},
{"name": "tcc", "rangeURI": "string"},
{"name": "antigen", "rangeURI": "string"},
{"name": "peptide_sequence", "rangeURI": "string"},
{"name": "donor", "rangeURI": "string"},
{"name": "race_prep", "rangeURI": "boolean"},
{"name": "post_sort_well", "rangeURI": "string"},
{"name": "cell_per_well", "rangeURI": "string"},
{"name": "date_frozen", "rangeURI": "dateTime"}
]
}
}
result = api.domain.create(definition)
print(result)
I am unsure how I can add a naming pattern to the definition.
I've added an attachment for what the naming pattern looks like.
Here's a link to the labkey docs for naming patterns also:
https://www.labkey.org/Documentation/wiki-page.view?name=sampleIDs#:~:text=Each sample in a Sample,of the Sample Type definition.