Skip to content
Snippets Groups Projects
Commit 1b91cc89 authored by valot's avatar valot
Browse files

Correction of phosphopeptide import for Mascot

git-svn-id: https://subversion.renater.fr/xtandempipeline/trunk@203 b8ef2a07-7df7-436f-90b9-41648038564b
parent 1bc0d20a
No related branches found
No related tags found
No related merge requests found
Source diff could not be displayed: it is too large. Options to address this: view the blob.
log4j.logger.org=error, rollingFile
log4j.logger.com=error, rollingFile
#log4j.logger.fr.inra.pappso=info,rollingFile
log4j.logger.fr.inra=debug,rollingFile
log4j.logger.fr.inra=info,rollingFile
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
......
......@@ -174,10 +174,10 @@ public class Peptide implements Comparable<Peptide> {
this.hypercorr = f;
}
public void set_Modifs(String AA, int posi, float modvalue) {
int posi_corrected = posi - this.start + 1;
public void set_Modifs(String AA, int posi_in_prot, float modvalue) {
int posi_corrected = posi_in_prot - this.start + 1;
Modifs mod = new Modifs(AA, posi_corrected, modvalue);
mod.setPosi_in_prot(posi);
mod.setPosi_in_prot(posi_in_prot);
this.modifList.add(mod);
}
......
......@@ -99,57 +99,39 @@ public class Mascot {
protected void addPeptideToIdentification(PeptideHit pep, Query query,
boolean reversed) {
// Mapping peptideHit to peptide
pep_ = new Peptide();
pep_.set_sample_id(
identification_.getMsRunSet().getInstance(sample_.getName()),
sample_);
pep_.set_charge((int) round(
(pep.getPeptideMr() / query.getPrecursorMZ()), 0));
pep_.set_deltamass((float) pep.getDeltaMass());
pep_.set_evalue((float) pep.getExpectancy());
pep_.set_hypercorr((float) pep.getIonsScore());
pep_.set_mhplus_obser((float) (pep.getPeptideMr() + pep.getDeltaMass() + 1.007825));
pep_.set_mhplus_theo((float) (pep.getPeptideMr() + 1.007825));
pep_.set_sequence(pep.getSequence());
// Add first query
pep_.set_scan(query.getQueryNumber());
// If scan exist, add it
try {
int scan = Integer.parseInt(query.getScans());
pep_.set_scan(scan);
} catch (Exception e) {
logger.debug("No scan for query :" + query.getQueryNumber());
}
String rt = query.getRetentionTimeInSeconds();
if (rt != null)
pep_.set_RT(rt);
// modifs
Modification[] mods = pep.getModifications();
for (int i = 0; i < mods.length; i++) {
Modification mod = mods[i];
// N-ter/C-ter correction
int posi = i;
if (i > 0) {
posi--;
}
if (i == mods.length - 1) {
posi--;
}
if (mod != null) {
pep_.set_Modifs(mod.getLocation(), posi, (float) mod.getMass());
identification_.add_modifs_to_liste(new Modifs((float) mod
.getMass()));
}
}
// mapping proteinHit to protein
// mapping proteinHit to protein && peptideHit to peptide
for (Object obj : pep.getProteinHits()) {
ProteinHit prot = (ProteinHit) obj;
pep_ = new Peptide();
pep_.set_sample_id(
identification_.getMsRunSet()
.getInstance(sample_.getName()), sample_);
pep_.set_charge((int) round(
(pep.getPeptideMr() / query.getPrecursorMZ()), 0));
pep_.set_deltamass((float) pep.getDeltaMass());
pep_.set_evalue((float) pep.getExpectancy());
pep_.set_hypercorr((float) pep.getIonsScore());
pep_.set_mhplus_obser((float) (pep.getPeptideMr()
+ pep.getDeltaMass() + 1.007825));
pep_.set_mhplus_theo((float) (pep.getPeptideMr() + 1.007825));
pep_.set_sequence(pep.getSequence());
// Add first query
pep_.set_scan(query.getQueryNumber());
// If scan exist, add it
try {
int scan = Integer.parseInt(query.getScans());
pep_.set_scan(scan);
} catch (Exception e) {
logger.debug("No scan for query :" + query.getQueryNumber());
}
String rt = query.getRetentionTimeInSeconds();
if (rt != null)
pep_.set_RT(rt);
prot_ = new Protein();
match_ = new Match();
......@@ -180,8 +162,29 @@ public class Mascot {
// Add specific peptide param to protein
pep_.set_post("");
pep_.set_pre("");
// modified posi in prot of the peptide
pep_.set_start(prot.getStart());
pep_.set_stop(prot.getStop());
// modifs add with position in prot!!!
Modification[] mods = pep.getModifications();
for (int i = 0; i < mods.length; i++) {
Modification mod = mods[i];
// N-ter/C-ter correction
int posi = i;
if (i > 0) {
posi--;
}
if (i == mods.length - 1) {
posi--;
}
if (mod != null) {
pep_.set_Modifs(mod.getLocation(), posi+prot.getStart(),
(float) mod.getMass());
identification_.add_modifs_to_liste(new Modifs((float) mod
.getMass()));
}
}
// Add result to identification
if (phosphoFilter) {
......
......@@ -20,15 +20,16 @@ public class MascotTest {
private static Logger logger = Logger.getLogger(MascotTest.class);
public static void main(String[] args) {
//String ds = "/tmp/FtoeoxSSO.dat";
String ds = "/media/E860-74C3/Triplex1_FT_light.dat";
//String ds = "/tmp/FtoeoxSSO.dat";
String ds = "/tmp/F001323.dat";
//String ds = "/media/E860-74C3/Triplex1_FT_light.dat";
try {
MascotDatfile mascot = new MascotDatfile(ds);
logger.info("Read :" + mascot.getFileName());
Parameters param = mascot.getParametersSection();
System.out.println("Database : "+param.getDatabase());
System.out.println("Database : " + param.getDatabase());
QueryToPeptideMap map = mascot.getQueryToPeptideMap();
QueryToPeptideMap map2 = mascot.getDecoyQueryToPeptideMap();
......@@ -37,7 +38,7 @@ public class MascotTest {
// System.out.println(query.getScans() + " | "
// + query.getRetentionTimeInSeconds() + " | "
// + query.getQueryNumber());
Vector<?> peptides = map2.getAllPeptideHits(query
Vector<?> peptides = map.getAllPeptideHits(query
.getQueryNumber());
if (peptides != null) {
for (Object ob : peptides) {
......@@ -45,22 +46,33 @@ public class MascotTest {
if (pep.getExpectancy() < 0.05) {
System.out.println(query.getScans() + " | "
+ query.getRetentionTimeInSeconds() + " | "
+ query.getQueryNumber()+ " | "+query.getChargeString());
System.out.println(query.getChargeString()+" | "+(int) round((pep.getPeptideMr()/query.getPrecursorMZ()),0));
System.out.println(pep.getModifiedSequence() + " | "
+ pep.getIonsScore() + " | "
+ query.getQueryNumber() + " | "
+ query.getChargeString());
System.out.println(pep.getModifiedSequence()
+ " | " + pep.getIonsScore() + " | "
+ pep.getHomologyThreshold());
System.out.println(((ProteinHit)pep.getProteinHits().get(0)).getAccession());
// for (Modification mod : pep.getModifications()) {
// if (mod != null)
// System.out.println(mod.getLocation() + " | "
// + mod.getMass() + " | " + mod.getShortType());
// }
// System.out.println();
// for(String i : pep.getModifiedSequenceComponents()){
// System.out.println(i);
// }
ProteinHit prot = (ProteinHit) pep.getProteinHits()
.get(0);
System.out
.println(prot.getAccession()
+ " | "
+ prot.getStart()
+ " | "
+ prot.getStop()
+ " | "
+ prot.getPeptideStartInProtein_PeptideCentricDatabase()
+ " | "
+ prot.getPeptideStopInProtein_PeptideCentricDatabase());
// for (Modification mod : pep.getModifications()) {
// if (mod != null)
// System.out.println(mod.getLocation() + " | "
// + mod.getMass() + " | " + mod.getShortType());
// }
// System.out.println();
// for(String i :
// pep.getModifiedSequenceComponents()){
// System.out.println(i);
// }
}
}
}
......
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