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

fixed and understand the treatment of best phospho positions et observed phospho positions

parent 439579ba
No related branches found
No related tags found
No related merge requests found
......@@ -24,11 +24,9 @@ import java.util.HashMap;
import org.apache.log4j.Logger;
import fr.inra.pappso.xtandempipeline.Utils;
import fr.inra.pappso.xtandempipeline.MsException.MSMSException;
import fr.inra.pappso.xtandempipeline.class_msms.MsRun;
import fr.inra.pappso.xtandempipeline.class_msms.MapDb.Peptide;
import fr.inra.pappso.xtandempipeline.grouping.Group;
import fr.inra.pappso.xtandempipeline.grouping.HashSampleScan;
import fr.inra.pappso.xtandempipeline.grouping.HashSampleScanSet;
import fr.inra.pappso.xtandempipeline.grouping.SubGroup;
......
......@@ -13,7 +13,6 @@ 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;
......@@ -352,6 +351,7 @@ public class Match implements Comparable<Match>, GrpProtMatch {
return protein_match;
}
@Override
public ArrayList<Peptide> getValidPeptideInPhosphoIsland(
HashSampleScanSetPhospho hashPhospho) throws MSMSException {
ArrayList<Peptide> peps = new ArrayList<Peptide>();
......
......@@ -114,8 +114,8 @@ public class swt_table_peptide extends swt_table_base {
if (pep.getSequence().contains(this.filter_value))
filterPeptideSet.add(hash);
} else if (this.filtercolumn.equals("Sample")) {
if (hash.getGrpMsSample().getSampleName().contains(
this.filter_value))
if (hash.getGrpMsSample().getSampleName()
.contains(this.filter_value))
filterPeptideSet.add(hash);
} else if (this.filtercolumn.equals("Modifs")) {
if (pep.get_Modifs_formater().contains(this.filter_value))
......
package fr.inra.pappso.xtandempipeline.grouping;
import java.util.ArrayList;
import java.util.Collection;
import java.util.TreeSet;
import org.apache.log4j.Logger;
import fr.inra.pappso.xtandempipeline.MsException.MSMSException;
import fr.inra.pappso.xtandempipeline.class_msms.GroupingProtein.PeptideMass;
import fr.inra.pappso.xtandempipeline.class_msms.MapDb.Peptide;
import fr.inra.pappso.xtandempipeline.grouping.interfaces.GrpPeptide;
import fr.inra.pappso.xtandempipeline.grouping.interfaces.GrpPhosphoModif;
import fr.inra.pappso.xtandempipeline.grouping.interfaces.GrpProtMatch;
......@@ -50,55 +53,95 @@ public class HashSampleScanSetPhospho extends HashSampleScanSetProt {
super.clear();
}
/*
@Override
public int compareTo(HashSampleScanSet o) {
int i = o.size() - this.size();
if (i != 0)
return i;
return (o.hashCode() - this.hashCode());
}
*/
public TreeSet<Integer> getPhosphoPositions(){
return(phosphoPositions);
/*
* @Override public int compareTo(HashSampleScanSet o) { int i = o.size() -
* this.size(); if (i != 0) return i; return (o.hashCode() -
* this.hashCode()); }
*/
public TreeSet<Integer> getPhosphoPositions() {
return (phosphoPositions);
}
public String getPhosphoPositionToPrint(){
public String getPhosphoPositionToPrint() {
String S = "";
for(Integer value : this.phosphoPositions){
S = S +" "+ value;
for (Integer value : this.phosphoPositions) {
S = S + " " + value;
}
S.replaceFirst(" ", "");
return(S);
return (S);
}
public boolean haveMultiPhosphoPeptide() throws MSMSException{
public boolean haveMultiPhosphoPeptide() throws MSMSException {
boolean multi = false;
for(HashSampleScan hash: this){
if(this.match.getBestPeptideToHashSampleScan(hash).getGrpPhosphoModifs().size()>1)
for (HashSampleScan hash : this) {
if (this.match.getBestPeptideToHashSampleScan(hash)
.getGrpPhosphoModifs().size() > 1)
multi = true;
}
return(multi);
return (multi);
}
@Override
public HashKey4GroupsSet getHashKey4GroupsSet() throws Exception {
HashKey4GroupsSet hashPeptideSet = new HashKey4GroupsSet();
HashProtein hashProtein = match.getHashProtein();
hashPeptideSet.add(hashProtein);
return hashPeptideSet;
}
public TreeSet<Integer> getAllPositionIncluderedon(HashSampleScan hash) throws MSMSException {
TreeSet<Integer> posi = new TreeSet<Integer> ();
for (GrpPeptide pepTemp : this.match.getGrpPeptidesSharingHashSampleScan(hash)) {
for (GrpPhosphoModif mods : pepTemp.getGrpPhosphoModifs())
posi.add(mods.getPosi_in_prot());
public TreeSet<Integer> getAllPositionIncluderedon(HashSampleScan hash)
throws MSMSException {
TreeSet<Integer> posi = new TreeSet<Integer>();
for (GrpPhosphoModif mods : getAllPhosphoPeptideModif(hash)) {
posi.add(mods.getPosi_in_prot());
}
return posi;
}
/**
* retrieve all Phospho Modifs concerning one Peptide
*
* @param peptide
* @return
* @throws MSMSException
*/
public Collection<GrpPhosphoModif> getAllPhosphoPeptideModif(Peptide peptide)
throws MSMSException {
return getAllPhosphoPeptideModif(peptide.getHashSampleScan());
}
private Collection<GrpPhosphoModif> getAllPhosphoPeptideModif(
HashSampleScan hash) throws MSMSException {
ArrayList<GrpPhosphoModif> modifs = new ArrayList<GrpPhosphoModif>();
for (GrpPeptide pepTemp : this.match
.getGrpPeptidesSharingHashSampleScan(hash)) {
modifs.addAll(pepTemp.getGrpPhosphoModifs());
}
return modifs;
}
/**
* retrieve all Phospho Modifs concerning one PeptideMass
*
* @param peptideMass
* @return
* @throws MSMSException
*/
public Collection<GrpPhosphoModif> getAllPhosphoModif(
PeptideMass peptideMass) throws MSMSException {
ArrayList<GrpPhosphoModif> modifs = new ArrayList<GrpPhosphoModif>();
for (HashSampleScan sampleScan : peptideMass.getHashSampleScanSet()) {
modifs.addAll(getAllPhosphoPeptideModif(sampleScan));
}
return modifs;
}
}
package fr.inra.pappso.xtandempipeline.grouping.interfaces;
import java.util.ArrayList;
import java.util.Collection;
import fr.inra.pappso.xtandempipeline.MsException.MSMSException;
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;
public interface GrpProtMatch {
GrpProtein getGrpProtein();
Collection<GrpPeptide> getGrpPeptides() throws MSMSException;
GrpPeptide getBestPeptideToHashSampleScan(HashSampleScan hash) throws MSMSException;
GrpPeptide getBestPeptideToHashSampleScan(HashSampleScan hash)
throws MSMSException;
HashProtein getHashProtein() throws MSMSException;
Collection<GrpPeptide> getGrpPeptidesSharingHashSampleScan(
HashSampleScan hash) throws MSMSException;
public ArrayList<Peptide> getValidPeptideInPhosphoIsland(
HashSampleScanSetPhospho hashPhospho) throws MSMSException;
}
......@@ -48,7 +48,6 @@ import fr.inra.pappso.xtandempipeline.grouping.Group;
import fr.inra.pappso.xtandempipeline.grouping.HashSampleScanSetPhospho;
import fr.inra.pappso.xtandempipeline.grouping.HashSampleScanSetProt;
import fr.inra.pappso.xtandempipeline.grouping.SubGroup;
import fr.inra.pappso.xtandempipeline.grouping.SubGroupSet;
import fr.inra.pappso.xtandempipeline.grouping.interfaces.GrpPhosphoModif;
public class OdsPhosphoPeptideOutput {
......@@ -226,6 +225,8 @@ public class OdsPhosphoPeptideOutput {
* hashSampleScanSetPhospho = (HashSampleScanSetPhospho) sgList
* .get(0).getHashSampleScanSetProtList().get(0);
*/
HashSampleScanSetPhospho hashSampleScanSetPhospho = (HashSampleScanSetPhospho) sg
.getHashSampleScanSetProtList().get(0);
// odsTable.writeCell("Group ID");
odsTable.writeCell(Utils.getPappsoGroupId(group));
odsTable.writeCell(Utils.getPappsoSubGroupId(group, sg));
......@@ -253,12 +254,16 @@ public class OdsPhosphoPeptideOutput {
for (Peptide peptide : peptideSet) {
phosphoAllModifs.addAll(peptide.getGrpPhosphoModifs());
}
phosphoModifs = hashSampleScanSetPhospho
.getAllPhosphoModif(pepMass);
obsPhosphoPos = new TreeSet<Integer>();
for (GrpPhosphoModif phosphoModif : phosphoModifs) {
Modifs modif = (Modifs) phosphoModif;
obsPhosphoPos.add(modif.get_posi());
}
// odsTable.writeCell("All positions");
// TreeSet<Integer> posi = phospho.getAllPositionIncluderedon(hash);
odsTable.writeCell(Utils.collectionToString(obsPhosphoPos));
TreeSet<Integer> obsCharges = new TreeSet<Integer>();
......
......@@ -130,7 +130,7 @@ public class OdsPhosphoSpectraOutput {
odsTable.writeCell("Sequence (top)");
odsTable.writeCell("Modifs (top)");
odsTable.writeCell("Best position in peptide");
odsTable.writeCell("All Position in sequence");
odsTable.writeCell("All observed positions in phosphopeptide");
odsTable.writeCell("Number of phosphoislands");
odsTable.writeCell("Phosphoislands Ids");
odsTable.writeCell("Best e-value");
......@@ -206,8 +206,6 @@ public class OdsPhosphoSpectraOutput {
.getHashSampleScanSetProtSet()) {
HashSampleScanSetPhospho hashPhospho = (HashSampleScanSetPhospho) hashPprot;
Protein prot = (Protein) hashPhospho.getGrpProtMatch()
.getGrpProtein();
HashSet<PeptideMass> uniquePepMass = new HashSet<PeptideMass>();
for (Peptide peptide : ((Match) hashPhospho
......@@ -224,8 +222,10 @@ public class OdsPhosphoSpectraOutput {
.getHashSampleScanSet()) {
if (uniqueHashSampleScan.add(scan)) {
this.writeOneHashSampleScan(ident,
group, sg, prot, pepMass, scan,
group, sg, hashPhospho,
pepMass, scan,
hashPeptideMass2Peptides
.get(pepMass));
}
......@@ -255,9 +255,9 @@ public class OdsPhosphoSpectraOutput {
}
private void writeOneHashSampleScan(Identification ident, Group group,
SubGroup sg, Protein prot, PeptideMass pepMass,
HashSampleScan scan, HashSet<Peptide> peptideSet)
throws MSMSException {
SubGroup sg, HashSampleScanSetPhospho hashPhospho,
PeptideMass pepMass, HashSampleScan scan,
HashSet<Peptide> peptideSet) throws MSMSException {
try {
logger.debug("writeOneHashSampleScan begin " + group + pepMass);
HashSet<Peptide> peptideSetScan = new HashSet<Peptide>();
......@@ -317,12 +317,9 @@ public class OdsPhosphoSpectraOutput {
// odsTable.writeCell(pepMass.getSequenceLi());
HashSet<GrpPhosphoModif> phosphoAllModifs = new HashSet<GrpPhosphoModif>();
for (Peptide peptide : peptideSet) {
phosphoAllModifs.addAll(peptide.getGrpPhosphoModifs());
}
obsPhosphoPos = new TreeSet<Integer>();
for (GrpPhosphoModif phosphoModif : phosphoModifs) {
for (GrpPhosphoModif phosphoModif : hashPhospho
.getAllPhosphoModif(pepMass)) {
Modifs modif = (Modifs) phosphoModif;
obsPhosphoPos.add(modif.get_posi());
}
......
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