Skip to content

Commit

Permalink
Update coordinates code
Browse files Browse the repository at this point in the history
  • Loading branch information
Fawaz Ghali committed Feb 5, 2016
1 parent c5d8b90 commit 9cea8b2
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 14 deletions.
6 changes: 4 additions & 2 deletions README.txt
@@ -1,8 +1,10 @@



MzidLib - A library of routines for manipulating data in the PSI's mzIdentML standard.
ProteoAnnotator is a completely automated software pipeline for integration of mass spectrometry (MS) based proteomic evidence into genome databases.



To download MzidLib and ProteoAnnotator: http://www.proteoannotator.org/?q=installation


Citation:
Expand Down
Binary file removed documentation/~$oteoAnnotator_user_guide.docx
Binary file not shown.
6 changes: 3 additions & 3 deletions nbactions.xml
Expand Up @@ -10,7 +10,7 @@
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-Xmx10G -classpath %classpath uk.ac.liv.mzidlib.MzIdentMLLib ProteoAnnotator -inputGFF Homo_sapiens.GRCh38.77.gff3 -inputFasta Homo_sapiens.GRCh38.pep.all.fa -spectrum_files /home/fawaz/pilot/green/PXD000561/Adult_Adrenalgland_Gel_Velos_2_f13.mgf -outputFolder /home/fawaz/pilot/green/PXD000561/withoutmsgf -prefix PXD000561_withoutmsgf_ -compress false -searchParameters green_nomods.txt -peptideThreshValue 0.01 -proteinThreshValue 0.01 -inputPredicted "Homo_sapiens.GRCh38.77.abinitio.gff3;Homo_sapiens.GRCh38.pep.abinitio.fa" -enableMsgf true</exec.args>
<exec.args>-Xmx10G -classpath %classpath uk.ac.liv.mzidlib.MzIdentMLLib AddGenomeCoordinatesForPeptides E:\tobias\PXD000764\34937\PXD000764_34937_combined_fdr_peptide_threshold.mzid E:\tobias\fawaz.mzid -inputGff E:\tobias\Homo_sapiens.GRCh38.77.gff3 -outputGff E:\tobias\fawaz.gff3</exec.args>
<exec.executable>java</exec.executable>
<skipTests>true</skipTests>
</properties>
Expand All @@ -25,7 +25,7 @@
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -Xmx10G -classpath %classpath uk.ac.liv.mzidlib.MzIdentMLLib ProteoAnnotator -inputGFF Homo_sapiens.GRCh38.77.gff3 -inputFasta Homo_sapiens.GRCh38.pep.all.fa -spectrum_files /home/fawaz/pilot/green/PXD000561/Adult_Adrenalgland_Gel_Velos_2_f13.mgf -outputFolder /home/fawaz/pilot/green/PXD000561/withoutmsgf -prefix PXD000561_withoutmsgf_ -compress false -searchParameters green_nomods.txt -peptideThreshValue 0.01 -proteinThreshValue 0.01 -inputPredicted "Homo_sapiens.GRCh38.77.abinitio.gff3;Homo_sapiens.GRCh38.pep.abinitio.fa" -enableMsgf true</exec.args>
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -Xmx10G -classpath %classpath uk.ac.liv.mzidlib.MzIdentMLLib AddGenomeCoordinatesForPeptides E:\tobias\PXD000764\34937\PXD000764_34937_combined_fdr_peptide_threshold.mzid E:\tobias\fawaz.mzid -inputGff E:\tobias\Homo_sapiens.GRCh38.77.gff3 -outputGff E:\tobias\fawaz.gff3</exec.args>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
</properties>
Expand All @@ -40,7 +40,7 @@
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-Xmx10G -classpath %classpath uk.ac.liv.mzidlib.MzIdentMLLib ProteoAnnotator -inputGFF Homo_sapiens.GRCh38.77.gff3 -inputFasta Homo_sapiens.GRCh38.pep.all.fa -spectrum_files /home/fawaz/pilot/green/PXD000561/Adult_Adrenalgland_Gel_Velos_2_f13.mgf -outputFolder /home/fawaz/pilot/green/PXD000561/withoutmsgf -prefix PXD000561_withoutmsgf_ -compress false -searchParameters green_nomods.txt -peptideThreshValue 0.01 -proteinThreshValue 0.01 -inputPredicted "Homo_sapiens.GRCh38.77.abinitio.gff3;Homo_sapiens.GRCh38.pep.abinitio.fa" -enableMsgf true</exec.args>
<exec.args>-Xmx10G -classpath %classpath uk.ac.liv.mzidlib.MzIdentMLLib AddGenomeCoordinatesForPeptides E:\tobias\PXD000764\34937\PXD000764_34937_combined_fdr_peptide_threshold.mzid E:\tobias\fawaz.mzid -inputGff E:\tobias\Homo_sapiens.GRCh38.77.gff3 -outputGff E:\tobias\fawaz.gff3</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
Expand Down
15 changes: 14 additions & 1 deletion pom.xml
Expand Up @@ -263,7 +263,20 @@
</execution>
</executions>
</plugin>

<!-- TO BE ADDED: Fawaz<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
-->
<!-- Assembly plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/bgi/ipeak/IPeak.java
Expand Up @@ -127,10 +127,7 @@ public class IPeak {
private File[] xtandem_list;
private File[] omssa_list;

/**
* @param args
* @throws Exception
*/

public static void main(String[] args) throws Exception {
IPeak ip = new IPeak();
CmdLineParser parser = new CmdLineParser(ip);
Expand Down
Expand Up @@ -360,6 +360,9 @@ public void writeMappingResults() {
List<CDS_Information> outputCDS = new ArrayList();
int countCDS = 0;
boolean sorted = false;
if (gffData.get(0).getStrand().equals("-")){
sortedCDS = sortCDSAccordingToStartPositionTemp(sortedCDS);
}
for (int j = 0; j < sortedCDS.size(); j++) {
CDS_Information object = sortedCDS.get(j);
long s = object.getStart();
Expand Down Expand Up @@ -406,8 +409,14 @@ public void writeMappingResults() {
//System.out.println("END");
for (int j = 0; j < outputCDS.size(); j++) {
CDS_Information cDS_Information = outputCDS.get(j);
peptideEvidence.getUserParam().add(makeUserParam("start_map", String.valueOf(cDS_Information.getStart())));
peptideEvidence.getUserParam().add(makeUserParam("end_map", String.valueOf(cDS_Information.getEnd())));
// Added by Fawaz based on Tobias email 29/01/2016
if (j==0){
peptideEvidence.getUserParam().add(makeUserParam("start_map", String.valueOf(cDS_Information.getStart())));
peptideEvidence.getUserParam().add(makeUserParam("end_map", String.valueOf(cDS_Information.getEnd()+3)));
}else{
peptideEvidence.getUserParam().add(makeUserParam("start_map", String.valueOf(cDS_Information.getStart())));
peptideEvidence.getUserParam().add(makeUserParam("end_map", String.valueOf(cDS_Information.getEnd()+1)));
}

}

Expand Down Expand Up @@ -522,10 +531,10 @@ long[] determineTheLocationOfSeqOnCds(ProteinResults pr, List<CDS_Information> c
// Get locations from the protein object
long start = pr.getstart();
long end = pr.getEnd();

// sort the CDS collection according to the strand
List<CDS_Information> sortedCDS = sortCDSAccordingToStartPosition(cdsColl);

long mapped_start = getMappedCordinates(start, sortedCDS, pr);
long mapped_end = getMappedCordinates(end, sortedCDS, pr);
if (mapped_start == -1) {
Expand Down Expand Up @@ -623,6 +632,27 @@ List<CDS_Information> sortCDSAccordingToStartPosition(List<CDS_Information> cdsC
return cdsColl;

}

List<CDS_Information> sortCDSAccordingToStartPositionTemp(List<CDS_Information> cdsCollection) {

List<CDS_Information> cdsColl = new ArrayList<CDS_Information>(cdsCollection);




for (int i = cdsColl.size() - 1; i >= 0; i--) {
int j = cdsColl.size() - 1 - i;
if (j < i) {
CDS_Information temp = cdsColl.get(i);
cdsColl.set(i, cdsColl.get(j));
cdsColl.set(j, temp);
}
}


return cdsColl;

}

/**
*
Expand Down

0 comments on commit 9cea8b2

Please sign in to comment.