Skip to content

Commit

Permalink
www root set.
Browse files Browse the repository at this point in the history
atomic stage number added.
  • Loading branch information
wulongict committed May 31, 2024
1 parent 14ce1a2 commit f251a88
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
5 changes: 4 additions & 1 deletion ArchiveSearch/CSpectralArchive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ CSpectralArchive::CSpectralArchive(string mzXMLList, string pepxml, string index
bool usegpu, bool rebuildsqldb, int seedpvalue, const int topPeakNum,
bool createfilenameBlackList, bool saveBackgroundScore, bool verbose,
string archivename, string indexshuffleseeds, string gpuidx) : PeakNumPerSpec(
topPeakNum) {
topPeakNum), m_stage(STAGE_INIT) {

m_savebackgroundscore = saveBackgroundScore;
// checking the parameters.
if(mzXMLList.empty()){
Expand Down Expand Up @@ -311,6 +312,7 @@ void CSpectralArchive::createMzFileObject() {
// get number of indices to be created, using indexstr, split by ';'
// create multiIndices object. each corresponding to a file in multiIndices folder.
void CSpectralArchive::createIndices(bool myOwnIndex, shared_ptr<CPQParam> option, string &indexstrings, string indexshuffleseeds) {
m_stage = STAGE_TRAIN;
int cnts = count(indexstrings.begin(), indexstrings.end(), ';') + 1;
if (cnts > 6 and cnts < 1) {
cout << "Error: invalid cnts " << cnts << endl;
Expand All @@ -332,6 +334,7 @@ CSpectralArchive::~CSpectralArchive() {}

void CSpectralArchive::update(string new_experimental_data, string new_search_result, string new_search_result_list,
string new_experimental_datalist) {
m_stage = STAGE_UPDATE;
updateIndex(m_verbose);
bool newFilesAdded = false;
addRawData(new_experimental_data, newFilesAdded);
Expand Down
3 changes: 3 additions & 0 deletions ArchiveSearch/CSpectralArchive.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <string>
#include <fstream>
#include <map>
#include <atomic>
using namespace std;
class CAnnotationDB;
class ICQuery;
Expand Down Expand Up @@ -217,6 +218,8 @@ class CSpectralArchive {
int m_tol;
int m_minPeakNum;
bool m_usegpu;
std::atomic_int m_stage;
enum Archive_Stage {STAGE_ANNOTATION, STAGE_TRAIN, STAGE_ADD, STAGE_INIT, STAGE_INDEX, STAGE_SEARCH, STAGE_UPDATE};
public:
CSpectralArchive(string mzXMLList, string pepxml, string indexfile, bool removeprecursor, bool useflankingbins,
int tol, int minPeakNum, bool myOwnIndex, CPQParam option, string indexstrings, bool usegpu,
Expand Down
6 changes: 4 additions & 2 deletions ArchiveSearch/spectroscapeMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ void sigint_handler(int signal) {
std::cout << "Force to exit Spectroscape." << std::endl;
exit(0);
}
std::cout << "Please wait for a few seconds for Spectroscape save data and exit safely.\n" << std::endl;
std::cout << "To stop Spectroscape immediately, press ctrl-c again .\n" << std::endl;
std::cout << "If spectroscape is adding new raw data files, please wait for a few seconds for Spectroscape save data and exit safely.\n" << std::endl;
std::cout << "Otherwise, to stop Spectroscape immediately, press ctrl-c again .\n" << std::endl;
std::cout << "Attention:" << std::endl;
std::cout << "Forced interruption when adding new data files to archive can results in corrupted files. A fresh building is required. " << std::endl;
}

boost::program_options::variables_map getParam(int argc, char *argv[]) {
Expand Down
7 changes: 7 additions & 0 deletions scripts/start_service.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash


archive_path="$HOME/data/spectroscape/spectral_archives_latest"
bin_path="$HOME/code/SpectralArchive/build/bin/spectroscape"
wwwroot_path="`dirname $bin_path`/../www"
cd $archive_path && spawn-fcgi -p 8710 -n -- $bin_path --run --wwwroot $wwwroot_path

0 comments on commit f251a88

Please sign in to comment.