getedgesbynodeid (biograph)

Get handles to edges in graph

Syntax

Edges = getedgesbynodeid(BGobj, SourceIDs, SinkIDs)

Arguments

BGobj

Biograph object.

SourceIDs, SinkIDs

Enter a cell string, or an empty cell array (gets all edges).

Description

Edges = getedgesbynodeid(BGobj, SourceIDs, SinkIDs) gets the edge handles that connect the specified source nodes (SourceIDs) to the specified sink nodes (SinkIDs).

Example

  1. Create a biograph object for the Hominidae family.

    species = {'Homosapiens','Pan','Gorilla','Pongo','Baboon',...
               'Macaca','Gibbon'};
    cm = magic(7)>25 & 1-eye(7);
    bg = biograph(cm, species);
    
  2. Find all the edges that connect to the Homosapiens node.

    EdgesIn = getedgesbynodeid(bg,[],'Homo');
    EdgesOut = getedgesbynodeid(bg,'Homo');
    set(EdgesIn,'LineColor',[0 1 0]);
    set(EdgesOut,'LineColor',[1 0 0]);
    bg.view;
    
  3. Find all edges that connect members of the Cercopithecidae family to members of the Hominidae family.

    Cercopithecidae = {'Macaca','Baboon'};
    Hominidae = {'Homo','Pan','Gorilla','Pongo'};
    edgesSel = getedgesbynodeid(bg,Cercopithecidae,Hominidae);
    set(bg.edges,'LineColor',[.5 .5 .5]);
    set(edgesSel,'LineColor',[0 0 1]);
    bg.view;

See Also

Bioinformatics Toolbox methods for the biograph object, biograph, dolayout, getancestors, getdescendants, getnodesbyid, getrelatives, view

MATLAB functions get, set


© 1994-2005 The MathWorks, Inc.