R/FilterEdges.ShortPathSTRINGNet.R

Defines functions FilterEdges.ShortPathSTRINGNet

Documented in FilterEdges.ShortPathSTRINGNet

FilterEdges.ShortPathSTRINGNet <-
function (x,Threshold,AttributeFilter="Distance", ...)
{
	KeepPos<-which(x$Edges[,AttributeFilter]<=Threshold)
	FilteredNet<-x
	FilteredNet$Edges<-FilteredNet$Edges[KeepPos,]
	Nodes<-unique(c(FilteredNet$Edges$node1,FilteredNet$Edges$node2))
	FilteredNet$DEGenes<-FilteredNet$DEGenes[rownames(FilteredNet$DEGenes) %in% Nodes,]
	if(!is.null(FilteredNet$Annotations)){FilteredNet$Annotations<-FilteredNet$Annotations[rownames(FilteredNet$Annotations) %in% Nodes,]}
	return(FilteredNet)
}

Try the stringgaussnet package in your browser

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

stringgaussnet documentation built on May 29, 2017, 10:50 a.m.