Skip to content

Commit

Permalink
Merge branch 'develop' into feature/isobaricWorkflow
Browse files Browse the repository at this point in the history
  • Loading branch information
poshul authored Mar 5, 2024
2 parents 41ce7ed + abf9281 commit 36aedc7
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 68 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Fixes:

Misc:
- OpenMSInfo reports the ILP solver (CoinOr or glpk) (#7156)
- add citation information for OpenMS 3.0 (Nat. Methods) (#7383)
- Add export for Common Workflow Language (CWL) (#6156)
- Add tool description lib (TDL) dependency (#6156)

Expand Down
8 changes: 4 additions & 4 deletions src/openms/include/OpenMS/APPLICATIONS/TOPPBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ namespace OpenMS
*/
String getToolPrefix() const;

private:
/// Returns a link to the documentation of the tool (accessible on our servers and only after inclusion in the nightly branch or a release).
String getDocumentationURL() const;

private:
/// Tool name. This is assigned once and for all in the constructor.
String const tool_name_;

Expand Down Expand Up @@ -350,9 +353,6 @@ namespace OpenMS
*/
String getSubsection_(const String& name) const;

/// Returns a link to the documentation of the tool (accessible on our servers and only after inclusion in the nightly branch or a release).
String getDocumentationURL() const;

/// Returns the default parameters
Param getDefaultParameters_() const;

Expand Down
10 changes: 5 additions & 5 deletions src/openms/source/APPLICATIONS/TOPPBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ namespace OpenMS
using namespace Exception;

String TOPPBase::topp_ini_file_ = String(QDir::homePath()) + "/.TOPP.ini";
const Citation TOPPBase::cite_openms_ = { "Rost HL, Sachsenberg T, Aiche S, Bielow C et al.",
"OpenMS: a flexible open-source software platform for mass spectrometry data analysis",
"Nat Meth. 2016; 13, 9: 741-748",
"10.1038/nmeth.3959" };
const Citation TOPPBase::cite_openms_
= {"Pfeuffer, J., Bielow, C., Wein, S. et al.", "OpenMS 3 enables reproducible analysis of large-scale mass spectrometry data",
"Nat Methods (2024)", "10.1038/s41592-024-02197-7"};


void TOPPBase::setMaxNumberOfThreads(int
#ifdef _OPENMP
Expand Down Expand Up @@ -580,7 +580,7 @@ namespace OpenMS
is << " + " << is.indent(3) << c.toString() << is.indent(0) << "\n";
}
is << is.indent(0) << "\n";
is << invert("Usage:\n")
is << invert("Usage:") << "\n" // line break needs to be separate, to avoid colored trailing whitespaces
<< " " << bright(tool_name_) << " <options>" << "\n"
<< "\n";

Expand Down
129 changes: 71 additions & 58 deletions src/topp/OpenMSInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
// $Authors: Marc Sturm, Chris Bielow $
// --------------------------------------------------------------------------

#include <OpenMS/config.h>
#include <OpenMS/APPLICATIONS/TOPPBase.h>
#include <OpenMS/CONCEPT/Colorizer.h>
#include <OpenMS/CONCEPT/VersionInfo.h>
#include <OpenMS/DATASTRUCTURES/String.h>
#include <OpenMS/FORMAT/IndentedStream.h>
#include <OpenMS/SYSTEM/BuildInfo.h>
#include <OpenMS/SYSTEM/File.h>
#include <OpenMS/config.h>
#include <OpenMS/openms_data_path.h>
#include <OpenMS/APPLICATIONS/TOPPBase.h>

#ifdef _OPENMP
#include "omp.h"
Expand All @@ -26,46 +28,49 @@ using namespace std;
/**
@page TOPP_OpenMSInfo OpenMSInfo
@brief Prints configurations details of %OpenMS (Version, Git hash, SIMD extensions, Multithreading), along with directories where auxilliary data like
modifications (UniMOD), Enzymes etc are taken from.
@brief Prints configurations details of %OpenMS (Version, Git hash, SIMD extensions, Multithreading), along with directories where auxilliary data
like modifications (UniMOD), Enzymes etc are taken from.
Some path's can be manipulated by the user by setting environment variables. If not set, the values are taken from the system defaults.
<ul>
<li> <b>Data path:</b> controlled by the environment variable 'OPENMS_DATA_PATH'; the value should point to a %OpenMS share directory, e.g. 'c:/program files/OpenMS3.1/share/OpenMS'
<li> <b>Temp path:</b> controlled by the environment variable 'OPENMS_TMPDIR'; the value should point to where you want %OpenMS to store temporary data.
<li> <b>Userdata path:</b> controlled by the environment variable 'OPENMS_HOME_PATH'; the value should point to where you want %OpenMS to store user-realted data, e.g. the .OpenMS.ini.
<li> <b>Data path:</b> controlled by the environment variable 'OPENMS_DATA_PATH'; the value should point to a %OpenMS share directory, e.g.
'c:/program files/OpenMS3.1/share/OpenMS' <li> <b>Temp path:</b> controlled by the environment variable 'OPENMS_TMPDIR'; the value should point to
where you want %OpenMS to store temporary data. <li> <b>Userdata path:</b> controlled by the environment variable 'OPENMS_HOME_PATH'; the value should
point to where you want %OpenMS to store user-realted data, e.g. the .OpenMS.ini.
</ul>
<B>This tool does not need/use any command line parameters.</B>
Example output:
@code
OpenMS Version:
==================
Version : 3.1.0-pre-disabled-20230914
Build time : Sep 14 2023, 12:02:03
Full documentation: http://www.openms.de/doxygen/nightly/html/TOPP_OpenMSInfo.html
To cite OpenMS:
+ Pfeuffer, J., Bielow, C., Wein, S. et al.. OpenMS 3 enables reproducible analysis of large-scale mass spectrometry
data. Nat Methods (2024). doi:10.1038/s41592-024-02197-7.
<< OpenMS Version >>
Version : 3.1.0
Build time : Mar 4 2024, 10:42:53
Git sha1 : disabled
Git branch : disabled
Installation information:
==================
Data path : C:/dev/openms/share/OpenMS
<< Installation information >>
Data path : C:/dev/openms2/share/OpenMS
Temp path : C:/Users/bielow/AppData/Local/Temp
Userdata path: C:/Users/bielow/
Build information:
==================
<< Build information >>
Source path : C:/dev/openms/src/openms
Binary path : C:/dev/openms_build/src/openms
Binary arch : 64 bit
Build type : Release
Build type : Debug
LP-Solver : COIN-OR
OpenMP : enabled (maxThreads = 32)
SIMD extensions : SSE, SSE2, SSE3, SSE4.1, AVX
SIMD extensions : SSE, SSE2, SSE3, SSE4.1, SSE4.2, AVX
OS Information:
==================
<< OS Information >>
Name: Windows
Version: 10
Architecture: 64 bit
Expand All @@ -82,7 +87,7 @@ const auto max_threads = Internal::OpenMSBuildInfo::getOpenMPMaxNumThreads();
class TOPPOpenMSInfo : public TOPPBase
{
public:
TOPPOpenMSInfo() : TOPPBase("OpenMSInfo", "Prints configurations details of OpenMS.")
TOPPOpenMSInfo(): TOPPBase("OpenMSInfo", "Prints configurations details of OpenMS.")
{
}

Expand All @@ -93,54 +98,62 @@ class TOPPOpenMSInfo : public TOPPBase
registerInputFile_("dummy", "<ignored>", "", "A fake input file, which is needed for some workflow systems to call this tool", false, true);
}

//Param getSubsectionDefaults_(const String& /*section*/) const override
// Param getSubsectionDefaults_(const String& /*section*/) const override
//{
// return SpectraMerger().getParameters();
//}
// return SpectraMerger().getParameters();
// }

ExitCodes main_(int, const char**) override
{
cout << "OpenMS Version:" << "\n";
cout << "==================" << "\n";
cout << "Version : " << VersionInfo::getVersion() << "\n";
cout << "Build time : " << VersionInfo::getTime() << "\n";
cout << "Git sha1 : " << VersionInfo::getRevision() << "\n";
cout << "Git branch : " << VersionInfo::getBranch() << "\n";
cout << "\n";
cout << "Installation information:" << "\n";
cout << "==================" << "\n";
cout << "Data path : " << File::getOpenMSDataPath() << "\n";
cout << "Temp path : " << File::getTempDirectory() << "\n";
cout << "Userdata path: " << File::getUserDirectory() << "\n";

cout << "\n";
cout << "Build information:" << "\n";
cout << "==================" << "\n";
cout << "Source path : " << OPENMS_SOURCE_PATH << "\n";
cout << "Binary path : " << OPENMS_BINARY_PATH << "\n";
cout << "Binary arch : " << Internal::OpenMSOSInfo::getBinaryArchitecture() << "\n";
cout << "Build type : " << Internal::OpenMSBuildInfo::getBuildType() << "\n";
IndentedStream is(cout, 0, 10);
is << '\n'
<< bright("Full documentation: ") // the space is needed, otherwise the remaining line will be underlined on Windows..
<< underline(TOPPBase::getDocumentationURL()) << " " // the space is needed ...
<< '\n'
<< bright("To cite OpenMS:\n") << " + "
<< is.indent(3) << cite_openms_.toString() << is.indent(0);

is << "\n\n"
<< green("<< OpenMS Version >>\n")
<< "Version : " << VersionInfo::getVersion() << "\n"
<< "Build time : " << VersionInfo::getTime() << "\n"
<< "Git sha1 : " << VersionInfo::getRevision() << "\n"
<< "Git branch : " << VersionInfo::getBranch() << "\n"
<< "\n"
<< green("<< Installation information >>\n")
<< "Data path : " << File::getOpenMSDataPath() << "\n"
<< "Temp path : " << File::getTempDirectory() << "\n"
<< "Userdata path: " << File::getUserDirectory() << "\n"
<< "\n"
<< green("<< Build information >>\n")
<< "Source path : " << OPENMS_SOURCE_PATH << "\n"
<< "Binary path : " << OPENMS_BINARY_PATH << "\n"
<< "Binary arch : " << Internal::OpenMSOSInfo::getBinaryArchitecture() << "\n"
<< "Build type : " << Internal::OpenMSBuildInfo::getBuildType() << "\n";
#if COINOR_SOLVER == 1
cout << "LP-Solver : COIN-OR\n";
is << "LP-Solver : COIN-OR\n";
#else
cout << "LP-Solver : GLPK\n";
#endif
#ifdef _OPENMP
cout << "OpenMP : " << "enabled (maxThreads = " << max_threads << ")" << "\n";
#else
cout << "OpenMP : " << "disabled" << "\n";
#endif
cout << "SIMD extensions : " << Internal::OpenMSOSInfo::getActiveSIMDExtensions() << "\n";
cout << "\n";
#ifdef _OPENMP
is << "OpenMP : "
<< "enabled (maxThreads = " << max_threads << ")"
<< "\n";
#else
is << "OpenMP : "
<< "disabled"
<< "\n";
#endif
is << "SIMD extensions : " << Internal::OpenMSOSInfo::getActiveSIMDExtensions() << "\n"
<< "\n";

Internal::OpenMSOSInfo info = Internal::OpenMSOSInfo::getOSInfo();

cout << "OS Information:" << "\n";
cout << "==================" << "\n";
cout << "Name: " << info.getOSAsString() << "\n";
cout << "Version: " << info.getOSVersionAsString() << "\n";
cout << "Architecture: " << info.getArchAsString() << "\n";
cout << "\n";
is << green("<< OS Information >>\n")
<< "Name: " << info.getOSAsString() << "\n"
<< "Version: " << info.getOSVersionAsString() << "\n"
<< "Architecture: " << info.getArchAsString() << "\n"
<< "\n";

return EXECUTION_OK;
}
Expand Down

0 comments on commit 36aedc7

Please sign in to comment.