51 if(msrun_ida == msrun_idb)
53 QString msrun_key(QString(
"%1-%2").arg(msrun_ida.
getXmlId()).arg(msrun_idb.
getXmlId()));
58 msrun_key = QString(
"%1-%2").arg(msrun_idb.
getXmlId()).arg(msrun_ida.
getXmlId());
59 std::swap(xic_coorda, xic_coordb);
62 auto it_start = m_mapDiferrencesStart.insert({msrun_key, std::vector<qint64>()});
63 const QVariant &ref_variantb =
65 if(ref_variantb.isNull())
68 "XicCoordParam::TimsTofIonMobilityScanNumberStart QVariant is null for xic_coordb"));
70 const QVariant &ref_varianta =
73 if(ref_varianta.isNull())
76 "XicCoordParam::TimsTofIonMobilityScanNumberStart QVariant is null for xic_coorda"));
78 it_start.first->second.push_back(ref_variantb.toLongLong() - ref_varianta.toLongLong());
81 auto it_stop = m_mapDiferrencesStop.insert({msrun_key, std::vector<qint64>()});
82 it_stop.first->second.push_back(
90 for(
auto pair_key_start_vector : m_mapDiferrencesStart)
93 if(pair_key_start_vector.second.size() > 5)
96 const auto middleItr =
97 pair_key_start_vector.second.begin() + (pair_key_start_vector.second.size() / 2);
99 pair_key_start_vector.second.begin(), middleItr, pair_key_start_vector.second.end());
100 m_mapCorrectionsStart[pair_key_start_vector.first] = *middleItr;
104 m_mapCorrectionsStart[pair_key_start_vector.first] = 0;
107 m_mapDiferrencesStart.clear();
108 for(
auto pair_key_stop_vector : m_mapDiferrencesStop)
111 if(pair_key_stop_vector.second.size() > 5)
114 const auto middleItr =
115 pair_key_stop_vector.second.begin() + (pair_key_stop_vector.second.size() / 2);
117 pair_key_stop_vector.second.begin(), middleItr, pair_key_stop_vector.second.end());
118 m_mapCorrectionsStop[pair_key_stop_vector.first] = *middleItr;
122 m_mapCorrectionsStop[pair_key_stop_vector.first] = 0;
125 m_mapDiferrencesStop.clear();
133 if(m_mapCorrectionsStop.size() == 0)
138 bool opposed =
false;
139 QString msrun_key(QString(
"%1-%2").arg(source_msrunid.
getXmlId()).arg(target_msrunid.
getXmlId()));
144 msrun_key = QString(
"%1-%2").arg(target_msrunid.
getXmlId()).arg(source_msrunid.
getXmlId());
147 auto itstart = m_mapCorrectionsStart.find(msrun_key);
149 if(itstart != m_mapCorrectionsStart.end())
151 start_dev = itstart->second;
158 auto itstop = m_mapCorrectionsStop.find(msrun_key);
160 if(itstop != m_mapCorrectionsStop.end())
162 stop_dev = itstop->second;
174 return result_xic_coord_sp;
177const std::map<QString, std::vector<qint64>> &
180 return m_mapDiferrencesStart;
183const std::map<QString, long> &
186 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
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