25 transpose_ = transpose;
31 void MatrixAnalyzer::GetData()
43 QString MatrixAnalyzer::FindUniqueName(QString name)
45 if (data_keys_.size() > 2){
46 QSharedPointer<AnalysisResults> results =
workspace_->GetAnalysisResults(data_keys_[0], data_keys_[1]);
47 QMap<QString, uvec> parent_rows = results->parent_rows();
48 QString new_name = name;
49 QStringList results_names;
51 for (
auto dataset_key: parent_rows.keys())
52 results_names = results_names +
workspace_->GetDataset(dataset_key)->AnalysisResultsKeys();
53 while (results_names.contains(new_name))
54 new_name = name +
" (" + QString::number(++i) +
")";
60 void MatrixAnalyzer::AddAnalysisResults(QSharedPointer<AnalysisResults> results, QStringList matrices)
62 QString first_dataset_key = data_keys_.first();
63 QSharedPointer<VespucciDataset> first_dataset =
workspace_->GetDataset(first_dataset_key);
64 if (data_keys_.size() < 3) first_dataset->AddAnalysisResult(results);
66 QSharedPointer<AnalysisResults> parent_results =
workspace_->GetAnalysisResults(data_keys_[0], data_keys_[1]);
67 QMap<QString, uvec> parent_rows = parent_results->parent_rows();
68 if (parent_rows.size() < 2){
69 first_dataset->AddAnalysisResult(results);
73 for (
auto key: parent_rows.keys()){
74 QSharedPointer<VespucciDataset> current_dataset =
workspace_->GetDataset(key);
75 current_dataset->AddAnalysisResult(results);
76 if (!matrices.isEmpty())
77 current_dataset->AddAnalysisResult(results->Subset(matrices, parent_rows[key](0), parent_rows[key](1)));
MatrixAnalyzer(QSharedPointer< VespucciWorkspace > ws, const QStringList &data_keys, bool transpose)