% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/liana_pipe.R
\name{.sp_costrain}
\alias{.sp_costrain}
\title{Weigh by spatial constrans}
\usage{
.sp_costrain(lr_res, cell.adj, adjacency = "adjacency")
}
\arguments{
\item{lr_res}{liana_pipe output prior to joining complexes}

\item{cell.adj}{cell adjacency weights (should be positive)}

\item{adjacency}{name of the column with cell pair adjacency scores}
}
\value{
weighed lr_res
}
\description{
Weigh by spatial constrans
}
\details{
Note that for the case that there are weights from 0-1, the negative
values (in e.g. logFC, z-scores) might be counter-logically affected - i.e.
they would be brought closer to 0.
Thus, by default liana expects weights from 0-1. These are then multiplied
for positive values, while negative values are divided.

Alternatively, one could e.g. multiply the weights by a factor (e.g. 10,000),
if logFC and Connectome are used. However, this would change some of
the assumptions/interpretations of the scores, while
consensus ranking will be unaffected.

Also, note that any interactions between cell pairs with an adjacency of 0
will be excluded (this would affect the scores from CytoTalk).

NB! `%/*/%` is only applicable and relevant to logFC and z-scores from a
single-context, and should not be used when scaling between conditions!!!
}
\keyword{internal}
