msg << "Path size [" << path.size() << "] and track size ["
<< track_container.size() << "] don't match" << endl;
throw mussa_error(msg.str());
- }
+ }
if (path.size() != rc.size()) {
throw runtime_error("path and reverse compliment must be the same length");
}
#ifndef _MUSSA_EXCEPTIONS_H_
#define _MUSSA_EXCEPTIONS_H_
#include <stdexcept>
+#include <boost/filesystem/exception.hpp>
//! base mussa exception
class mussa_error : public std::runtime_error
LIBS += -lm
QT += opengl
-LIBS += -lboost_program_options -lboost_filesystem
+LIBS += -lboost_program_options
+LIBS += -lboost_filesystem
win32 {
+ MINGW_HOME = C:/MinGW
+ INCLUDEPATH += $$MINGW_HOME/include/GL
BOOST_HOME = c:/Boost
INCLUDEPATH += $$BOOST_HOME/include/boost-1_33_1
LIBS -= -lboost_program_options
#include <iostream>
+#include <boost/filesystem/path.hpp>
+namespace fs = boost::filesystem;
+
using namespace std;
MussaWindow::MussaWindow(Mussa *analysis_, QWidget *parent) :
return;
// try to load safely
try {
- analysis->load_motifs(path.toStdString());
+ fs::path converted_path(path.toStdString(), fs::native);
+ analysis->load_motifs(converted_path);
} catch (runtime_error e) {
QString msg("Unable to load ");
msg += path;
// try to load safely
try {
Mussa *m = new Mussa;
- m->load_mupa_file(mupa_path.toStdString());
+ fs::path converted_path(mupa_path.toStdString(), fs::native);
+ m->load_mupa_file(converted_path);
m->analyze(0, 0, Mussa::TransitiveNway, 0.0);
setAnalysis(m);
} catch (mussa_load_error e) {
// try to safely load
try {
Mussa *m = new Mussa;
- m->load(muway_dir.toStdString());
+ fs::path converted_path(muway_dir.toStdString(), fs::native);
+ m->load(converted_path);
// only switch mussas if we loaded without error
setAnalysis(m);
} catch (mussa_load_error e) {
using namespace std;
+#include <boost/filesystem/path.hpp>
+namespace fs = boost::filesystem;
+
//#include "qui/mussa_setup_dialog/SequenceSetupWidget.hpp"
#include "qui/mussa_setup_dialog/SequenceSetupFrame.hpp"
#include "qui/mussa_setup_dialog/MussaSetupWidget.hpp"
{
Mussa *mussa = new Mussa;
- std::string seqFile;
- std::string annotFile;
int fastaIndex;
int start;
int end;
setup_item != setupInfoList.end();
++setup_item)
{
- seqFile = (*setup_item)->getSeqFile();
- annotFile = (*setup_item)->getAnnotFile();
+ std::string seqNative = (*setup_item)->getSeqFile();
+ std::string annotNative = (*setup_item)->getAnnotFile();
fastaIndex = (*setup_item)->getFastaIndex();
start = (*setup_item)->getSubSeqStart();
end = (*setup_item)->getSubSeqEnd();
-
+
+ fs::path seqFile(seqNative, fs::native);
+ fs::path annotFile(annotNative, fs::native);
mussa->load_sequence(seqFile, annotFile, fastaIndex, start, end);
}
setupInfoList.clear();
#include "qui/MussaWindow.hpp"
#include "alg/parse_options.hpp"
+#include "mussa_exceptions.hpp"
int main(int argc, char **argv)
{
return 1;
}
- if (opts.useGUI) {
- MussaWindow win(opts.analysis);
- win.show();
- app.exec();
+ try {
+ if (opts.useGUI) {
+ MussaWindow win(opts.analysis);
+ win.show();
+ app.exec();
+ }
+ return 0;
+ } catch (mussa_error e) {
+ qFatal(e.what());
+ } catch (boost::filesystem::filesystem_error e) {
+ qFatal(e.what());
+ } catch (std::runtime_error e) {
+ qFatal(e.what());
+ } catch (...) {
+ qFatal("unrecognized exception");
}
-
- return 0;
+ return 1;
}