Skip to content

Commit

Permalink
Merge branch 'beta_fixes' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhra-agrawal committed Aug 7, 2019
2 parents fed910d + aae5f7b commit 38a2c8e
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cache:
- C:\msys64\var\cache\pacman\pkg

install:
- SET "PATH=C:\Qt\5.12.2\mingw73_64\bin;C:\%MSYS2_DIR%\%MSYSTEM%\bin;C:\%MSYS2_DIR%\usr\bin;%PATH%"
- SET "PATH=C:\Qt\5.12.4\mingw73_64\bin;C:\%MSYS2_DIR%\%MSYSTEM%\bin;C:\%MSYS2_DIR%\usr\bin;%PATH%"

- bash -lc "pacman -S --needed --noconfirm mingw64/mingw-w64-x86_64-hdf5 mingw64/mingw-w64-x86_64-netcdf mingw64/mingw-w64-x86_64-boost"

Expand Down
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,12 @@ after_success:
bash <(curl -s https://codecov.io/bash)
fi
before_deploy:
- |
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "This build is for a PR. Not proceeding with installer creation."
exit 0
fi
export ELMAVEN_TAG=`git describe --tags`
SUBSTRING=$(echo $ELMAVEN_TAG| cut -d'-' -f 1)
export ELMAVEN_VERSION=${SUBSTRING[@]:1}
Expand Down
3 changes: 1 addition & 2 deletions src/core/libmaven/mavenparameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ MavenParameters::MavenParameters(string settingsPath):lastUsedSettingsPath(setti
{

clsf = NULL;
alignWrtExpectedRt=false;
alignSamplesFlag = false;
alignSamplesFlag = false;
processAllSlices = false;
pullIsotopesFlag = false;
matchRtFlag = false;
Expand Down
1 change: 0 additions & 1 deletion src/core/libmaven/mavenparameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ class MavenParameters
bool pullIsotopesFlag;
bool showProgressFlag;
bool matchRtFlag;
bool alignWrtExpectedRt;

/**
* default ionization mode used by mass spec
Expand Down
6 changes: 0 additions & 6 deletions src/gui/mzroll/alignmentdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ AlignmentDialog::AlignmentDialog(QWidget *parent) : QDialog(parent) {
connect(alignAlgo, SIGNAL(currentIndexChanged(int)), this, SLOT(algoChanged()));
connect(peakDetectionAlgo, SIGNAL(currentIndexChanged(int)), this, SLOT(algoChanged()));
connect(cancelButton, &QPushButton::clicked, this, &AlignmentDialog::cancel);
connect(alignWrtExpectedRt,SIGNAL(toggled(bool)),SLOT(setAlignWrtExpectedRt(bool)));
connect(local, SIGNAL(toggled(bool)),this, SLOT(setInitPenalty(bool)));
connect(restoreDefaultObiWarpParams, SIGNAL(clicked(bool)), this, SLOT(restorDefaultValues(bool)));
connect(showAdvanceParams, SIGNAL(toggled(bool)), this, SLOT(showAdvanceParameters(bool)));
Expand Down Expand Up @@ -73,11 +72,6 @@ void AlignmentDialog::refSampleChanged()
emit changeRefSample(sample);
}

void AlignmentDialog::setAlignWrtExpectedRt(bool checked)
{
_mw->mavenParameters->alignWrtExpectedRt = checked;
}

void AlignmentDialog::setInitPenalty(bool checked)
{
initPenalty->setEnabled(checked);
Expand Down
1 change: 0 additions & 1 deletion src/gui/mzroll/alignmentdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class AlignmentDialog : public QDialog, public Ui_AlignmentDialog {
void setDatabase(QString db);
void setProgressBar(QString text, int progress, int totalSteps);
void showInfo(QString text);
void setAlignWrtExpectedRt(bool checked);
void setInitPenalty(bool checked);
void restorDefaultValues(bool checked);
void showAdvanceParameters(bool checked);
Expand Down
11 changes: 11 additions & 0 deletions src/gui/mzroll/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,17 @@ vector<Compound*> Database::findSpeciesByName(string name, string dbname) {
return set;
}

vector<Compound*> Database::findSpeciesById(string id, string dbName) {
vector<Compound*> matches;
for (auto compound : compoundsDB) {
if (compound->id == id && compound->db == dbName) {
matches.push_back(compound);
}
}

return matches;
}

void Database::loadReactions(string db) {

map<string, Reaction*> seenReactions;
Expand Down
1 change: 1 addition & 0 deletions src/gui/mzroll/database.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class Database {
deque<Compound*> getCompoundsDB(){ return compoundsDB;}
set<Compound*> findSpeciesByMass(float mz, MassCutoff *massCutoff);
vector<Compound*> findSpeciesByName(string name, string dbname);
vector<Compound*> findSpeciesById(string id, string dbName);

void loadRetentionTimes(QString method);
void saveRetentionTime(Compound* c, float rt, QString method);
Expand Down
29 changes: 0 additions & 29 deletions src/gui/mzroll/forms/alignmentdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -643,22 +643,6 @@
<property name="rightMargin">
<number>9</number>
</property>
<item row="3" column="0">
<widget class="QLabel" name="label_13">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Alignment w.r.t Expected Rt</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="limitGroupCount">
<property name="sizePolicy">
Expand Down Expand Up @@ -770,19 +754,6 @@
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="alignWrtExpectedRt">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
Expand Down
1 change: 1 addition & 0 deletions src/gui/mzroll/masscalcgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ void MassCalcWidget::setFragmentationScan(Scan* scan) {

Fragment f(scan, 0, 0, 1024);
_mz = scan->precursorMz;
precursorMz->setText(QString(to_string(_mz).c_str()));
getMatches();

for(auto& m : matches ) {
Expand Down
15 changes: 12 additions & 3 deletions src/gui/mzroll/mzfileio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1175,9 +1175,18 @@ PeakGroup* mzFileIO::readGroupXML(QXmlStreamReader& xml, PeakGroup* parent)
if (matches.size() > 0)
group->compound = matches[0];
} else if (!compoundId.empty()) {
Compound* c = DB.findSpeciesByIdAndName(compoundId,
group->compound->name,
DB.ANYDATABASE);
Compound* c = nullptr;

if (group->compound && !group->compound->name.empty()) {
c = DB.findSpeciesByIdAndName(compoundId,
group->compound->name,
DB.ANYDATABASE);
} else if (!compoundDB.empty()) {
vector<Compound*> matches = DB.findSpeciesById(compoundId, compoundDB);
if (matches.size())
c = matches[0];
}

if (c)
group->compound = c;
}
Expand Down
24 changes: 12 additions & 12 deletions src/gui/mzroll/numeric_treewidgetitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ bool NumericTreeWidgetItem::operator<( const QTreeWidgetItem & other ) const{
QCollator collator;
collator.setNumericMode(true);

QRegExp exp1("^[-+]?([0-9]*\\.?[0-9]+)[eE][-+]?([0-9]+)$");
QRegExp exp2("^[-+]?([0-9]*\\.?[0-9]+)[eE][-+]?([0-9]+)$");
if (thisText.contains(exp1) && otherText.contains(exp2)) {
QString thisMantissa = exp1.cap(1);
QString thisExponent = exp1.cap(2);
QString otherMantissa = exp2.cap(1);
QString otherExponent = exp2.cap(2);

if (collator.compare(thisExponent, otherExponent) == 0) {
return collator.compare(thisMantissa, otherMantissa) < 0;
}
return collator.compare(thisExponent, otherExponent) < 0;
QRegExp exp("^[-+]?([0-9]*\\.?[0-9]+)[eE][-+]?([0-9]+)$");
if (thisText.contains(exp)) {
double mantissa = exp.cap(1).toDouble();
double exponent = exp.cap(2).toDouble();
double trueValue = mantissa * (pow(10, exponent));
thisText = QString::fromStdString(to_string(trueValue).c_str());
}
if (otherText.contains(exp)) {
double mantissa = exp.cap(1).toDouble();
double exponent = exp.cap(2).toDouble();
double trueValue = mantissa * (pow(10, exponent));
otherText = QString::fromStdString(to_string(trueValue).c_str());
}

return collator.compare(thisText , otherText) < 0;
Expand Down
6 changes: 6 additions & 0 deletions src/gui/mzroll/spectrawidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -877,12 +877,18 @@ float SpectraWidget::invY(float y)

void SpectraWidget::mousePressEvent(QMouseEvent *event)
{
if (_currentScan == nullptr)
return;

QGraphicsView::mousePressEvent(event);
_mouseStartPos = event->pos();
}

void SpectraWidget::mouseReleaseEvent(QMouseEvent *event)
{
if (_currentScan == nullptr)
return;

QGraphicsView::mouseReleaseEvent(event);

_mouseEndPos = event->pos();
Expand Down

0 comments on commit 38a2c8e

Please sign in to comment.