% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compartment_score.R
\name{sign_compartmentscore}
\alias{sign_compartmentscore}
\title{Sign compartment score.}
\usage{
sign_compartmentscore(
  CS_discovery,
  bed = NULL,
  bedgraph = NULL,
  verbose = FALSE,
  ref = 1
)
}
\arguments{
\item{CS_discovery}{A \code{CS_discovery} object as produced by the
\code{\link[GENOVA]{compartment_score}} function.}

\item{bed}{A \code{data.frame} with 3 columns in BED format, containing peaks
of active chromatin marks. Mutually exclusive with the '\code{bedgraph}'
argument.}

\item{bedgraph}{A \code{data.frame} with 4 columns in bedGraph format,
containing scores correlated with active chromatin. Mutually exclusive with
the '\code{bed}' argument.}

\item{verbose}{A \code{logical} of length 1. If \code{TRUE}, reports when
'\code{bedgraph}' correlations are weak or uncomputable.}

\item{ref}{An \code{integer} of length 1 giving a sample index that can be
used as a reference. Set to \code{NULL} to sign every sample individually.}
}
\value{
A \code{CS_discovery} object with \code{signed} attribute set to
  \code{TRUE}
}
\description{
Takes pre-computed eigenvectors per chromosome arm and adjust the sign based
on metrics of active chromatin.
}
\details{
Signing compartment scores is necessary to have the compartment
  scores correspond to A and B compartments.

  Some decent '\code{bed}'/'\code{bedgraph}' arguments to use are ChIP-seq
  peaks of H3K4me1, gene density, (inverted) Lamina DamID signal, GC content
  or early replication timing metrics.
}
\examples{
\dontrun{
# Doing the eigenvector decomposition only yields unsigned scores
cs <- compartment_score(list(WT_100kb, KO_100kb))

# Signing the scores
cs <- sign_compartmentscore(cs, bed = H3K4me1_peaks)
}
}
\seealso{
\code{\link[GENOVA]{compartment_score}} for computing the
  eigenvectors.
}
