// конструктор класса для инициализации
correlationType::correlationType() {}
-correlationType::correlationType(std::vector< RVec > ref, int wnd, int taau, int tau_st, float crlUp, float effRad, int mod, std::string out, std::vector< std::vector < std::vector < unsigned int > > > sels, std::vector< std::string > rsNames) {
- setDefaults(ref, wnd, taau, tau_st, crlUp, effRad, mod, out, sels, rsNames);
+correlationType::correlationType(std::vector< RVec > ref, int wnd, int taau, int tau_st, float crlUp, float effRad, int mod, std::string out, std::vector< int > indx, std::vector< std::vector < std::vector < unsigned int > > > sels, std::vector< std::string > rsNames) {
+ setDefaults(ref, wnd, taau, tau_st, crlUp, effRad, mod, out, indx, sels, rsNames);
}
-void correlationType::setDefaults(std::vector< RVec > ref, int wnd, int taau, int tau_st, float crlUp, float effRad, int mod, std::string out, std::vector< std::vector < std::vector < unsigned int > > > sels, std::vector< std::string > rsNames) {
+void correlationType::setDefaults(std::vector< RVec > ref, int wnd, int taau, int tau_st, float crlUp, float effRad, int mod, std::string out, std::vector< int > indx, std::vector< std::vector < std::vector < unsigned int > > > sels, std::vector< std::string > rsNames) {
if (ref.size() != 0) {reference = ref;}
if (wnd != -1) {window = wnd;}
if (taau != -1) {tau = taau;}
if (out != "") {outputName = out;}
if (sels.size() != 0) {selections = sels;}
if (rsNames.size() > 0) {resNames = rsNames;}
+ if (indx.size() > 0) {index = indx;}
subGraphRouts.resize(0);
trajectoryPartition();
}
// конструктор класса для инициализации
correlationType();
- correlationType(std::vector< RVec > ref, int wnd, int taau, int tau_st, float crlUp, float effRad, int mod, std::string out, std::vector< std::vector < std::vector < unsigned int > > > sels, std::vector< std::string > rsNames);
+ correlationType(std::vector< RVec > ref, int wnd, int taau, int tau_st, float crlUp, float effRad, int mod, std::string out, std::vector< int > indx, std::vector< std::vector < std::vector < unsigned int > > > sels, std::vector< std::string > rsNames);
- void setDefaults(std::vector< RVec > ref, int wnd, int taau, int tau_st, float crlUp, float effRad, int mod, std::string out, std::vector< std::vector < std::vector < unsigned int > > > sels, std::vector< std::string > rsNames);
+ void setDefaults(std::vector< RVec > ref, int wnd, int taau, int tau_st, float crlUp, float effRad, int mod, std::string out, std::vector< int > indx, std::vector< std::vector < std::vector < unsigned int > > > sels, std::vector< std::string > rsNames);
void update(int frame, std::vector< RVec > curFrame);
int frames = 0;
- int tau_jump = 100;
+ int tauJump = 100; // selectable
int window = 1000; // selectable
int tau = 500; // selectable
- float crl_border = 0.5; // selectable
- float eff_rad = 1.5; // selectable
- std::string OutPutName; // selectable
+ float crlBorder = 0.5; // selectable
+ float effRad = 1.5; // selectable
+ std::string outPutName; // selectable
int mode = 0; // selectable
correlationType corrs;
.description("size of window in frames that correlation evaluation based on"));
// Add option for crl_border constant
options->addOption(FloatOption("crl")
- .store(&crl_border)
+ .store(&crlBorder)
.description("make graphs based on corrs > crl const"));
- // Add option for eff_rad constant
+ // Add option for effRad constant
options->addOption(FloatOption("efRad")
- .store(&eff_rad)
+ .store(&effRad)
.description("effective radius for atoms to see each other to evaluate corrs"));
// Add option for selection list
options->addOption(SelectionOption("selRaDs").storeVector(&sel_)
.description("select residue and domains to form a rigid skeleton"));
// Add option for output file names
options->addOption(StringOption("outPut")
- .store(&OutPutName)
+ .store(&outPutName)
.description("<your name here> + <local file tag>.txt"));
// Add option for time step between windows' starts
options->addOption(gmx::IntegerOption("twStep")
- .store(&tau_jump)
+ .store(&tauJump)
.description("time step between windows' starting positions."));
// Control input settings
settings->setFlags(TrajectoryAnalysisSettings::efNoUserPBC);
}
std::string str(sel_.back().name());
- unsigned long tempSize = std::stoul(str.substr(13, 6)) / static_cast< unsigned long >(tau_jump);
+ unsigned long tempSize = std::stoul(str.substr(13, 6)) / static_cast< unsigned long >(tauJump);
sels.resize(tempSize);
atomind = sel_[i].atomIndices();
std::vector< unsigned int > a;
a.resize(0);
- sels[std::stoul(str.substr(13, 6)) / static_cast< unsigned long >(tau_jump)].push_back(a);
+ sels[std::stoul(str.substr(13, 6)) / static_cast< unsigned long >(tauJump)].push_back(a);
for (ArrayRef< const int >::iterator ai = atomind.begin(); (ai < atomind.end()); ai++) {
- sels[std::stoul(str.substr(13, 6)) / static_cast< unsigned long >(tau_jump)].back().push_back(static_cast< unsigned int >(*ai));
+ sels[std::stoul(str.substr(13, 6)) / static_cast< unsigned long >(tauJump)].back().push_back(static_cast< unsigned int >(*ai));
}
}
}
}
- corrs.setDefaults(reference, window, tau, tau_jump, crl_border, eff_rad, 0, OutPutName, sels, resNms);
+ corrs.setDefaults(reference, window, tau, tauJump, crlBorder, effRad, 0, outPutName, index, sels, resNms);
}
void
+#include <vector>
+#include <cfloat>
#include <iostream>
+
#include "gtest/gtest.h"
+#include <gromacs/trajectoryanalysis.h>
+// #include <gromacs/trajectoryanalysis/topologyinformation.h>
+#include "/home/titov_ai/Develop/gromacs-original/src/gromacs/trajectoryanalysis/topologyinformation.h"
+
+#include "newfit.h"
+#include "corrtype.h"
TEST( corrTests, corrTests_setDefaults )
{
- // проверка создания класса
-}
+ std::vector< std::string > testResNms;
+ testResNms.resize(0);
+ std::vector< RVec > testReference;
+ testReference.resize(0);
+ std::vector< std::vector < std::vector < unsigned int > > > testSels;
+ testSels.resize(0);
-TEST( corrTests, corrTests_update )
-{
- // основная работа программы
+ int testTau_jump = 100;
+ int testWindow = 1000;
+ int testTau = 500;
+ float testCrl_border = 0.5;
+ float testEff_rad = 1.5;
+ std::string testOutPutName = "testString";
+ RVec a; a[0] = 1; a[1] = 2; a[2] = 3;
+ correlationType testCorrs;
+ std::vector< int > testIndex;
+ testIndex.resize(0);
+
+ testSels.resize(1);
+ testSels[0].resize(1);
+ testSels[0][0].resize(0);
+ for (unsigned int i = 0; i < 100; i++) {
+ testReference.push_back(a);
+ testResNms.push_back(std::to_string(i));
+ testSels[0][0].push_back(i);
+ testIndex.push_back(i);
+ }
+
+ testCorrs.setDefaults(testReference, testWindow, testTau, testTau_jump, testCrl_border, testEff_rad, 0, testOutPutName, testIndex, testSels, testResNms);
+
+ ASSERT_EQ(testCorrs.window, testWindow);
+ ASSERT_EQ(testCorrs.tau, testTau);
+ ASSERT_EQ(testCorrs.tauStep, testTau_jump);
+ ASSERT_EQ(testCorrs.crlUpBorder, testCrl_border);
+ ASSERT_EQ(testCorrs.effRadius, testEff_rad);
+ ASSERT_EQ(testCorrs.mode, 0);
+ ASSERT_EQ(testCorrs.outputName, testOutPutName);
+ for (unsigned int i = 0; i < 100; i++) {
+ ASSERT_EQ(testCorrs.reference[i][0], testReference[i][0]);
+ ASSERT_EQ(testCorrs.reference[i][1], testReference[i][1]);
+ ASSERT_EQ(testCorrs.reference[i][2], testReference[i][2]);
+ ASSERT_EQ(testCorrs.index[i], testIndex[i]);
+ ASSERT_EQ(testCorrs.selections[0][0][i], testSels[0][0][i]);
+ ASSERT_EQ(testCorrs.resNames[i], testResNms[i]);
+ }
}
TEST( corrTests, corrTests_trajectoryPartition )
{
- // разб��рка траектории
+ // разб��ение молекулы на куски исходя из доменов и распределение невошедшей части к доменам
}
TEST( corrTests, corrTests_correlationEval )
{
- // вычисление корреляци��
+ // вычисление корреляци��нных матриц на основе траектории
}
TEST( corrTests, corrTests_graphCalculations )
{
- // создание графа
+ // создание графа на основе посчитанных матриц
}
TEST( corrTests, corrTests_graphBackBoneEvaluation )
{
- // выделение остовного(?) графа
+ // выделение остовного(?) графа на базе полного графа
+}
+
+TEST( corrTests, corrTests_update )
+{
+ // основная работа программы целиком
}
int main(int argc, char *argv[]) {