R/deal_net.R

Defines functions deal_net

Documented in deal_net

#' Title deal with network
#'
#' @param net a network
#' @param dise_gene a matrix with one column of genes
#'
#' @return a matrix
#' @export
#'
#' @examples
#' deal_net(net,dise_gene)
deal_net <- function(net, dise_gene) {
    net_genes <- union(net[, 1], net[, 2])
    dise_genes <- intersect(dise_gene[, 1], net_genes)
    aa1 <- which(net[, 1] %in% dise_genes)
    aa2 <- which(net[, 2] %in% dise_genes)
    aa <- union(aa1, aa2)
    net_disease <- net[aa, ]
    return(net_disease)
}

Try the prioGene package in your browser

Any scripts or data that you put into this service are public.

prioGene documentation built on March 26, 2020, 8:01 p.m.