Skip to contents

Your database and query spectra could be a mix of positive and negative mode spectra. This function filters out matches where the polarity is not the same between query and target (DB).

Usage

filterMisMatchedPolarity(
  matches,
  query_mode_col = "ionmode",
  target_mode_col = "polarity"
)

Arguments

matches

MatchedSpectra objects with database matches

query_mode_col

Column in the spectraData that holds polarity information for the query spectra. Expected to be "pos" or "neg"

target_mode_col

Column in the spectraData that holds polarity information for the target spectra (the DB). Expected to be 0 (for neg) or 1 (for pos)

Value

A MatchedSpectra() object with only the matches that have same polarity