---
name: "GO::Model::Xref"
section: "3pm"
platform: "linux"
package: "libgo-perl"
version: "0.15-10"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/GO::Model::Xref"
---

# GO::Model::Xref(3pm)

## NAME

```
  GO::Model::Xref - cross reference to an external database
```

## SYNOPSIS

```
  my $xrefs = $term->dbxref_list();
  foreach my $xref (@$xrefs) P
    printf "Term %s has an xref %s:%s\n",
            $term->name, $xref->xref_key, $xref->dbname;
  }
```

## DESCRIPTION

represents a cross reference to an external database. an Xref is made up of a key (ie the accession number, or whatever the value of the unique field being keyed off of is) and a database name. this should theorerically be enough to uniquely identify any databased entity.

## NOTES

Like all the GO::Model::\* classes, this uses accessor methods to get or set the attributes. by using the accessor method without any arguments gets the value of the attribute. if you pass in an argument, then the attribuet will be set according to that argument.

for instance

```
  # this sets the value of the attribute
  $my_object->attribute_name("my value");
  # this gets the value of the attribute
  $my_value = $my_object->attribute_name();
```

### xref\_key

```
  Alias   - acc
  Alias   - accession
  Usage   -
  Returns -
  Args    -
 accessor: gets/sets the key/id of the cross reference
```

### xref\_keytype

```
  Usage   -
  Returns -
  Args    -
 accessor: gets/sets the key/id type of the cross reference
```

### as\_str

```
  Usage   -
  Returns -
  Args    -
```

### xref\_dbname

```
  Alias   - dbname
  Usage   -
  Returns -
  Args    -
 accessor: gets/sets the database name of the cross reference
```

must be a valid database name

### xref\_desc

```
  Alias   - name
  Usage   -
  Returns -
  Args    -
 accessor: gets/sets the description of the accession no
```

useful for interpro

### to\_xml

```
  Usage   - print $xref->to_xml()
  Returns - string
  Args    - indent [integer]
```

XML representation; you probably shouldn't call this directly, this will be called by entities that own xrefs
