×
Maintenance Notice: labkey.org will be offline on Wednesday, March 12th @ 7:30pm Pacific Time for maintenance. The estimated downtime will be no more than one hour. Sorry for any inconvenience this may cause.

Naming_Pattern in Sample_Type_Properties getting "invalid substitution token" message

LabKey Support Forum (Inactive)
Naming_Pattern in Sample_Type_Properties getting "invalid substitution token" message christopher carney  2025-01-21 13:53
Status: Active
 

Hello,
I'm trying to assign the SourceID of the Parent Lineage to the Naming Pattern for the SampleID but when I use ${SourceID} I get the "Invalid substitution token" error message. In my case, I've created a Source Type "TEST01" and then manually a list of uniquely identified sources that will produce samples, so I'd like the SampleID to be a combination of the SourceID plus the unique barcode assigned to the samples that are produced from the source. I've verified that "SourceID" is the column name on the template but the Sample Type Properties Naming Pattern isn't recognizing it. What am I doing wrong and how should I proceed?
Thank you!
Chris

 
 
mohara responded:  2025-01-21 15:36

Hi Christopher:

In that image, it looks like you're attempting to edit the naming pattern for the Source Type to be the ${SourceId} which would be both ambiguous and will not generate unique names going forward even if you manipulated the fields so that worked. What I think you meant to do is to edit the Sample Type's naming pattern to include the SourceId (aka Name) of the source.

It sounds like you'd already successfully created some sources of that type, let's say TestA, TestB, etc. - so your next step will be to edit (or create) the Sample Type's naming pattern to include it. There are a few ways to do so, one simple one is to include a source in the sample type properties. You provide a "file import column name" (aka a source alias) that you can then use in your naming pattern.

For example, edit the Sample Type and add a source of type "Test01", using "TestSourceId" as the alias/import column name. If you just use a simple counter as the "barcode" element, then your naming pattern could be like this -
S-${TestSourceId}-${genId}

To get names similar to this:
S-TestA-1
S-TestA-2
S-TestB-3
S-TestB-4

There are lots more ways to incorporate lineage, different counter patterns, and more options for sample naming patterns in the documentation.

Hope that's helpful,
--Molly

 
christopher carney responded:  2025-01-21 16:07

Thanks Molly,
In this case our sources in "Test01" come from patients who are being collected longitudinally, so if 10 patients are assigned to the study and 3 visits are scheduled at the appropriate times to collect specimens, we're thinking of each visit/timepoint as the source that samples will be derived from, as shown in the attached image. At the start of the study, we will know how many patients and visits are assigned, but will not know how many specimens will be collected and barcoded until day of collection, so when we go to add the samples it will be important to see the PatientID and VisitID shown in the Naming Pattern in the Sample ID so that we can distinguish it from similar sample types coming from other studies. Is there a way that you are aware of that I can include this information the sample name?

 
christopher carney responded:  2025-01-21 16:32

Hello again, I just added source of type "Test01", using "TestSourceId" as the alias/import column name as you directed; however, not every Sample of this Type (in this case PBMC) will share the same source of type "Test01", because there will be other projects, i.e., "Test02", "Test03", etc., with different Patient Visit schedules collecting the same Sample Type (PBMC), so if I add the source of type "Test01" to the PBMC Sample Type, then the "Test01" reference will show up even for PBMC collections that aren't part of the "Test01" project.

 
christopher carney responded:  2025-01-21 16:52

Hi Molly, Here are some more screen shots. It seems that in this scenario, only the source assigned to the "TestSourceId" name will be imported to the SampleID, even when multiple source options have been assigned as options for the Sample Type. Because we would have multiple projects collecting PBMCs we need a way to get the Patient and Visit identifiers from multiple projects ported over to the Sample Name that will be assigned to the barcodes for each specimen

 
mohara responded:  2025-01-21 17:37

There are a variety of ways you might model this, and different ways that your existing system can be translated into Sample Manager.

I do want to address here that it's not true that Sources can only have 1-1 relationships with Sample Types. You can't have two File Import Column Names that are the same as each other in one Sample Type definition, but you can certainly have sources of as many types as you like and use their different names.
For example, if your "TEST##" Sources all themselves have parents of type "Patient" and "Visit", you could use ancestor naming patterns to incorporate those values, OR if the sample data now has associated Patient and Visit detail, that can be used both to generate the sample names and create the lineage you want in your sample sources.

Rather than go through various options here, I think the best next step here is to connect you directly with our Sample Manager trial support process. I'll reach out via email to make that connection.

--Molly

 
christopher carney responded:  2025-01-22 07:14

Thanks Molly!