% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read_mzid.R
\name{mzid_parse_psms}
\alias{mzid_parse_psms}
\title{Parse rank-PSMs from mzIdentML (internal)}
\usage{
mzid_parse_psms(
  mzid_path,
  rank = 1L,
  score_accession_preference = c("MS:1002257"),
  min_score_coverage = 1,
  decoy_regex = "(^##|_REVERSED$|^REV_|^DECOY_)"
)
}
\arguments{
\item{mzid_path}{Character scalar. Path to an mzIdentML file.}

\item{rank}{Integer scalar. Which \code{SpectrumIdentificationItem@rank} to extract.}

\item{score_accession_preference}{Character vector of preferred score accessions.}

\item{min_score_coverage}{Numeric in (0,1]. Minimum fraction of PSMs required to have
the chosen score CV term.}

\item{decoy_regex}{Character scalar. Regex for inferring decoys from DBSequence accessions.}
}
\value{
Tibble with columns id, run, is_decoy, score_accession, score_name, score_value.

A \link[tibble:tibble]{tibble} with columns \code{id}, \code{run},
\code{is_decoy}, \code{score_accession}, \code{score_name}, \code{score_value}.
}
\description{
Extracts SpectrumIdentificationItems at the requested rank, derives decoy labels
using PeptideEvidence@isDecoy when available, with fallback to DBSequence accession
regex inference, and selects a single numeric score term with sufficient coverage.
}
\keyword{internal}
