Class NAbRunsResponse

java.lang.Object
org.labkey.remoteapi.CommandResponse
org.labkey.remoteapi.assay.nab.NAbRunsResponse

public class NAbRunsResponse extends CommandResponse
Response class for the NAbRunsCommand. This class provides helpful getter method to access particular bits of the parsed response data. Sample usage:

 public static void main(String[] args) throws Exception
 {
     // expected parameters:
     // args[0]: username
     // args[1]: password
     Connection conn = new Connection("http://myserver/labkey", args[0], args[1]);
     double avg = getAverageNeutDilution(cn, "/home", "NAB", 50);
     System.out.println("Average dilution where 50 percent neutralization occurs: " + avg);
 }

 public static double getAverageNeutDilution(Connection cn, String folderPath, String assayName, int neutPercent) throws CommandException, IOException
 {
     NAbRunsCommand nabCommand = new NAbRunsCommand();
     nabCommand.setAssayName(assayName);
     nabCommand.setCalculateNeut(true);
     nabCommand.setIncludeFitParameters(false);
     nabCommand.setIncludeStats(false);
     nabCommand.setIncludeWells(false);
     NAbRunsResponse runResponse = nabCommand.execute(cn, folderPath);
     NAbRun[] runs = runResponse.getRuns();
     int totalSamples = 0;
     double totalDilution = 0;
     for (NAbRun run : runs)
     {
         for (NAbSample sample : run.getSamples())
         {
             for (NAbNeutralizationResult neutResult : sample.getNeutralizationResults())
             {
                 // only total non-infinite values (that is, results where we found a neutralizing dilution:
                 if (neutResult.getCutoff() == neutPercent && !Double.isInfinite(neutResult.getCurveBasedDilution()))
                 {
                     totalSamples++;
                     totalDilution += neutResult.getCurveBasedDilution();
                 }
             }
         }
     }
     return totalDilution/totalSamples;
 }
  • Constructor Details

    • NAbRunsResponse

      public NAbRunsResponse(String text, int statusCode, String contentType, org.json.JSONObject json)
      Constructs a new CommandResponse, initialized with the provided response text and status code.
      Parameters:
      text - The response text
      statusCode - The HTTP status code
      contentType - The response content type
      json - The parsed JSONObject (or null if JSON was not returned)
  • Method Details

    • getRuns

      public NAbRun[] getRuns()
    • getAssayName

      public String getAssayName()
    • getAssayId

      public Integer getAssayId()
    • getAssayDescription

      public String getAssayDescription()