Changeset 6469


Ignore:
Timestamp:
Nov 4, 2021, 11:26:45 AM (15 months ago)
Author:
Nicklas Nordborg
Message:

References #1347: Updates to registration of specimen handled by external lab

Changing the soft warning limits for the number of reads and improving the display by adding thousand separators.

Location:
extensions/net.sf.basedb.reggie/branches/4.33-stable/src/net/sf/basedb/reggie/plugins/cmd
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/branches/4.33-stable/src/net/sf/basedb/reggie/plugins/cmd/DemuxInfo.java

    r6240 r6469  
    3939      software = demuxSection.getRequiredEntry("Software", SoftwareValidator.INSTANCE);
    4040      readString = demuxSection.getRequiredEntry("ReadString", PatternValidator.READ_STRING);
    41       pfReads = mergeSection.getRequiredEntry("PF_READS", LongValidator.POSITIVE.warnIf(10000000l, null)); // Warn if less than 10M reads
     41      pfReads = mergeSection.getRequiredEntry("PF_READS", LongValidator.POSITIVE.warnIf(20000000l, 50000000l)); // Warn if less than 20M or more than 50M reads
    4242      reads = pfReads; //
    4343      valid = !demuxSection.hasError() && !mergeSection.hasError();
  • extensions/net.sf.basedb.reggie/branches/4.33-stable/src/net/sf/basedb/reggie/plugins/cmd/IntValidator.java

    r6217 r6469  
    104104      catch (Exception ex)
    105105      {
    106         section.addErrorMessage("Invalid integer in JSON: "+entryKey+"="+value);
     106        section.addErrorMessage("Invalid "+entryKey+" in JSON: "+value);
    107107      }
    108108    }
     
    111111      if (minValue != null && result < minValue)
    112112      {
    113         section.addErrorMessage("Invalid integer in JSON: "+entryKey+"="+value+" (expected >="+minValue+")");
     113        section.addErrorMessage("Invalid "+entryKey+" in JSON: "+value+" (expected >="+minValue+")");
    114114        result = null;
    115115      }
    116116      if (maxValue != null && result > maxValue)
    117117      {
    118         section.addErrorMessage("Invalid integer in JSON: "+entryKey+"="+value+" (expected <="+maxValue+")");
     118        section.addErrorMessage("Invalid "+entryKey+" in JSON: "+value+" (expected <="+maxValue+")");
    119119        result = null;
    120120      }
     
    123123        if (allowed.indexOf(result) == -1)
    124124        {
    125           section.addErrorMessage("Invalid integer in JSON: "+entryKey+"="+value+" (expected one of "+allowed+")");
     125          section.addErrorMessage("Invalid "+entryKey+" in JSON: "+value+" (expected one of "+allowed+")");
    126126          result = null;
    127127        }
     
    132132      if (softMin != null && result < softMin)
    133133      {
    134         section.addWarningMessage("Unexpected integer in JSON: "+entryKey+"="+value+" (expected >="+softMin+")");
     134        section.addWarningMessage("Low value for "+entryKey+" in JSON: "+value+" (expected >="+softMin+")");
    135135      }
    136136      if (softMax != null && result > softMax)
    137137      {
    138         section.addWarningMessage("Unexpected integer in JSON: "+entryKey+"="+value+" (expected <="+softMax+")");
     138        section.addWarningMessage("High value for "+entryKey+" in JSON: "+value+" (expected <="+softMax+")");
    139139      }
    140140    }
  • extensions/net.sf.basedb.reggie/branches/4.33-stable/src/net/sf/basedb/reggie/plugins/cmd/LongValidator.java

    r6459 r6469  
    22
    33import java.util.List;
     4import java.util.Locale;
    45
    56import net.sf.basedb.core.DbControl;
     
    119120      catch (Exception ex)
    120121      {
    121         section.addErrorMessage("Invalid long in JSON: "+entryKey+"="+value);
     122        section.addErrorMessage("Invalid "+entryKey+" in JSON: "+value);
    122123      }
    123124    }
     
    126127      if (minValue != null && result < minValue)
    127128      {
    128         section.addErrorMessage("Invalid long in JSON: "+entryKey+"="+value+" (expected >="+minValue+")");
     129        section.addErrorMessage("Invalid "+entryKey+" in JSON: "+String.format(Locale.US, "%,d", value)+" (expected >="+String.format(Locale.US, "%,d", minValue)+")");
    129130        result = null;
    130131      }
    131132      if (maxValue != null && result > maxValue)
    132133      {
    133         section.addErrorMessage("Invalid long in JSON: "+entryKey+"="+value+" (expected <="+maxValue+")");
     134        section.addErrorMessage("Invalid "+entryKey+" in JSON: "+String.format(Locale.US, "%,d", value)+" (expected <="+String.format(Locale.US, "%,d", maxValue)+")");
    134135        result = null;
    135136      }
     
    138139        if (allowed.indexOf(result) == -1)
    139140        {
    140           section.addErrorMessage("Invalid long in JSON: "+entryKey+"="+value+" (expected one of "+allowed+")");
     141          section.addErrorMessage("Invalid "+entryKey+" in JSON: "+value+" (expected one of "+allowed+")");
    141142          result = null;
    142143        }
     
    147148      if (softMin != null && result < softMin)
    148149      {
    149         section.addWarningMessage("Unexpected long in JSON: "+entryKey+"="+value+" (expected >="+softMin+")");
     150        section.addWarningMessage("Low value for "+entryKey+" in JSON: "+String.format(Locale.US, "%,d", value)+" (expected >="+String.format(Locale.US, "%,d", softMin)+")");
    150151      }
    151152      if (softMax != null && result > softMax)
    152153      {
    153         section.addWarningMessage("Unexpected long in JSON: "+entryKey+"="+value+" (expected <="+softMax+")");
     154        section.addWarningMessage("High value for "+entryKey+" in JSON: "+String.format(Locale.US, "%,d", value)+" (expected <="+String.format(Locale.US, "%,d", softMax)+")");
    154155      }
    155156    }
Note: See TracChangeset for help on using the changeset viewer.