% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scoring.R
\name{threshold_edges}
\alias{threshold_edges}
\title{Threshold scored edges}
\usage{
threshold_edges(scored_edges, method = "quantile", value = 0.7)
}
\arguments{
\item{scored_edges}{A data.frame with a \code{HybridScore} column.}

\item{method}{Character; one of \code{"quantile"}, \code{"score"}, \code{"top_n"}.}

\item{value}{Numeric; meaning depends on \code{method}.}
}
\value{
A data.frame of retained edges, sorted by descending
\code{HybridScore}.
}
\description{
Filters a scored edge list using one of three methods:
\describe{
\item{\code{"quantile"}}{Retain edges above the given quantile of
\code{HybridScore}. Default \code{value = 0.7} retains the top 30
percent.}
\item{\code{"score"}}{Retain edges with \code{HybridScore >= value}.}
\item{\code{"top_n"}}{Retain the top \code{value} edges by \code{HybridScore}.}
}
}
\examples{
scored <- data.frame(
  source = paste0("MAG", 1:10),
  target = paste0("MAG", 11:20),
  HybridScore = seq(0.1, 1.0, by = 0.1)
)
top5 <- threshold_edges(scored, method = "top_n", value = 5)
nrow(top5)

}
