When importing sample data, you most provide a unique identifier for each sample record. There are three options for providing unique ids:
- Name Column - If you provide a "Name" column in the uploaded data, the server will consider this a unique identifier for each sample record.
- ID columns - Identify up to three ID columns in your uploaded data. The server will concatenate the selected columns to generate a unique sample name.
- Name Expressions - Create a unique id by concatenating a variety of elements, including fixed strings, data from the current record, and special tokens (see below for details).
Name Column
If you provide a 'Name' column in your sample set, the server will make it the unique identifier for your sample records. If the Name column contains duplicate values, the server will not be able to import your data. An example sample set using the 'Name' column:
Name | Type | Volume | VolumeUnit |
---|
S-100 | Plasma | 100 | mL |
S-200 | Plasma | 100 | mL |
S-300 | Plasma | 100 | mL |
S-400 | Plasma | 100 | mL |
To use the 'Name' column option, paste your data into the main text box. The server will automatically select 'Name' as the id column.
ID Columns
You can build a unique identifier out of the data in your table by selecting up to three id columns. The columns you select will be concatinated together to form the id. If the resulting concatenated value is not unique, the server will not be able to import the data. Below is an example sample set that uses "Lab" and "Date" to build the unique id:
Lab | Date | Type | Volume | VolumeUnit |
---|
Hanson | 2010-10-10 | Plasma | 100 | mL |
Hanson | 2010-10-11 | Plasma | 100 | mL |
AmeriLab | 2010-10-10 | Plasma | 100 | mL |
AmeriLab | 2010-10-11 | Plasma | 100 | mL |
Indicate the id columns at import time. Paste in your data table, select
ID Columns, and select up to three columns.
Name Expressions
Name expressions let you build unique ids out of a variety of different elements, including: values drawn from the sample data, string constants, random numbers, etc. See the examples of name expressions
below.
In additional to column names, the following tokens can be used:
- Inputs: A collection of all DataInputs and MaterialInputs for the current sample. You can concatenate using one or more value from the collection.
- DataInputs: A collection of all DataInputs for the current sample. You can concatenate using one or more value from the collection.
- MaterialInputs: A collection of all MaterialInputs for the current sample. You can concatenate using one or more value from the collection.
- now: The current date, which you can format using string formatters.
- batchRandomId: A four digit random number applied to the entire set of incoming sample records. On each import event, this random batch number will be regenerated.
- randomId: A four digit random number for each sample row.
- dailySampleCount: An incrementing counter, starting with the integer '1', that resets each day.
- weeklySampleCount: An incrementing counter, starting with the integer '1', that resets each week.
- montlySampleCount: An incrementing counter, starting with the integer '1', that resets each month.
- yearlySampleCount: An incrementing counter, starting with the integer '1', that resets each year.
To further manipulate the name expression tokens, use string formatters. For details see
String Expression Format Functions.
To use name expressions, paste in your data, select
Expression, and provide a name expression.
Example Name Expressions
Name Expression | Example Output | Description |
---|
${ParticipantId}_${Barcode} | P1_189 P2_190 P3_191 P4_192 | ParticipantId + Barcode. |
${Lab:defaultValue('Unknown')}_${Barcode} | Hanson_189 Hanson_190 Krouse_191 Unknown_192 | Lab + Barcode. If the Lab value is null, then use the string 'Unknown'. |
S_${randomId} | S_3294 S_1649 S_9573 S_8843 | Random numbers. |
S_${now:date}_${dailySampleCount} | S_20170202_1 S_20170202_2 S_20170202_3 S_20170202_4 | Date + incrementing integer. |
Assume that the name expressions above are applied to the following sample set:
Plasma Samples
Barcode | Type | DrawDate | ParticipantId | MaterialInputs/Reagents | Lab |
---|
189 | Plasma | 1/1/2010 | P1 | RegA | Hanson |
190 | Plasma | (null) | P2 | RegB | Hanson |
191 | Plasma | 1/3/2010 | P3 | (null) | Krouse |
192 | Plasma | 1/4/2010 | P4 | RegD, RegX, RegY | (null) |
Name Expressions Used with String Modifiers
The following name expressions are used in combination with
string modifiers.
Name Expression00000000000000000000000000000000000000000000000 | Example Output000000000000000000 | Description |
---|
S_${Column1}_${Column2} | S_101_102 | Create an id from the letter 'S' and two values from the current row of data, separated by underscore characters. |
S-${Column1}-${now:date}-${batchRandomId} | S-1-20170103-9001 | |
S-${Column1:suffix('-')}${Column2:suffix('-')}${batchRandomId} | S-2-4-5862 | |
${Column1:defaultValue('S')}-${now:date('yy-MM-dd')}-${randomId} | 2-17-01-03-1166 | ${Column1:defaultValue('S')} means 'Use the value of Column1, but if that is null, then use the default: the letter S' |
${DataInputs:first:defaultValue('S')}-${Column1} | Nucleotide1-5 | ${DataInputs:first:defaultValue('S')} means 'Use the first DataInput value, but if that is null, use the default: the letter S' |
${DataInputs:join('_'):defaultValue('S')}-${Column1} | Nucleotide1_Nucleotide2-1 | ${DataInputs:join('_'):defaultValue('S')} means 'Join together all of the DataInputs separated by undescores, but if that is null, then use the default: the letter S' |