Helper functions used for sample creation
Modifiers | Name | Description |
---|---|---|
static java.lang.String |
QBIC_ENTITY_SAMPLE_CODE_SCHEMA |
|
static java.lang.String |
QBIC_SAMPLE_BARCODE_SCHEMA |
|
static java.lang.String |
QBIC_SAMPLE_ID_SCHEMA |
@deprecated this is deprecated since 2.4.0 please use QBIC_SAMPLE_BARCODE_SCHEMA instead |
private static org.apache.logging.log4j.Logger |
logger |
|
static java.util.Map<SampleType, ExperimentType> |
sampleTypesToExpTypes |
Constructor and description |
---|
SampleCodeFunctions
() |
Type Params | Return Type | Name and description |
---|---|---|
|
static char |
checksum(java.lang.String s) Computes a checksum digit for a given String. |
|
static int |
compareSampleCodes(java.lang.String c1, java.lang.String c2) |
|
static java.lang.String |
createCountString(int id, int length) Creates a string with leading zeroes from a number |
|
static java.util.List<java.lang.String> |
findAllQbicSampleCodes(java.lang.String text) Finds all QBiC sample codes in a String object. |
|
static java.lang.String |
getBarcodeRange(java.util.List<java.lang.String> ids) Returns a String denoting the range of a list of barcodes as used in QBiC |
|
static float |
getPercentageStep(int max) |
|
static java.lang.String |
getProjectPrefix(java.lang.String sample) Returns the 5 character project prefix used for samples in openBIS. |
|
static java.lang.String |
incrementSampleCode(java.lang.String code) Increments to the next sample string in the order, meaning the project code stays the same and the 3 letter number is incremented, except if it's 999, then the following letter is incremented and the number starts with 001 again. |
|
static char |
incrementUppercase(char c) Increments the value of an upper case char. |
|
static boolean |
isInteger(java.lang.String s) Checks if a String can be parsed to an Integer |
|
static boolean |
isMeasurementOfBarcode(java.lang.String code, java.lang.String type) |
|
static boolean |
isQbicBarcode(java.lang.String code) Checks if a String fits the QBiC barcode pattern and has a correct checksum |
|
static boolean |
isQbicEntityCode(java.lang.String code) Checks if a String fits the QBiC entity code pattern, as used for the species level |
|
static char |
mapToChar(int i) Maps an integer to a char representation. |
|
static java.lang.String |
max(java.lang.String a, java.lang.String b) Checks which of two Strings can be parsed to a larger Integer and returns it. |
|
static java.util.List<java.lang.Integer> |
strArrToInt(java.util.List<java.lang.String> strings) Parses a whole String list to integers and returns them in another list. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Computes a checksum digit for a given String. This checksum is weighted position-specific, meaning it will also most likely fail a check if there is a typo of the String resulting in a swapping of two numbers.
s
- String for which a checksum should be computed.Creates a string with leading zeroes from a number
id
- numberlength
- of the final stringFinds all QBiC sample codes in a String object. Only works for the codes with check digit, not for the entity codes.
text
- The text to searchReturns a String denoting the range of a list of barcodes as used in QBiC
ids
- List of code stringsReturns the 5 character project prefix used for samples in openBIS.
sample
- sample ID starting with a standard project prefix.Increments to the next sample string in the order, meaning the project code stays the same and the 3 letter number is incremented, except if it's 999, then the following letter is incremented and the number starts with 001 again.
code
- a 10 digit sample codeIncrements the value of an upper case char. When at "Z" restarts with "A".
c
- the char to be incrementedChecks if a String can be parsed to an Integer
s
- a StringChecks if a String fits the QBiC barcode pattern and has a correct checksum
code
- A String that may be a barcodeChecks if a String fits the QBiC entity code pattern, as used for the species level
code
- A String that may be a qbic entity codeMaps an integer to a char representation. This can be used for computing the checksum.
i
- number to be mappedChecks which of two Strings can be parsed to a larger Integer and returns it.
a
- a Stringb
- another StringParses a whole String list to integers and returns them in another list.
strings
- List of Strings