Objectives
The IP2 platform creates multiple types of quantitative output files as analysis of the data and uses tabular or graphical tools for display in web browser. The graphical web user interface is a great tool to easily access data for scientists. Meanwhile, for automation and high throughput data access, we designed IP2 API to access output files through any applications outside the IP2.
IP2 SETUP
JDK Version notes
The IP2 API supports JDK 1.7 or higher. Note that we have currently tested this implementation with JDK 1.7 and 1.8.
Installation
- Download ip2Api
- Unzip the ip2api.zip
- Set your CLASSPATH to include the “ip2api-X.X.X.jar”.
Assuming you unzipped ip2api.zip in /home the following is an example:
export CLASSPATH=$CLASSPATH:/home/ip2api/ip2api-1.0.0.jar:. - If you want to use the parser in your existing java project then add ip2api.jar file as your project library.
- Update the jdbc.properties file located in your ip2api.zip and place that in your project home directory (or in classpath)
Note : Please make sure that your machine can access the ip2_data path as stored in ip2 server database.
QUANTITATIVE TYPES
- Label-free analysis
- Isobaric labeling(TMT)
- MS1-based labeling Analysis (SILAC,Dimethyl)
IP2API usage
- Update the jdbc.properties file with the ip2 database access information.
- Fetch all projects by providing the IP2 username.
a. ProjectService.getAllProjects(“rpark”) - For each project retrieve the label free analysis results using:
a. QuantitationService.getAllLabelfree(project.getId()); - Check the label free is verified or not
a. labelfree.getVerified() - Read the label free data
a. LabelFreeStatReader labelFreeStatReader = new LabelFreeStatReader(labelfree.getCensusFilePath()); - Read the metadata (experiment) information for the QuantCompare
a. ExperimentService.getAllExperimentsForQuantitationIds(quantCompare.getQuantitationIds()); - Read the metadata (experiment) information for the Quntitation (label free)
a. ExperimentService.getAllExperiments(labelfree.getMspExperimentIds());
Service Details
- ProjectService – This will provide the information related to the project.
a. getAllProjects – Return list of projects for specific username.
b. getProject – Return a project metadata for specific id. - QuantitationService – This will provide information to read all types of quantitative data.
a. getAllLabelfree – Return list of labelfree quantitative results based on specific project id.
b. getAllSILAC – Return list of SILAC quantitation based on specific project id.
c. getAllN15 – Reurn list of N15 quantitation based on specific project id.
d. get – Return quantitation based on specific id. - ExperimentService – This will return experimental metadta details
a. getAllExperiments – Return list of experiments based on specific project id.
b. get – Return experiment based on specific id.
c. getAllExperimentsForQuantitationIds – Return list of Experiment objects based on the provided quantitation ids. quantitationIds can be multiple delimated by the space.
d. getAllExperiments – Return list of Experiment objects based on the provided experiment ids. experimentIds can be multiple delimated by the space. - QuantCompareService – This will provide information related to QuantCompare.
a. list – Return list of quantcompare results based on specific project id.
b. get – Return a quantcompare result based on specific id. - DbSearchService – This will returns the information related to DbSearch data.
a. get – Return DbSearch based on specific id.
Sample Code
Retrieve project list by IP2 user account name
List<Project> list = ProjectService.getAllProjects(userName);
for( Project project : list) {
// Retrieve the project information
System.out.println("Project name: " + project.getName());
System.out.println("Project id: " + project.getId());
System.out.println("Project path: " + project.getHomeFolder());
System.out.println("Project description: " + project.getDescription());
}
Retrieve a project by project id
Project project = ProjectService.getProject(projectId);
System.out.println("Project name: " + project.getName());
System.out.println("Project id: " + project.getId());
System.out.println("Project path: " + project.getHomeFolder());
System.out.println("Project description: " + project.getDescription());
Retrieve experiment list by project id
List<MspExperiment> list = ExperimentService.getAllExperiments(projectId);
for( MspExperiment exp : list) {
System.out.println("Experiment name: " + exp.getHomeFolder());
System.out.println("Sample name: " + exp.getSampleName());
}
Retrieve an experiment by experiment id
MspExperiment exp = ExperimentService.get(expId);
System.out.println("Experiment name: " + exp.getHomeFolder());
System.out.println("Sample name: " + exp.getSampleName());
Sample code for reading Label-free
for( Project project : ProjectService.getAllProjects("rpark")) {
List labelfreeList = QuantitationService.getAllLabelfree(project.getId());
// labelfreeList is a Object of Quantitation, For more available methods and fields, please check javadoc for Quantitation class.
for(Quantitation labelfree : labelfreeList){
if(labelfree.getVerified()) { // Read verified label free only.
for( MspExperiment exp : ExperimentService.getAllExperiments(labelfree.getMspExperimentIds())){
System.out.println(exp.getId()); // Please check javadoc for more Experiment methods.
}
LabelFreeStatReader labelFreeStatReader = new LabelFreeStatReader(labelfree.getCensusFilePath());
labelFreeStatReader.getPlines(); // Get the p lines of the label free
labelFreeStatReader.getRepList(); // Get the rep list of the label free
// For more methods please visit javadoc for LabelFreeStatReader
}
}
}
Sample code for reading QuantCompare
for( Project project : ProjectService.getAllProjects("rpark")) {
List annovaCompareList = QuantCompareService.getAllANOVACompare(project.getId());
for(QuantCompare quantCompare : annovaCompareList) {
for( MspExperiment exp : ExperimentService.getAllExperimentsForQuantitationIds(quantCompare.getQuantitationIds())) {
System.out.println(exp.getId());// Please check javadoc for more Experiment methods.
}
QuantStatReader reader = new QuantStatReader(quantCompare.getId(), quantCompare.getPath());
System.out.println(reader.getQuantAnovaCompares().size());
}
}
Please check Javadoc for more detailed methods and fields information.
Post your comment on this topic.