Skip to content

Commit

Permalink
V1.6.743.rc1
Browse files Browse the repository at this point in the history
 * new modification type - besides "fixed", "variable", and "known" one 
	can now define "linear" modification that are only to be found on 
	peptides matched as linear peptides 
 * some scores get the RunConfig as part of the initialisation
 * renamed "searchStoped" to searchStopped in SimpleXiProcess
 * when threads stop they report the reason they stop
 * reordered some initialisations in AbstractRunConfig
 * storeObject and retrieveObject are caseinsensetive if a String is 
	used as key
 * updated filter readout from config
 * new Filter "RemoveSinglePeaks" as an alternative denoising method
 * new Filter "ScanFilteredSpectrumAccess" to only search specific scans
	actally that filter already exists but was not selectable via the 
	config
 * new filter "Rebase": the main use is to write out the filtered 
	spectrum to the database by declaring the up to that point processed 
	spectrum as the "original" spectrum 
 * GenericTextPopUpMenu insalles now also a simple search function on 
	textareas
 * the peakfile table the database is now filed and referenced
 * peakFileName will be recorded for each spectrum.
 * CSVExportMatches can change the delimiter and quote charater that is 
	used 
 * CSVExportMatches automatically switches the delimiter to simicolon if 
	"," is found to be the decimal separator in the current local
 * saving the result-file as .txt, .txt.gz, .tsv, or .tsv.gz automatically 
	switches to a tab-separated output.
 * if for some reason CSVExportMatches is set to write out CSV with "," 
	as delimiter under a german local then all floating-point values get 
	surounded by quotes.
 * new "peaklist reader" that forwards a single spectrum from memory.
	mainly used in the annotator project
 * new supscores:
	CCPepFragmentCount : how many unique cross-linker stub modified 
		peptideIon fragments where found
	CCPepFragmentError: the smallest error for cross-linker stub modified 
		peptideIon fragments  
 * BugFix in crosslinkerrestrictedLoss
 * new setting "TransferLossToBase:true|false"
	if set to true and isotope cluster is matched to a loss xi will try 
	to find a isotope-cluster for the basic (non-lossy) fragment even
	if the isotope cluster is contained in another isotope cluster
 * BugFix in Spectra.cloneTopPeaksRolling to ensure the right number of 
	peaks are considered 
 * the origin of a spectrum can be overwriten (used in the rebase filter)
  • Loading branch information
Lutz Fischer committed Aug 16, 2018
1 parent 80371f0 commit 9a70651
Show file tree
Hide file tree
Showing 61 changed files with 1,877 additions and 653 deletions.
654 changes: 501 additions & 153 deletions nbproject/build-impl.xml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions nbproject/genfiles.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=8064a381@1.80.1.48
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=be8a7bc0
nbproject/build-impl.xml.script.CRC32=f54f9770
nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48
nbproject/build-impl.xml.script.CRC32=31664875
nbproject/build-impl.xml.stylesheet.CRC32=3a2fa800@1.89.1.48
44 changes: 35 additions & 9 deletions src/rappsilber/applications/SimpleXiProcess.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
import rappsilber.ms.score.SpectraCoverage;
import rappsilber.ms.score.SpectraCoverageConservative;
import rappsilber.ms.sequence.AminoAcid;
import rappsilber.ms.sequence.ModificationType;
import rappsilber.ms.sequence.Peptide;
import rappsilber.ms.sequence.SequenceList;
import rappsilber.ms.sequence.digest.AASpecificity;
Expand Down Expand Up @@ -609,9 +610,9 @@ protected void setupScores() {
// } catch (IOException ex) {
// Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "Error reading statistics", ex);
// }
Logger.getLogger(this.getClass().getName()).log(Level.INFO, "FragmentLibrary Coverage");
// Logger.getLogger(this.getClass().getName()).log(Level.INFO, "FragmentLibrary Coverage");
getConfig().getScores().add(new FragmentLibraryScore(m_Fragments, m_sequences.getCountPeptides()));
Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Spectar Coverage");
// Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Spectar Coverage");
getConfig().getScores().add(new SpectraCoverage());
getConfig().getScores().add(new FragmentChargeState());
getConfig().getScores().add(new SpectraCoverageConservative(minConservativeLosses));
Expand All @@ -620,7 +621,7 @@ protected void setupScores() {
getConfig().getScores().add(new BS3ReporterIonScore());
// getConfig().getScores().add(new Normalizer());
//getConfig().getScores().add(new LinkSiteDelta());
getConfig().getScores().add(new NormalizerML());
getConfig().getScores().add(new NormalizerML(getConfig()));
// add dummy score for feeding in the delta score
getConfig().getScores().add(m_deltaScore);
}
Expand All @@ -632,6 +633,16 @@ protected void variableModifications() {
m_peptidesLinear.applyVariableModificationsLinear(m_config,m_peptides);
m_config.getStatusInterface().setStatus("Applying variable modification to cross-linkable peptides");
m_peptides.applyVariableModifications(m_config, m_peptidesLinear);
m_config.getStatusInterface().setStatus("Applying linear modification to cross-linkable peptides");
ArrayList<Peptide> linearMods = new ArrayList<>();
for (Peptide p: m_peptides) {
linearMods.addAll(p.modify(m_config,ModificationType.linear));
}
for (Peptide p: m_peptidesLinear) {
linearMods.addAll(p.modify(m_config,ModificationType.linear));
}

linearMods.addAll(linearMods);
// m_sequences.applyVariableModifications(getConfig(),m_peptides, m_Crosslinker, digest);
// m_sequences.applyVariableModifications(getConfig(),m_peptidesLinear, m_Crosslinker, digest);

Expand Down Expand Up @@ -823,7 +834,7 @@ public void sendPing() {
watchdog.scheduleAtFixedRate(watchdogTask, 10, 60000);


while (running && !m_config.searchStoped()) {
while (running && !m_config.searchStopped()) {
for (int i = 0; i < getSearchThreads().length; i++) {
if (getSearchThreads()[i].isAlive()) {
try {
Expand Down Expand Up @@ -917,14 +928,26 @@ public void sendPing() {

long proc = getProcessedSpectra();
if (m_msmInput.getSpectraCount() >0) {
int procPerc = (int)(getProcessedSpectra()*100/m_msmInput.getSpectraCount());
m_config.getStatusInterface().setStatus(procPerc +"% processed (" + proc + ") " + m_msmInput.countReadSpectra() + " read of " + m_msmInput.getSpectraCount());
} else {
long filteredOut = m_msmInput.getDiscardedSpectra();
long procTotal = proc+m_msmInput.getDiscardedSpectra();
int procPerc = (int)(procTotal*100/m_msmInput.getSpectraCount());
if (filteredOut >0)
m_config.getStatusInterface().setStatus(procPerc +"% processed (" + proc + " + " + filteredOut + " fitlered out" + ") " + m_msmInput.countReadSpectra() + " read of " + m_msmInput.getSpectraCount());
else
m_config.getStatusInterface().setStatus(procPerc +"% processed (" + proc + ") " + m_msmInput.countReadSpectra() + " read of " + m_msmInput.getSpectraCount());
// int procPerc = (int)(getProcessedSpectra()*100/m_msmInput.getSpectraCount());
// m_config.getStatusInterface().setStatus(procPerc +"% processed (" + proc + ") " + m_msmInput.countReadSpectra() + " read of " + m_msmInput.getSpectraCount());
} else if (proc==0) {
m_config.getStatusInterface().setStatus("Error: no Spectra found to process");
Logger.getLogger(this.getClass().getName()).log(Level.SEVERE,"Error: no Spectra found to process");

System.exit(-1);
}else {
m_config.getStatusInterface().setStatus(proc + " spectra processed " + m_msmInput.countReadSpectra() + " read of " + m_msmInput.getSpectraCount());
}


if (m_msmInput.hasNext() && !m_config.searchStoped()) {
if (m_msmInput.hasNext() && !m_config.searchStopped()) {
emptyBufferedWriters();
for (BufferedResultWriter brw : (LinkedList<BufferedResultWriter>)BufferedResultWriter.allActiveWriters.clone()) {
if (brw.getInnerWriter() instanceof BufferedResultWriter) {
Expand Down Expand Up @@ -981,7 +1004,7 @@ public void sendPing() {
Logger.getLogger(this.getClass().getName()).log(Level.FINE, "It should be save to say good by now." );
}

if (m_msmInput.hasNext()) {
if (m_msmInput.hasNext() && !m_config.searchStopped()) {
startSearch();
waitEnd();
return;
Expand Down Expand Up @@ -1021,6 +1044,8 @@ public void sendPing() {
m_debugFrame.dispose();
}
watchdog.cancel();

m_config.getStatusInterface().setStatus("completed");

if (countActiveThreads()>1){
int delay = 60000;
Expand All @@ -1035,6 +1060,7 @@ public void run() {
for (Handler h : Logger.getGlobal().getHandlers()) {
h.flush();
}
m_config.getStatusInterface().setStatus("completed");
System.exit(-1);
} else {
Logger.getLogger(this.getClass().getName()).log(Level.WARNING,"No Warning: Threads did shut down by themself" );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public void process(SpectraAccess input, ResultWriter output, AtomicBoolean thre
int countSpectra = 0;
int processed = 0;
// go through each spectra
while (delayedHasNext(input, unbufInput) && ! m_config.searchStoped()) {
while (delayedHasNext(input, unbufInput) && ! m_config.searchStopped()) {

if (input.countReadSpectra() % 100 == 0) {
System.err.println("("+Thread.currentThread().getName()+")Spectra Read " + unbufInput.countReadSpectra() + "\n");
Expand Down Expand Up @@ -684,7 +684,9 @@ protected boolean delayedHasNext(SpectraAccess input, SpectraAccess unbufInput)
} catch (InterruptedException ex) {
Logger.getLogger(SimpleXiProcessLinearIncluded.class.getName()).log(Level.SEVERE, null, ex);
}
Logger.getLogger(this.getClass().getName()).log(Level.WARNING,"({0}) Oddety here: input finished but not finished",Thread.currentThread().getName());
if ((input.hasNext() || unbufInput.hasNext())) {
Logger.getLogger(this.getClass().getName()).log(Level.WARNING,"({0}) Oddety here: input finished but not finished",Thread.currentThread().getName());
}
}
return input.hasNext() || unbufInput.hasNext();
}
Expand Down
18 changes: 15 additions & 3 deletions src/rappsilber/applications/SimpleXiProcessMultipleCandidates.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public void process(SpectraAccess input, ResultWriter output, AtomicBoolean thre
// input = bsa;
BufferedResultWriter brw = new BufferedResultWriter(output, 100);
output = brw;
String quitReason="";


try {
Expand Down Expand Up @@ -122,13 +123,23 @@ public void process(SpectraAccess input, ResultWriter output, AtomicBoolean thre
int countSpectra = 0;
int processed = 0;
// go through each spectra
while (delayedHasNext(input, unbufInput) && ! m_config.searchStoped()) {
while (true) {
if (m_config.searchStopped()) {
quitReason="Search got stoped through config";
break;
}
if (!(delayedHasNext(input, unbufInput) && ! m_config.searchStopped())) {
quitReason="no new spectra";
break;
}
if (input.countReadSpectra() % 100 == 0) {
System.err.println("("+Thread.currentThread().getName()+")Spectra Read " + unbufInput.countReadSpectra() + "\n");
}

if (m_doStop)
if (m_doStop) {
quitReason="search got stop";
break;
}
// ScoredLinkedList<Peptide,Double> scoredPeptides = new ScoredLinkedList<Peptide, Double>();
Spectra spectraAllchargeStatess = input.next();
// int sn = spectraAllchargeStatess.getScanNumber();
Expand Down Expand Up @@ -538,6 +549,7 @@ public int compare(Peptide o1, Peptide o2) {
processed=0;
}
if (threadStop.get()) {
quitReason="thread stop";
System.err.println("Closing down search thread " + Thread.currentThread().getName());
break;
}
Expand All @@ -551,7 +563,7 @@ public int compare(Peptide o1, Peptide o2) {
e.printStackTrace(System.err);
System.exit(1);
}
Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Search Thread {0} finished", Thread.currentThread().getName());
Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Search Thread {0} finished ("+quitReason +")", Thread.currentThread().getName());

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public void process(SpectraAccess input, ResultWriter output, AtomicBoolean thre

int countSpectra = 0;
// go through each spectra
while (delayedHasNext(input, input) && ! m_config.searchStoped()) {
while (delayedHasNext(input, input) && ! m_config.searchStopped()) {

if (input.countReadSpectra() % 100 == 0) {
System.err.println("Spectra Read " + input.countReadSpectra() + "\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public void process(SpectraAccess input, ResultWriter output, AtomicBoolean thre

int countSpectra = 0;
// go through each spectra
while (input.hasNext() && ! m_config.searchStoped()) {
while (input.hasNext() && ! m_config.searchStopped()) {

if (input.countReadSpectra() % 100 == 0) {
System.err.println("Spectra Read " + input.countReadSpectra() + "\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public void process(SpectraAccess input, ResultWriter output, AtomicBoolean thre
int countSpectra = 0;
int processed = 0;
// go through each spectra
while (input.hasNext() && ! m_config.searchStoped()) {
while (input.hasNext() && ! m_config.searchStopped()) {
processed ++;

if (input.countReadSpectra() % 100 == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public void process(SpectraAccess input, ResultWriter output, AtomicBoolean thre

int countSpectra = 0;
// go through each spectra
while (input.hasNext()&& ! m_config.searchStoped()) {
while (input.hasNext()&& ! m_config.searchStopped()) {

if (input.countReadSpectra() % 100 == 0) {
System.err.println("Spectra Read " + input.countReadSpectra() + "\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public void process(SpectraAccess input, ResultWriter output, AtomicBoolean thre
int countSpectra = 0;
int processed = 0;
// go through each spectra
while (input.hasNext()&& ! m_config.searchStoped()) {
while (input.hasNext()&& ! m_config.searchStopped()) {
processed ++;

if (input.countReadSpectra() % 100 == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public void process(SpectraAccess input, ResultWriter output, AtomicBoolean thre
int countSpectra = 0;
int processed = 0;
// go through each spectra
while (input.hasNext()&& ! m_config.searchStoped()) {
while (input.hasNext()&& ! m_config.searchStopped()) {
processed ++;

if (input.countReadSpectra() % 100 == 0) {
Expand Down
21 changes: 16 additions & 5 deletions src/rappsilber/applications/Xi.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,25 @@ public void setupMSMIterator() {
public void setupOutput() {
for (String out : outputArgs) {
try {
boolean gzip = false;
boolean tabSep=false;
if (out.endsWith(".gz")) {
gzip=true;
}
if (out.endsWith("txt.gz")||out.endsWith("tsv.gz")||out.endsWith("txt")||out.endsWith("tsv")) {
tabSep=true;
}

CSVExportMatches CSVOut = null;
if (out.contentEquals("-")) {
result_multiplexer.addResultWriter(new CSVExportMatches(System.out, xiconfig));
CSVOut = new CSVExportMatches(System.out, xiconfig,gzip);
} else {
if (out.endsWith(".gz")) {
result_multiplexer.addResultWriter(new CSVExportMatches(new FileOutputStream(out), xiconfig,true));
} else
result_multiplexer.addResultWriter(new CSVExportMatches(new FileOutputStream(out), xiconfig,false));
CSVOut = new CSVExportMatches(new FileOutputStream(out), xiconfig,gzip);
}
if (tabSep) {
CSVOut.setDelimChar("\t");
}
result_multiplexer.addResultWriter(CSVOut);
} catch (IOException ex) {
Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "could not open ouput file:" + out, ex);
System.exit(1);
Expand Down
Loading

0 comments on commit 9a70651

Please sign in to comment.