org.labkey.remoteapi.assay.nab
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 Summary |
NAbRunsResponse(java.lang.String text,
int statusCode,
java.lang.String contentType,
org.json.simple.JSONObject json,
Command sourceCommand)
Constructs a new CommandResponse, initialized with the provided
response text and status code. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NAbRunsResponse
public NAbRunsResponse(java.lang.String text,
int statusCode,
java.lang.String contentType,
org.json.simple.JSONObject json,
Command sourceCommand)
- 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).sourceCommand - A copy of the command that created this response
getRuns
public NAbRun[] getRuns()
getAssayName
public java.lang.String getAssayName()
getAssayId
public java.lang.Integer getAssayId()
getAssayDescription
public java.lang.String getAssayDescription()