36IonMobilityGrid::IonMobilityGrid()
51 if(msrun_ida == msrun_idb)
61 std::swap(xic_coorda, xic_coordb);
65 m_mapDiferrencesStart.insert({msrun_key, std::vector<qint64>()});
66 it_start.first->second.push_back(
74 m_mapDiferrencesStop.insert({msrun_key, std::vector<qint64>()});
75 it_stop.first->second.push_back(
85 for(
auto pair_key_start_vector : m_mapDiferrencesStart)
88 if(pair_key_start_vector.second.size() > 5)
91 const auto middleItr = pair_key_start_vector.second.begin() +
92 (pair_key_start_vector.second.size() / 2);
93 std::nth_element(pair_key_start_vector.second.begin(),
95 pair_key_start_vector.second.end());
96 m_mapCorrectionsStart[pair_key_start_vector.first] = *middleItr;
100 m_mapCorrectionsStart[pair_key_start_vector.first] = 0;
103 m_mapDiferrencesStart.clear();
104 for(
auto pair_key_stop_vector : m_mapDiferrencesStop)
107 if(pair_key_stop_vector.second.size() > 5)
110 const auto middleItr = pair_key_stop_vector.second.begin() +
111 (pair_key_stop_vector.second.size() / 2);
112 std::nth_element(pair_key_stop_vector.second.begin(),
114 pair_key_stop_vector.second.end());
115 m_mapCorrectionsStop[pair_key_stop_vector.first] = *middleItr;
119 m_mapCorrectionsStop[pair_key_stop_vector.first] = 0;
122 m_mapDiferrencesStop.clear();
131 if(m_mapCorrectionsStop.size() == 0)
136 bool opposed =
false;
137 QString msrun_key(QString(
"%1-%2")
144 msrun_key = QString(
"%1-%2")
149 auto itstart = m_mapCorrectionsStart.find(msrun_key);
151 if(itstart != m_mapCorrectionsStart.end())
153 start_dev = itstart->second;
160 auto itstop = m_mapCorrectionsStop.find(msrun_key);
162 if(itstop != m_mapCorrectionsStop.end())
164 stop_dev = itstop->second;
178 return result_xic_coord_sp;
181const std::map<QString, std::vector<qint64>> &
184 return m_mapDiferrencesStart;
187const std::map<QString, long> &
190 return m_mapCorrectionsStart;
const std::map< QString, long > & getMapCorrectionsStart() const
pappso::XicCoordSPtr translateXicCoordFromTo(const pappso::XicCoord &source_xic_coord, const MsRunId &source_msrunid, const MsRunId &target_msrunid) const
void computeCorrections()
void storeObservedIdentityBetween(const MsRunId &msrun_ida, const XicCoord *xic_coorda, const MsRunId &msrun_idb, const XicCoord *xic_coordb)
const std::map< QString, std::vector< qint64 > > & getMapDiferrencesStart() const
virtual ~IonMobilityGrid()
MS run identity MsRunId identifies an MS run with a unique ID (XmlId) and contains eventually informa...
const QString & getXmlId() const
store observed ion mobility coordinates differences between MS runs
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
@ TimsTofIonMobilityScanNumberStart
@ TimsTofIonMobilityScanNumberStop
std::shared_ptr< XicCoord > XicCoordSPtr
coordinates of the XIC to extract and the resulting XIC after extraction
void scanNumBeginRangeCorrection(long start_dev, long stop_dev)
apply scan num correction on xic coordinate
coordinates of the XIC to extract and the resulting XIC after extraction
virtual XicCoordSPtr initializeAndClone() const
intialize the XIC and make a deep copy of object
virtual const QVariant getParam(XicCoordParam param) const
get a specific XIC coordinate parameter
XIC coordinate in a Tims MSrun.