libpappsomspp
Library for mass spectrometry
|
#include <spectree.h>
Classes | |
struct | MapSimilarityCount |
struct | MapSimilarityCountElement |
struct | SpecTreeNode |
Public Member Functions | |
SpecTree (const BucketClustering &bucket_clustering) | |
virtual | ~SpecTree () |
QString | toString () const |
const std::vector< std::size_t > & | getSpectrumFirstNodeIndex () const |
get the adress map of sepctrum index and their first node index | |
void | xtract (UiMonitorInterface &monitor, SpecXtractInterface &spec_xtract, std::size_t minimum_count, std::size_t cart_id_range_max, std::size_t cart_id_range_min, std::size_t target_cart_id_max, std::size_t target_cart_id_min) const |
std::size_t | extractSpectrumPairSimilarityCount (std::size_t spectrum_a_index, std::size_t spectrum_b_index) const |
get the number of common component for a pair of spectrum | |
Private Member Functions | |
void | addNewNode (const SpecTreeNode &node) |
void | manageSideAccess (std::vector< std::size_t > &spectrumLastNodeIndex) |
void | walkBackInBranchFromNode (const SpecTree::SpecTreeNode &start_node, MapSimilarityCount &map_count, std::size_t minimum_count, std::size_t target_cart_id_max, std::size_t target_cart_id_min) const |
std::size_t | walkBackInBranchFromNodeToTarget (const SpecTree::SpecTreeNode &start_node, std::size_t spectrum_index_target) const |
void | extractSpectrumSimilarityCount (MapSimilarityCount &map_count, std::size_t minimum_count, std::size_t spectrum_index, std::size_t target_cart_id_max, std::size_t target_cart_id_min) const |
get a map of similarities for a given spectrum index | |
Private Attributes | |
std::vector< SpecTreeNode > | m_nodeList |
std::vector< std::size_t > | m_spectrumFirstNodeIndex |
Static Private Attributes | |
static constexpr std::size_t | index_not_defined |
Definition at line 52 of file spectree.h.
pappso::spectree::SpecTree::SpecTree | ( | const BucketClustering & | bucket_clustering | ) |
Build a SpecTree with BucketClustering
Definition at line 48 of file spectree.cpp.
References pappso::spectree::BucketClustering::asSortedList(), pappso::spectree::SpecTree::SpecTreeNode::count, pappso::spectree::BucketClustering::getItemCartCount(), index_not_defined, m_nodeList, m_spectrumFirstNodeIndex, manageSideAccess(), pappso::spectree::SpecTree::SpecTreeNode::nextIndex, pappso::spectree::SpecTree::SpecTreeNode::parentIndex, and pappso::spectree::SpecTree::SpecTreeNode::value.
|
virtual |
|
private |
Definition at line 168 of file spectree.cpp.
References m_nodeList.
std::size_t pappso::spectree::SpecTree::extractSpectrumPairSimilarityCount | ( | std::size_t | spectrum_a_index, |
std::size_t | spectrum_b_index | ||
) | const |
get the number of common component for a pair of spectrum
spectrum_a_index | the first spectrum index |
spectrum_b_index | the second spectrum index |
Definition at line 435 of file spectree.cpp.
References index_not_defined, m_nodeList, m_spectrumFirstNodeIndex, pappso::spectree::SpecTree::SpecTreeNode::nextIndex, and walkBackInBranchFromNodeToTarget().
|
private |
get a map of similarities for a given spectrum index
this function can only retrieve spectrum index map lower than the spectrum index given in the parameters (check original publication for details)
spectrum_index | the spectrum index to retrieve similarities |
spectrum_index_lower_limit | lower spectrum index limit to save CPU (do not use it if you want a full similarity map) |
Extraction of the similarities above a given threshold between a given spectrum and all other spectra higher located in SpecTrees.
tree_indices | SpecTrees the data has to be extracted from |
spectrum_index | The spectrum with ated in SpecTrees. |
tree_indices | SpecTrees the data has to be extracted from |
spectrum_index | The spectrum with which we want to extract similarities |
minimum_count | The threshold to use for the extraction |
Definition at line 407 of file spectree.cpp.
References index_not_defined, m_nodeList, m_spectrumFirstNodeIndex, pappso::spectree::SpecTree::SpecTreeNode::nextIndex, and walkBackInBranchFromNode().
Referenced by xtract().
const std::vector< std::size_t > & pappso::spectree::SpecTree::getSpectrumFirstNodeIndex | ( | ) | const |
get the adress map of sepctrum index and their first node index
convenience function intended for testing
Definition at line 224 of file spectree.cpp.
References m_spectrumFirstNodeIndex.
|
private |
Definition at line 174 of file spectree.cpp.
References index_not_defined, m_nodeList, and m_spectrumFirstNodeIndex.
Referenced by SpecTree().
QString pappso::spectree::SpecTree::toString | ( | ) | const |
Definition at line 199 of file spectree.cpp.
References index_not_defined, and m_nodeList.
|
private |
Definition at line 318 of file spectree.cpp.
References pappso::spectree::SpecTree::MapSimilarityCount::aboveThreshold, pappso::spectree::SpecTree::SpecTreeNode::count, index_not_defined, pappso::spectree::SpecTree::MapSimilarityCount::keys, m_nodeList, pappso::spectree::SpecTree::MapSimilarityCount::map_id_count, pappso::spectree::SpecTree::SpecTreeNode::parentIndex, and pappso::spectree::SpecTree::SpecTreeNode::value.
Referenced by extractSpectrumSimilarityCount().
|
private |
Definition at line 374 of file spectree.cpp.
References pappso::spectree::SpecTree::SpecTreeNode::count, index_not_defined, m_nodeList, pappso::spectree::SpecTree::SpecTreeNode::parentIndex, and pappso::spectree::SpecTree::SpecTreeNode::value.
Referenced by extractSpectrumPairSimilarityCount().
void pappso::spectree::SpecTree::xtract | ( | UiMonitorInterface & | monitor, |
SpecXtractInterface & | spec_xtract, | ||
std::size_t | minimum_count, | ||
std::size_t | cart_id_range_max, | ||
std::size_t | cart_id_range_min, | ||
std::size_t | target_cart_id_max, | ||
std::size_t | target_cart_id_min | ||
) | const |
Extract all similarities above a threshold value between all spectra from the deepest one up to the given limit using the predefined extraction algorithm. The results are stored in the mentionned reporter.
Performs the extraction of the similarities above a given threshold for all spectra between the deepest one and a given index in the transversal accessor. The extracted pairs are feed to a shifter to try to improve the spectrum identification. Afterwards, the retained results are written to the given reporter. This extraction step represents most of SpecOMS execution time. Note: This function heavily evolved through the development process to match new needs, it became clumsy and heavy. A clean refactor might be appropriate.
monitor | progress monitor, indicates progression in spectree |
spec_xtract | report results of similarities to the user (write in file or consolidate) |
cart_id_range_max | The position in the transversal accessor from which the similarities must be reported |
cart_id_range_min | The position in the transversal accessor up to which the similarities must be reported |
item_cart_index_lower_limit | lower spectrum index limit to save CPU (do not use it if you want a full similarity map) |
Definition at line 230 of file spectree.cpp.
References pappso::spectree::SpecTree::MapSimilarityCount::aboveThreshold, pappso::spectree::SpecXtractInterface::beginItemCartExtraction(), pappso::UiMonitorInterface::count(), pappso::spectree::SpecXtractInterface::endItemCartExtraction(), extractSpectrumSimilarityCount(), pappso::spectree::SpecTree::MapSimilarityCount::keys, m_spectrumFirstNodeIndex, pappso::spectree::SpecTree::MapSimilarityCount::map_id_count, pappso::spectree::SpecXtractInterface::reportSimilarity(), pappso::UiMonitorInterface::setStatus(), pappso::UiMonitorInterface::setTotalSteps(), and pappso::UiMonitorInterface::shouldIstop().
|
staticconstexprprivate |
Definition at line 118 of file spectree.h.
Referenced by SpecTree(), extractSpectrumPairSimilarityCount(), extractSpectrumSimilarityCount(), manageSideAccess(), toString(), walkBackInBranchFromNode(), and walkBackInBranchFromNodeToTarget().
|
private |
Definition at line 172 of file spectree.h.
Referenced by SpecTree(), addNewNode(), extractSpectrumPairSimilarityCount(), extractSpectrumSimilarityCount(), manageSideAccess(), toString(), walkBackInBranchFromNode(), and walkBackInBranchFromNodeToTarget().
|
private |
Definition at line 173 of file spectree.h.
Referenced by SpecTree(), extractSpectrumPairSimilarityCount(), extractSpectrumSimilarityCount(), getSpectrumFirstNodeIndex(), manageSideAccess(), and xtract().