/usr/bin/python /opt/gls/clarity/customextensions/checkprocessFields.py -l 122-7953 -u admin -p securepassword -f 'field Name 1, field Name 2, field Name N' // Reagent Adapters
public static final def ADAPTERS = [
(1): 'AD001 (ATCACG)', (2): 'AD002 (CGATGT)', (3): 'AD003 (TTAGGC)',
(4): 'AD004 (TGACCA)', (5): 'AD005 (ACAGTG)', (6): 'AD006 (GCCAAT)',
(7): 'AD007 (CAGATC)', (8): 'AD008 (ACTTGA)', (9): 'AD009 (GATCAG)'...]
// Pooling Combinations
public static final def TWO_PLEX_PATTERNS = [
[ADAPTERS[6], ADAPTERS[12]], // Combination 1
[ADAPTERS[5], ADAPTERS[19]] // Combination 2
]
....
public static final def PATTERNS = [TWO_PLEX_PATTERNS, THREE_PLEX_PATTERNS, FOUR_PLEX_PATTERNS]Boolean noWildcardsMatch(List disposableList, def combination) {
if(disposableList.containsAll(combination)) {
disposableList.removeAll(combination)
// Ensure that there are no other reagent-labels in the pool that may conflict with the pattern
return !disposableList.find { leftoverReagent -> ADAPTERS.containsValue(leftoverReagent) }
}
return false
}// If a pool failed validation, report the message to the user and halt their progress
if(failure) {
throw new Exception(errorMessage + 'Please consult the Illumina TruSeq adapter pooling guidelines.')
}
// Define the success message to the user
outputMessage = "Script has completed successfully.${LINE_TERMINATOR}All ${validatedPools} pools passed Illumina low-plexity pooling guidelines."bash -c "/opt/gls/groovy/current/bin/groovy -cp /opt/groovy/lib /opt/gls/clarity/customextensions/ConfirmationOfPoolComposition.groovy -i {stepURI:v2:http} -u {username} -p {password}"Boolean wildCardMatch(List disposableList, def combination, int wildcards) {
// If the reagents contain the entire combination
if(disposableList.containsAll(combination)) {
disposableList.removeAll(combination)
// If there are not more reagents found in the pool than there are wildcards, return true
return (disposableList.findAll { leftoverReagent -> ADAPTERS.containsValue(leftoverReagent) }.size() == wildcards)
}
return false
}Boolean match(List reagents, int patternIndex, int wildcards = 0) {
Boolean matches = false
// If there are wild cards, handle them separately
if(wildcards == 0) {
// For each combination, check for a match
PATTERNS[patternIndex].each {
if(noWildcardsMatch(reagents, it)) {
matches = true
}
}
} else {
PATTERNS[patternIndex].each {
if(wildCardMatch(reagents, it, wildcards)) {
matches = true
}
}
}
// If there was no match, determine if a match is found with an easier set of restrictions
if(!matches && patternIndex != 0) {
matches = match(reagents, patternIndex - 1, wildcards + 1)
}
return matches
}// Retrieve the pooling information
Node pooling = GLSRestApiUtils.httpGET(stepURI + '/pools', username, password)
// Collect all of the unique potential output pools and their number of input samples
Map poolURIs = [:]
pooling.'pooled-inputs'.'pool'.each {
String poolURI = it.@'output-uri'
poolURIs[poolURI] = it.'input'.size()
}
// Retrieve the pool artifacts
def poolNodes = GLSRestApiUtils.batchGET(poolURIs.keySet(), username, password)// Verify that each pool contains acceptable reagent labels
Boolean failure = false
String errorMessage = ''
poolNodes.each {
Boolean accepted = verifyReagents(it, poolURIs[GLSRestApiUtils.stripQuery(it.@uri)])
if(accepted) {
validatedPools++
} else {
failure = true
errorMessage = errorMessage + "${it.'name'[0].text()} has an invalid combination of Illumina Adapters.${LINE_TERMINATOR}"
}
}/usr/bin/python /opt/gls/clarity/customextensions/checkIndexes.py -l 122-7953 -u admin -p securepassword -s http://192.168.9.123:8080/api/v2/steps/122-5601/usr/bin/python /opt/gls/clarity/customextensions/validateContainerNames.py -l 122-7953 -u admin -p securepassword -s http://192.168.9.123:8080/api/v2/steps/122-5601Â if cName == cLUID:
         containers.append( cName )
      else:
         ## optional, additional validation here
         if len(cName) < 10:
            containers.append( cName )   


