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

first attempt to fix Brucker scan nums

parent 9379f3b9
No related branches found
No related tags found
No related merge requests found
......@@ -121,17 +121,11 @@ public class Mascot {
+ pep.getDeltaMass() + 1.007825));
pep_.set_mhplus_theo((float) (pep.getPeptideMr() + 1.007825));
pep_.set_sequence(pep.getSequence());
<<<<<<< HEAD
if (XtandemPipelineSession.getInstance().getConfig()
.get_mascot_evalue_theoritical()) {
// Evalue theoritical
=======
//query.getTitle();
if(XtandemPipelineSession.getInstance().getConfig().get_mascot_evalue_theoritical()){
//Evalue theoritical
>>>>>>> trying to deal with fuzzy Brucker MGF
pep_.set_evalue((float) pep.getExpectancy());
} else {
// Evalue experimental
......
......@@ -4,6 +4,8 @@ import org.apache.log4j.Logger;
import org.xml.sax.*;
import java.util.Hashtable;
import java.util.Vector;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import fr.inra.pappso.xtandempipeline.MsException.MSMSException;
import fr.inra.pappso.xtandempipeline.class_msms.*;
......@@ -52,6 +54,9 @@ public class xtandem extends org.xml.sax.helpers.DefaultHandler {
private boolean spectre_number;
private Pattern pattBruckerRtScanNum = Pattern
.compile("RTINSECONDS=([0-9]+.[0-9]+).*?MS: ([0-9]+)/ MSMS: ([0-9]+).*");
public xtandem(Identification L, IdentificationDataSource S) {
super();
if (L == null) {
......@@ -168,8 +173,9 @@ public class xtandem extends org.xml.sax.helpers.DefaultHandler {
}
pep_ = this.peptide;
try {
pep_.set_sample_id(identification_.getMsRunSet().getInstance(
sample_), sample_);
pep_.set_sample_id(
identification_.getMsRunSet().getInstance(sample_),
sample_);
} catch (MSMSException e) {
throw new SAXException(e);
}
......@@ -198,9 +204,9 @@ public class xtandem extends org.xml.sax.helpers.DefaultHandler {
this.peptide = PeptideStore.getInstance().newPeptide();
}
pep_ = peptide;
pep_.set_Modifs(attrs.getValue("type"), Integer.parseInt(attrs
.getValue("at")), Float.valueOf(attrs.getValue("modified"))
.floatValue());
pep_.set_Modifs(attrs.getValue("type"),
Integer.parseInt(attrs.getValue("at")),
Float.valueOf(attrs.getValue("modified")).floatValue());
// modifs liste for isotopic analysis
identification_.add_modifs_to_liste(new Modifs(Float.valueOf(
attrs.getValue("modified")).floatValue()));
......@@ -228,25 +234,34 @@ public class xtandem extends org.xml.sax.helpers.DefaultHandler {
match_ = (Match) identification_.get_match(prot_);
prot_ = match_.get_protein_match();
}
prot_.set_evalue(identification_.getMsRunSet().getInstance(
sample_), Float.valueOf(_evalue_prot).floatValue());
prot_.set_evalue(
identification_.getMsRunSet().getInstance(sample_),
Float.valueOf(_evalue_prot).floatValue());
}
if (spectre_number) {
// example of X!tandem note on spectrum from mgf Bruker :
// <note label="Description">RTINSECONDS=769.441^M Cmpd
// 5568, +MSn(709.3404), 12.82 min MS: 5567/ MSMS: 5568/^M
// </note>
Pattern patt = Pattern
.compile("RTINSECONDS=([0-9.]+).*?MS: ([0-9]+)/ MSMS: ([0-9]+)");
Matcher m = patt.matcher(C_data.trim());
// Pattern patt = Pattern
// .compile("RTINSECONDS=([0-9]+.[0-9]+).*?MS: ([0-9]+)/ MSMS: ([0-9]+)");
// Pattern patt = Pattern
// .compile("MS: ([0-9]+)\\/ MSMS: ([0-9]+)");
// Pattern patt = Pattern
// .compile("RTINSECONDS(.*)");
// logger.debug("C_data"+C_data.replace("\n",
// "").replace("\r", ""));
Matcher m = pattBruckerRtScanNum.matcher(C_data.replace(
"\n", "").replace("\r", ""));
if (m.matches()) {
float rtime = Float.valueOf(m.group(1)).floatValue();
int scan = Integer.parseInt(m.group(3));
correction_scan.put("" + _scan, "" + scan);
correction_time.put("" + scan, "" + rtime);
logger.debug("Bruker MGF scan time fix " + scan + " = " + rtime);
logger.debug("Bruker MGF scan time fix " + scan + " = "
+ rtime);
} else {
// logger.debug("no match");
String tmp = C_data.replaceAll(" .*", "");
String[] split = tmp.split("-");
if (split.length == 2) {
......
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