Skip to content

Commit

Permalink
release 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiri Novak committed May 23, 2018
1 parent cfaf10e commit d754c29
Show file tree
Hide file tree
Showing 13 changed files with 273 additions and 56 deletions.
11 changes: 11 additions & 0 deletions CycloBranch/External/linux/correctprofile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
SAVEIFS=$IFS
IFS=$',' read name fwhm <<< $@
IFS=$SAVEIFS
FileConverter -in "$name"".mgf" -out "$name"".FileConverter.mzML"
NoiseFilterGaussian -in "$name"".FileConverter.mzML" -out "$name"".NoiseFilterGaussian.mzML" -algorithm:gaussian_width $fwhm
rm "$name"".mzML"
BaselineFilter -in "$name"".NoiseFilterGaussian.mzML" -out "$name"".mzML"
rm "$name"".mgf"
rm "$name"".FileConverter.mzML"
rm "$name"".NoiseFilterGaussian.mzML"
1 change: 1 addition & 0 deletions CycloBranch/External/macosx/correctprofile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SAVEIFS=$IFSIFS=$',' read name fwhm <<< $@IFS=$SAVEIFSFileConverter -in "$name"".mgf" -out "$name"".FileConverter.mzML"NoiseFilterGaussian -in "$name"".FileConverter.mzML" -out "$name"".NoiseFilterGaussian.mzML" -algorithm:gaussian_width $fwhmrm "$name"".mzML"BaselineFilter -in "$name"".NoiseFilterGaussian.mzML" -out "$name"".mzML"rm "$name"".mgf"rm "$name"".FileConverter.mzML"rm "$name"".NoiseFilterGaussian.mzML"
Expand Down
11 changes: 11 additions & 0 deletions CycloBranch/External/windows/correctprofile.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@echo off
SET PATH=%PATH:C:\Xcalibur\system\programs;=%

FileConverter.exe -in "%~f1.mgf" -out "%~f1.FileConverter.mzML" 1>NUL
NoiseFilterGaussian.exe -in "%~f1.FileConverter.mzML" -out "%~f1.NoiseFilterGaussian.mzML" -algorithm:gaussian_width %2 1>NUL
del "%~f1.mzML" 2>NUL
BaselineFilter.exe -in "%~f1.NoiseFilterGaussian.mzML" -out "%~f1.mzML" 1>NUL

del "%~f1.mgf" 2>NUL
del "%~f1.FileConverter.mzML" 2>NUL
del "%~f1.NoiseFilterGaussian.mzML" 2>NUL
12 changes: 7 additions & 5 deletions CycloBranch/core/cMzML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,13 @@ int cMzML::parse(string& filename, vector<cPeaksList>& peaklists, eModeType mode
mgfofstream.open(ss.str());
}

if ((count + 1) % 100 == 0) {
*os << count + 1 << " ";
}
if ((count + 1) % 2500 == 0) {
*os << endl;
if (os) {
if ((count + 1) % 100 == 0) {
*os << count + 1 << " ";
}
if ((count + 1) % 2500 == 0) {
*os << endl;
}
}

mgfofstream << "BEGIN IONS" << endl;
Expand Down
5 changes: 5 additions & 0 deletions CycloBranch/core/cParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ void cParameters::clear() {
peaklistfilename = "";
useprofiledata = false;
convertprofiledata = true;
profiledatafilename = "";
peaklistfileformat = txt;
peaklistseries.clear();
scannumber = 1;
Expand Down Expand Up @@ -1163,6 +1164,8 @@ void cParameters::store(ofstream& os) {
os.write((char *)&useprofiledata, sizeof(bool));
os.write((char *)&convertprofiledata, sizeof(bool));

storeString(profiledatafilename, os);

os.write((char *)&scannumber, sizeof(int));
os.write((char *)&precursormass, sizeof(double));

Expand Down Expand Up @@ -1287,6 +1290,8 @@ void cParameters::load(ifstream& is) {
is.read((char *)&useprofiledata, sizeof(bool));
is.read((char *)&convertprofiledata, sizeof(bool));

loadString(profiledatafilename, is);

is.read((char *)&scannumber, sizeof(int));
is.read((char *)&precursormass, sizeof(double));

Expand Down
6 changes: 6 additions & 0 deletions CycloBranch/core/cParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ class cParameters {
bool convertprofiledata;


/**
\brief Profile data file name.
*/
string profiledatafilename;


/**
\brief A file format of peak list.
*/
Expand Down
4 changes: 0 additions & 4 deletions CycloBranch/core/cPeaksList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,6 @@ void cPeaksList::loadFromIBDStream(cImzMLItem& imzmlitem, ifstream &ibdstream, b
}
}

if (imzmlitem.mzlength != imzmlitem.intensitylength) {
return;
}

// intensities
if (use_64bit_float_intensity_precision) {
start = imzmlitem.intensitystart;
Expand Down
2 changes: 1 addition & 1 deletion CycloBranch/core/utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


QString appname = "CycloBranch";
QString appversion = "v. 1.3.0 (64-bit)";
QString appversion = "v. 1.3.1 (64-bit)";


#if OS_TYPE == UNX
Expand Down
55 changes: 48 additions & 7 deletions CycloBranch/gui/cMainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,11 @@ cMainWindow::cMainWindow() {
spectradetails.clear();

parameters.clear();

rawdata.clear();
imzmlprofilemetadata.clear();
profilemz64precision = false;
profileintensity64precision = false;

resultsbasecolumncount = 9;
resultsspecificcolumncount = 0;
Expand Down Expand Up @@ -736,13 +740,20 @@ void cMainWindow::run() {
spectradetails.clear();

parameters.clear();

rawdata.clear();
imzmlprofilemetadata.clear();
profilemz64precision = false;
profileintensity64precision = false;

cParameters localparameters = parameterswidget->getParameters();

regex rx;
rx = "\\.[iI][mM][zZ][mM][lL]$";
localparameters.profiledatafilename = "";
if (regex_search(localparameters.peaklistfilename, rx)) {
localparameters.profiledatafilename = localparameters.peaklistfilename;

string convertedimzml = localparameters.peaklistfilename.substr(0, (int)localparameters.peaklistfilename.size() - 6);
string convertedibd = convertedimzml;
convertedimzml += "_converted_fwhm_";
Expand Down Expand Up @@ -1140,13 +1151,39 @@ void cMainWindow::reportSpectra() {

results->resizeColumnsToContents();

if (parameters.useprofiledata && (parameters.peaklistfileformat == baf)) {
if ((parameters.mode == denovoengine) || (parameters.mode == databasesearch)) {
rawdata.resize(1);
if (parameters.useprofiledata) {

if (parameters.peaklistfileformat == baf) {
if ((parameters.mode == denovoengine) || (parameters.mode == databasesearch)) {
rawdata.resize(1);
}
else {
rawdata.resize(theoreticalspectrumlist.size());
}
}
else {

if ((parameters.peaklistfileformat == imzML) && (parameters.mode == dereplication)) {
rawdata.resize(theoreticalspectrumlist.size());
imzmlprofilemetadata.clear();
profilemz64precision = false;
profileintensity64precision = false;

cImzML imzml;
int defaultmaxx;
int defaultmaxy;
int defaultpixelsizex;
int defaultpixelsizey;
eVendorType vendor;

if (imzml.parse(parameters.profiledatafilename, defaultmaxx, defaultmaxy, defaultpixelsizex, defaultpixelsizey, vendor) == 0) {
if (imzml.hasProfileSpectra()) {
imzmlprofilemetadata = imzml.getItems();
profilemz64precision = imzml.use64BitMzPrecision();
profileintensity64precision = imzml.use64BitIntensityPrecision();
}
}
}

}

QProgressDialog progress("Preparing the report...", /*"Cancel"*/0, 0, theoreticalspectrumlist.size(), this);
Expand Down Expand Up @@ -1247,7 +1284,7 @@ void cMainWindow::rowDoubleClicked(const QModelIndex& item) {
int row = resultsproxymodel->mapToSource(item).row();
int rowid = resultsmodel->item(row, 1)->data(Qt::DisplayRole).toInt() - 1;

spectradetails[rowid].prepareToShow(&rawdata, actionShowIsomers);
spectradetails[rowid].prepareToShow(actionShowIsomers, &rawdata, &imzmlprofilemetadata, profilemz64precision, profileintensity64precision);
spectradetails[rowid].show();
spectradetails[rowid].activateWindow();
if (spectradetails[rowid].isMinimized()) {
Expand Down Expand Up @@ -1741,8 +1778,12 @@ void cMainWindow::openResultsFile() {
spectradetails.clear();

parameters.clear();

rawdata.clear();

imzmlprofilemetadata.clear();
profilemz64precision = false;
profileintensity64precision = false;

// load graph window
graph->load(infile);
graph->updateView(actionShowIsomers->isChecked());
Expand Down Expand Up @@ -1898,7 +1939,7 @@ void cMainWindow::summaryPeaksTableCancelled() {


void cMainWindow::summaryPeaksTableRowDoubleClicked(int rowid, double experimentalmz) {
spectradetails[rowid].prepareToShow(&rawdata, actionShowIsomers);
spectradetails[rowid].prepareToShow(actionShowIsomers, &rawdata, &imzmlprofilemetadata, profilemz64precision, profileintensity64precision);
spectradetails[rowid].show();
spectradetails[rowid].activateWindow();
if (spectradetails[rowid].isMinimized()) {
Expand Down
4 changes: 4 additions & 0 deletions CycloBranch/gui/cMainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ class cMainWindow : public QMainWindow
vector<cSpectrumDetailWidget> spectradetails;

cParameters parameters;

cPeakListSeries rawdata;
vector<cImzMLItem> imzmlprofilemetadata;
bool profilemz64precision;
bool profileintensity64precision;

QTextEdit* logWindow;
QSplitter* splitter;
Expand Down
Loading

0 comments on commit d754c29

Please sign in to comment.