The resources package#

Glycosylator comes with a dedicated reference dataset for glycans structures. This dataset is loaded by default and can be accessed using the glycosylator.resources.get_default_compounds() and glycosylator.resources.get_default_topology() functions.

In addition to the dedicated datasets, Glycosylator comes with additional auxiliary resources that are doucumented here.

The sequons module#

Pre-defined sequons for protein glycosylation sites

glycosylator.resources.sequons.SEQUONS = {'N-linked': <glycosylator.resources.sequons.Sequon object>, 'O-linked': <glycosylator.resources.sequons.Sequon object>}#

Default sequons for protein glycosylation sites

class glycosylator.resources.sequons.Sequon(id: str, pattern: str)[source]#

Bases: object

A class representing a sequon pattern for glycosylation

add_linkage(resname: str, linkage: str)[source]#

Add a linkage id that is associated with a given residue

Parameters:
  • resname (str) – Residue name

  • linkage (str) – Linkage id

get_linkage(resname: str, _topology=None) Linkage[source]#

Get the linkage id associated with a given residue

Parameters:
  • resname (str) – Residue name

  • _topology (Topology) – A particular topology to use to get the linkage from.

Returns:

The Linkage object

Return type:

Linkage

to_dict()[source]#

Convert the sequon to a dictionary

Returns:

Sequon dictionary

Return type:

dict

glycosylator.resources.sequons.add_sequon(sequon_or_pattern: str | Sequon, key: str = None, overwrite: bool = False)[source]#

Add a sequon to the default sequons

Parameters:
  • sequon_or_pattern (str) – Sequon object or regex pattern

  • key (str) – Sequon key, if a regex pattern is provided.

  • overwrite (bool) – If True, the new sequon is permanently included in the default sequons file.

glycosylator.resources.sequons.available_sequons() list[source]#

Get the available sequons

Returns:

Sequons

Return type:

list

glycosylator.resources.sequons.get_default_sequons() dict[source]#

Get the default sequons

Returns:

Sequons

Return type:

dict

glycosylator.resources.sequons.get_sequon(key: str) Sequon[source]#

Get a sequon regex pattern

Parameters:

key (str) – Sequon key

Return type:

Sequon or None

glycosylator.resources.sequons.load_sequons(filename: str) dict[source]#

Load a json file with sequons

Parameters:

filename (str) – Path to the json file

Returns:

Sequons

Return type:

dict

glycosylator.resources.sequons.restore_sequons(overwrite: bool = True)[source]#

Restore the default sequon regex patterns

Parameters:

overwrite (bool) – If True, the backup is permanently set as the default again.

glycosylator.resources.sequons.save_sequons(filename: str)[source]#

Save the current sequon regex patterns to a json file

Parameters:

filename (str) – Path to the json file

glycosylator.resources.sequons.set_default_sequons(sequons: dict)[source]#

Set the default sequons

Parameters:

sequons (dict) – Sequons

The icons module#

Icons for drawing glycan structures in 2D

glycosylator.resources.icons.get_base_color(name: str) str[source]#

Get the only base color of a monosaccharide

Parameters:

name (str) – The name of the monosaccharide

Returns:

The base color of the monosaccharide

Return type:

str

glycosylator.resources.icons.get_icon(name: str) ndarray[source]#

Get an icon by name

Parameters:

name (str) – The name of the icon

Returns:

The icon image

Return type:

“ndarray”

glycosylator.resources.icons.get_icon_path(name: str) str[source]#

Get the path to an icon PNG file

Parameters:

name (str)

Return type:

str

The names module#

These are name mappings for glycan residues between their PDB identifiers and IUPAC names.

glycosylator.resources.names.id_to_name(id: str) str[source]#

Translate a monosaccharide PDB id to a name

Parameters:

id (str) – The PDB id of the monosaccharide

Returns:

The name of the monosaccharide. If the id is not found, it is returned as is.

Return type:

str

glycosylator.resources.names.is_beta(id: str) bool[source]#

Check if a monosaccharide PDB id is beta-configured.

Parameters:

id (str) – The PDB id of the monosaccharide

Returns:

True if the monosaccharide is beta-configured, False otherwise.

Return type:

bool