Package org.labkey.remoteapi.assay.nab
Class NAbRunsResponse
java.lang.Object
org.labkey.remoteapi.CommandResponse
org.labkey.remoteapi.assay.nab.NAbRunsResponse
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 Summary
ConstructorsConstructorDescriptionNAbRunsResponse
(String text, int statusCode, String contentType, org.json.JSONObject json) Constructs a new CommandResponse, initialized with the provided response text and status code. -
Method Summary
Methods inherited from class org.labkey.remoteapi.CommandResponse
findObject, getContentType, getParsedData, getProperty, getProperty, getStatusCode, getText
-
Constructor Details
-
NAbRunsResponse
Constructs a new CommandResponse, initialized with the provided response text and status code.- Parameters:
text
- The response textstatusCode
- The HTTP status codecontentType
- The response content typejson
- The parsed JSONObject (or null if JSON was not returned)
-
-
Method Details
-
getRuns
-
getAssayName
-
getAssayId
-
getAssayDescription
-