R/FilterEdges.SIMoNeNet.R

Defines functions FilterEdges.SIMoNeNet

Documented in FilterEdges.SIMoNeNet

FilterEdges.SIMoNeNet <-
function(x,Threshold,Superior=T,AttributeFilter="Rho",Absolute=T, ...)
{
	Scores<-x$Edges[,AttributeFilter]
	if(Absolute){Scores<-abs(Scores)}
	KeepPos<-which(Scores>=Threshold)
	if(!Superior){KeepPos<-which(Scores<=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.