Skip to content

Commit

Permalink
command line modified, read me updated
Browse files Browse the repository at this point in the history
  • Loading branch information
nielshulstaert committed Mar 24, 2022
1 parent 06fc24e commit c76b3ee
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 18 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
---
## Project Description

COSS is a user-friendly spectral library search tool capable of processing large spectral libraries and supporting multiple file formats. COSS is developed in Java and hence it is platform independent. COSS uses external subsystems for file reading and writing. Next to file io subsystems there are three main processes: preprocessing, feature extraction and matching. All processes are organized and implemented in a modular fashion to facilitate future upgrades.
COSS is a user-friendly spectral library search tool capable of processing large spectral libraries and supporting multiple file formats. COSS is developed in Java and hence it is platform independent
Incase of COSS V2, Percolator, a semi-supervised machine learning tool is integrated to inhance the identification rate and the installation path should be given, if Percolator option is checked, to COSS inorder to run COSS in different platform.
COSS uses external subsystems for file reading and writing. Next to file io subsystems there are three main processes: preprocessing, feature extraction and matching. All processes are organized and implemented in a modular fashion to facilitate future upgrades.

[Go to top of page](#coss)

Expand Down Expand Up @@ -60,6 +62,7 @@ Users can export the result in excel. The output table contains 15 columns.
| MatchedIntLib | Sum of peak intensities of library spectrum that have a match in query spectrum |

It is also possible to save results in .cos format. This allows users to re-import previous results for visualization.
When Percolator is selected, the output is stored in tab delimited file in the same directory of the input file.

[Go to top of page](#coss)

Expand All @@ -84,6 +87,7 @@ $java -jar COSS-X.Y.jar
Make sure Java is installed on your machine.*

- Parameter Setting: Select and fill all required parameters.
- If rescoring with Percolator is needed, make sure to check the option and give the full executable path pf percolator in the setting menu
- Decoy generation: It is recommended to add decoy spectra to your spectral library for result validation. You can generate decoy library spectra using COSS builtin decoy generation. COSS has two algorithms to generate decoy spectra, reverse sequence and random sequence techniques. Click the GenerateDecoy menu and select the algorithm to generate the decoy spectra (which will be equal in size to your spectra library) and concatenate the decoys to your library.

*Note: make sure the spectral library is annotated before generating decoy library, if not you can use spectrum annotator provided in COSS.
Expand All @@ -104,6 +108,7 @@ java -jar COSS-X.Y.jar targetSpectraFile librarySpectraFile algorithm(0=MSROBIN,
or
```
java -jar COSS-X.Y.jar targetSpectraFile librarySpectraFile algorithm(0=MSROBIN, 1=Cosine similarity) precursorMassTolerance(PPM) fragmentTolerance(Da.) maxNumberofCharge
Note: In COSS V2, Percolator is set on by default and can be switched off by adding "-nP" option at the end of the command
```
Decoy spectra can be generated and appended with the following command: dV- reverse, dR- random
```
Expand Down
4 changes: 2 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Running COSS(GUI)
=================
Download COSS from "http://genesis.ugent.be/maven2/com/compomics/COSS/1.0/COSS-1.0.zip" and unzip it. On windows: your can run COSS by double clicking on COSS-X.Y.jar file or it can be started on command line using the following command
Download COSS from "http://genesis.ugent.be/maven2/com/compomics/COSS/2.0/.zip" and unzip it. On windows: your can run COSS by double clicking on COSS-X.Y.jar file or it can be started on command line using the following command
$java -jar COSS-X.Y.jar

X.Y stands for the version number(eg. COSS-1.1.jar).
X.Y stands for the version number(eg. COSS-2.0.jar).
On Ubuntu machine: COSS can be run using the command $java -jar COSS-X.Y.jar

*Make sure java is installed on your machine.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.apache.log4j.Logger;
import com.compomics.coss.model.ConfigData;
import java.io.IOException;
import java.util.Arrays;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level;

Expand All @@ -31,6 +32,7 @@ public class MainConsoleController implements UpdateListener {
List<ComparisonResult> result = new ArrayList<>();
int cutoff_index_1percent;
int cutoff_index_5percent;
boolean isPercolatorSelected = true;

/**
* the main method
Expand All @@ -41,9 +43,14 @@ public void startRunning(String[] args) {
try {

System.out.println("Starting COSS-V2");
System.out.println("Rescoring with Percolator is set on by default in this version");
System.out.println("Rescoring with Percolator is set on by default in this version and I can be switched off by adding option -nP");
int lenArgs = args.length;
String arg1 = args[0];
if (Arrays.asList(args).contains("-nP")) {
lenArgs--;
isPercolatorSelected = false;
}

if (lenArgs <= 1 || lenArgs > 5) {
System.out.println("At least two prameters has to be provided: Target spectrum and Library file \n max. number of argument is five");
System.out.println("\n\nUsage: \n");
Expand All @@ -52,7 +59,7 @@ public void startRunning(String[] args) {
System.out.println("java -jar COSS-X.Y.jar targetSpectraFile librarySpectraFile precursorMassTolerance(PPM) fragmentTolerance(Da.) \n");
System.out.println("OR\n");
System.out.println("java -jar COSS-X.Y.jar targetSpectraFile librarySpectraFile precursorMassTolerance(PPM) fragmentTolerance(Da.) maxNumberofCharge \n");

System.out.println("OR decoy spectra can be generated and appended to the given library file using the command below\n");
System.out.println("java -jar COSS-X.Y.jar -d librarySpectraFile \n");
System.out.println("OR spectra library file can be annotated using the command below\n");
Expand Down Expand Up @@ -229,25 +236,28 @@ private void startMatching() {

dispatcher = new Dispatcher(this.configData, this, LOG);
result = dispatcher.dispatch();

if (configData.isDecoyAvailable() && result != null) {
validateResult();

LOG.info("Number of validated identified spectra by COSS: " + Integer.toString(result.size()));

LOG.info("starting rescoring the result with Percolator ... ");
Rescore rescore = new Rescore(result);
try {
boolean finished = rescore.start_rescoring(configData, configData.getExperimentalSpecFile().toString());
if (finished) {
LOG.info("Percolator finishes scoring and result is stored in the directory of input file ");
} else {
LOG.info("Percolator exits with error. Result not rescored ");
if (!rescore.error_msg.isEmpty()) {
LOG.info(rescore.error_msg);
if (isPercolatorSelected) {
LOG.info("starting rescoring the result with Percolator ... ");
Rescore rescore = new Rescore(result);
try {
boolean finished = rescore.start_rescoring(configData, configData.getExperimentalSpecFile().toString());
if (finished) {
LOG.info("Percolator finishes scoring and result is stored in the directory of input file ");
} else {
LOG.info("Percolator exits with error. Result not rescored ");
if (!rescore.error_msg.isEmpty()) {
LOG.info(rescore.error_msg);
}
}
} catch (IOException ex) {
java.util.logging.Logger.getLogger(MainFrameController.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
} catch (IOException ex) {
java.util.logging.Logger.getLogger(MainFrameController.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}

} else {
Expand Down

0 comments on commit c76b3ee

Please sign in to comment.