---
name: "Bio::Graph::Edge"
section: "3pm"
platform: "linux"
package: "bioperl"
version: "1.5.2.102-3"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/Bio::Graph::Edge"
---

# Bio::Graph::Edge(3pm)

Bio::Graph::Edge - encapsulation of an interaction between 2 Bio::Seq objects

```
  ## get an interaction between two nodes ##
```

```
  my $edge  = $gr->edge( $gr->nodes_by_id('P12345'),
                         $gr->nodes_by_id('P23456'));
  my $id    = $edge->object_id();
  my $wt    = $edge->weight();
  my @nodes = $edge->nodes();
```

This class contains information about a bimolecular interaction. At present it just contains data about its component node, a weight (if set) and an identifier. Subclasses could hold more specific  information.\
 **Mailing Lists** User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated.

```
  bioperl-l@bioperl.org                  - General discussion
  http://bioperl.org/wiki/Mailing_lists  - About the mailing lists
```

**Reporting Bugs** Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution.  Bug reports can be submitted via the web:

```
  http://bugzilla.open-bio.org/
```

Email richard.adams@ed.ac.uk\
 **new**

```
 Name       : new
 Purpose    : constructor for an edge object
 Usage      : my $edge = Bio::Graph::Edge->new(nodes => [$node1,$node2]
                                               id => $id);
              $graph->add_edge($edge);
 Returns    : a new Bio::Graph::Edge object
 Arguments  : hash nodes            => array reference of 2 nodes
                   id               => edge id
                   weight(optional) => weight score.
```

**weight**

```
 Name      : weight
 Purpose   : get/setter for weight score
 Usage     : my $weight = $edge->weight();
 Returns   : anumber
 Arguments : void/ a number
```

**object\_id**

```
 Name      : object_id
 Purpose   : get/setter for object_id
 Usage     : my $id = $edge->object_id();
 Returns   : a string identifier
 Arguments : void/ an identifier
```

**nodes**

```
 Name      : nodes
 Purpose   : get/setter for nodes
 Usage     : my @nodes = $edge->nodes();
 Returns   : a 2 element list of nodes /void
 Arguments : void/ a 2 element list of nodes.
```
