public static Set < BioPAXElement > runNeighborhood ( Set < BioPAXElement > sourceSet , Model model , int limit , Direction direction , Filter ... filters ) { Graph graph ; if ( model . getLevel ( ) == BioPAXLevel . L3 ) { if ( direction == Direction . UNDIRECTED ) { graph = new GraphL3Undirected ( model , filters ) ; direction = Direction . BOTHSTREAM ; } else { graph = new GraphL3 ( model , filters ) ; } } else return Collections . emptySet ( ) ; Set < Node > source = prepareSingleNodeSet ( sourceSet , graph ) ; if ( sourceSet . isEmpty ( ) ) return Collections . emptySet ( ) ; NeighborhoodQuery query = new NeighborhoodQuery ( source , direction , limit ) ; Set < GraphObject > resultWrappers = query . run ( ) ; return convertQueryResult ( resultWrappers , graph , true ) ; }
Gets neighborhood of the source set .