Skip to content
Snippets Groups Projects
Commit a8788c8d authored by Olivier Langella's avatar Olivier Langella
Browse files

phosphopeptide ods output revision

parent 0fb3c37b
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,28 @@ public class Utils {
+ getPappsoGroupingId(k);
}
static public String getPappsoPhosphoPeptideMassId(Group group,
SubGroup sg, PeptideMass peptideMass) throws MSMSException {
if (peptideMass == null) {
String message = "peptideMass is null";
logger.error(message);
throw new MSMSException(message);
}
if (group == null) {
String message = "group is null";
logger.error(message);
throw new MSMSException(message);
}
if (sg == null) {
String message = "sg is null";
logger.error(message);
throw new MSMSException(message);
}
return "pep" + getPappsoGroupingId(group.getNumber())
+ getPappsoGroupingId(sg.getNumber())
+ getPappsoGroupingId(peptideMass.getNumber());
}
static public String getPappsoPeptideMassId(Group group,
PeptideMass peptideMass) throws MSMSException {
if (peptideMass == null) {
......
......@@ -13,6 +13,7 @@ import fr.inra.pappso.xtandempipeline.class_msms.MapDb.Peptide;
import fr.inra.pappso.xtandempipeline.grouping.HashProtein;
import fr.inra.pappso.xtandempipeline.grouping.HashSampleScan;
import fr.inra.pappso.xtandempipeline.grouping.HashSampleScanSetPhospho;
import fr.inra.pappso.xtandempipeline.grouping.HashSampleScanSetProt;
import fr.inra.pappso.xtandempipeline.grouping.interfaces.GrpPeptide;
import fr.inra.pappso.xtandempipeline.grouping.interfaces.GrpProtMatch;
......@@ -350,4 +351,15 @@ public class Match implements Comparable<Match>, GrpProtMatch {
public Protein getGrpProtein() {
return protein_match;
}
public ArrayList<Peptide> getValidPeptideInPhosphoIsland(
HashSampleScanSetProt hashPhospho) throws MSMSException {
ArrayList<Peptide> peps = new ArrayList<Peptide>();
for (HashSampleScan sampleScanPhospho : hashPhospho
.getHashSampleScanList()) {
peps.addAll(this
.getAllValidPeptideToHashSampleScan(sampleScanPhospho));
}
return (peps);
}
}
......@@ -64,7 +64,7 @@ public class OdsPhosphoPeptideOutput {
throws MSMSException {
try {
odsTable = new OdsDocWriter(outputStream);
odsTable.writeSheet("peptides");
odsTable.writeSheet("phosphopeptides");
} catch (IOException e) {
String message = "IOException " + e.getMessage();
logger.error(message);
......@@ -87,7 +87,7 @@ public class OdsPhosphoPeptideOutput {
public OdsPhosphoPeptideOutput(OdsDocWriter odsTable) throws MSMSException {
try {
this.odsTable = odsTable;
odsTable.writeSheet("peptides");
odsTable.writeSheet("phosphopeptides");
} catch (XMLStreamException e) {
String message = "XMLStreamException " + e.getMessage();
logger.error(message);
......@@ -118,16 +118,17 @@ public class OdsPhosphoPeptideOutput {
odsTable.writeLine();
odsTable.writeCell("Group ID");
odsTable.writeCell("Peptide ID");
odsTable.writeCell("Sub-group ID");
odsTable.writeCell("Phosphopeptide ID");
odsTable.writeCell("Sequence");
odsTable.writeCell("Modifs");
odsTable.writeCell("Number of phosphorylations");
odsTable.writeCell("Number of phosphorylations (phosphosites)");
odsTable.writeCell("Best Position in sequence");
odsTable.writeCell("All positions");
odsTable.writeCell("Charges");
odsTable.writeCell("MH+ theo");
odsTable.writeCell("Number of subgroups");
odsTable.writeCell("Subgroup ids");
odsTable.writeCell("Number of proteins");
//odsTable.writeCell("Protein ids");
odsTable.writeCell("Number of spectra");
// odsTable.writeCell("Delta-ppm");
} catch (XMLStreamException e) {
......@@ -148,16 +149,16 @@ public class OdsPhosphoPeptideOutput {
this.writeHeaders(ident);
for (Group group : ident.getGrouping().getGroupList()) {
PeptideMassSet pepMassSet = new PeptideMassSet();
HashMap<PeptideMass, HashSet<Peptide>> hashPeptideMass2Peptides = new HashMap<PeptideMass, HashSet<Peptide>>();
int nbpeptide = 0;
for (SubGroup sg : group.getSubGroupSet().getSubGroupList()) {
PeptideMassSet pepMassSet = new PeptideMassSet();
HashMap<PeptideMass, HashSet<Peptide>> hashPeptideMass2Peptides = new HashMap<PeptideMass, HashSet<Peptide>>();
int nbpeptide = 0;
for (HashSampleScanSetProt hashProt : sg
.getHashSampleScanSetProtList()) {
for (Peptide peptide : ((Match) hashProt
for (HashSampleScanSetProt hashPhospho : sg
.getHashSampleScanSetProtSet()) {
for (Peptide peptide : ((Match) hashPhospho
.getGrpProtMatch())
.get_peptide_order_inclus_redon()) {
.getValidPeptideInPhosphoIsland(hashPhospho)) {
// first pass to index each ScanSample and give it a
// PeptideMass
nbpeptide++;
......@@ -177,17 +178,17 @@ public class OdsPhosphoPeptideOutput {
peptideList.add(peptide);
}
}
}
logger.debug("nb peptide : " + nbpeptide);
logger.debug("nb peptide : " + nbpeptide);
logger.debug("pepMassSet size : " + pepMassSet.size());
logger.debug("pepMassSet size : " + pepMassSet.size());
logger.debug("pepMassSet numbering");
pepMassSet.numbering();
logger.debug("pepMassSet numbering");
pepMassSet.numbering();
for (PeptideMass pepMass : pepMassSet) {
this.writeOnePeptideMass(ident, group, pepMass,
hashPeptideMass2Peptides.get(pepMass));
for (PeptideMass pepMass : pepMassSet) {
this.writeOnePeptideMass(ident, group, sg, pepMass,
hashPeptideMass2Peptides.get(pepMass));
}
}
}
......@@ -208,7 +209,7 @@ public class OdsPhosphoPeptideOutput {
}
private void writeOnePeptideMass(Identification ident, Group group,
PeptideMass pepMass, HashSet<Peptide> peptideSet)
SubGroup sg, PeptideMass pepMass, HashSet<Peptide> peptideSet)
throws MSMSException {
try {
logger.debug("writeOnePeptideMass begin " + group + pepMass);
......@@ -226,8 +227,9 @@ public class OdsPhosphoPeptideOutput {
*/
// odsTable.writeCell("Group ID");
odsTable.writeCell(Utils.getPappsoGroupId(group));
odsTable.writeCell(Utils.getPappsoSubGroupId(group, sg));
// odsTable.writeCell("Peptide ID");
odsTable.writeCell(Utils.getPappsoPeptideMassId(group, pepMass));
odsTable.writeCell(Utils.getPappsoPhosphoPeptideMassId(group,sg, pepMass));
// odsTable.writeCell("Sequence");
odsTable.writeCell(pepMass.getSequenceLi());
// odsTable.writeCell("Modifs");
......@@ -267,16 +269,18 @@ public class OdsPhosphoPeptideOutput {
// odsTable.writeCell("MH+ theo");
odsTable.writeCell(bestPeptide.get_mhplus_theo());
SubGroupSet sgList = pepMass.getSubGroupSet();
//SubGroupSet sgList = pepMass.getSubGroupSet();
// odsTable.writeCell("Number of subgroups");
odsTable.writeCell(sgList.size());
odsTable.writeCell(sg.getHashSampleScanSetProtSet().size());
/*
TreeSet<String> sgIds = new TreeSet<String>();
for (SubGroup sg : sgList) {
sgIds.add(Utils.getPappsoSubGroupId(group, sg));
}
// odsTable.writeCell("Subgroup ids");
odsTable.writeCell(Utils.collectionToString(sgIds));
*/
// odsTable.writeCell("Number of spectra");
odsTable.writeCell(pepMass.getHashSampleScanSet().size());
......
......@@ -55,7 +55,7 @@ public class OdsPhosphoProteinOutput {
throws MSMSException {
try {
odsTable = new OdsDocWriter(outputStream);
odsTable.writeSheet("proteins");
odsTable.writeSheet("phosphoislands");
} catch (IOException e) {
String message = "IOException " + e.getMessage();
logger.error(message);
......@@ -78,7 +78,7 @@ public class OdsPhosphoProteinOutput {
public OdsPhosphoProteinOutput(OdsDocWriter odsTable) throws MSMSException {
try {
this.odsTable = odsTable;
odsTable.writeSheet("proteins");
odsTable.writeSheet("phosphoislands");
} catch (XMLStreamException e) {
String message = "XMLStreamException " + e.getMessage();
logger.error(message);
......@@ -108,14 +108,14 @@ public class OdsPhosphoProteinOutput {
odsTable.writeLine();
odsTable.writeCell("Group ID");
odsTable.writeCell("Sub-group ID");
odsTable.writeCell("PhosphoIsland ID");
odsTable.writeCell("Phosphosite ID");
odsTable.writeCell("Description");
odsTable.writeCell("MW");
odsTable.writeCell("Positions");
odsTable.writeCell("Phosphosites positions");
odsTable.writeCell("Spectra");
odsTable.writeCell("Uniques");
odsTable.writeCell("number of proteins in this sharing this phosphosite");
odsTable.writeCell("number of proteins sharing these phosphosites");
} catch (XMLStreamException e) {
String message = "XMLStreamException in writeHeaders() "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment