Glycome-DB HTTP Client

class glypy.io.glycomedb.GlycomeDBSearchMatch(id, score, cross_reference, species_number, **kwargs)[source]

Bases: object

A search match which carries information about the scored match and the id number for retrieving the Glycan or GlycanRecord.

get()[source]

Fetch the Glycan referenced by this search result

Returns:

Glycan:

The Glycan referenced

get_record()[source]

Fetch the GlycanRecord referenced by this search result

Returns:

GlycanRecord:

The GlycanRecord referenced by this search result

glypy.io.glycomedb.get(id)[source]

Get the structure for id from GlycomeDB.

GlycomeDB supplies a detailed schema link which allows lxml to easily pull out more than just the GlycoCT string. To download a more informative record, use get_record()

Parameters:id: str or int
Returns:Glycan
glypy.io.glycomedb.get_record(id)[source]

Get the complete record for id from GlycomeDB.

Returns:GlycanRecord
glypy.io.glycomedb.glycan_record_from_xml(xml_tree, id)[source]

Converts an XML document and the associated database into an instance of GlycanRecord.

Parameters:

xml_tree: lxml.etree

XML document to consume

id:

GlycomeDB id number to assign this record

Returns:

GlycanRecord:

Constructed record

glypy.io.glycomedb.make_entries(annotation)[source]

Helper method to create Entry objects from <entry></entry> tags in Taxon and Aglyca.

glypy.io.glycomedb.search_by_species(tax_id)[source]

Select all structures which are associated with the provided taxonomy id, or one of its children.

Parameters:

tax_id: int or str

The taxonomy id to search for

Yields:

GlycomeDBSearchMatch

glypy.io.glycomedb.search_minimum_common_substructure(glycan_obj, minimum_residues=1)[source]

Select all structures which have a minimum common substructure of minimum_residues with glycan_obj.

Parameters:

glycan_obj: Glycan

The glycan structure to search for

minimum_residues: int

The minimum number of residues to match

Yields:

GlycomeDBSearchMatch

glypy.io.glycomedb.search_substructure(glycan_obj)[source]

Select all structures which have contain glycan_obj.

Parameters:

glycan_obj: Glycan

The glycan structure to search for

Yields:

GlycomeDBSearchMatch

glypy.io.glycomedb.set_cache(path)[source]

Set the path to the current cache for use with this client. This will create an instance of RecordDatabase using the path provided.

Any record lookups will first check the cache for that identifier, and if found will return from there. Any records not found will be fetched from the remote database and saved in the cache before returning.