pypath.core.annot.AnnotationTable§

class pypath.core.annot.AnnotationTable(proteins=(), complexes=(), protein_sources=None, complex_sources=None, use_fields=None, ncbi_tax_id=9606, swissprot_only=True, use_complexes=True, keep_annotators=True, create_dataframe=False, load=True, pickle_file=None)[source]§

Bases: Logger

__init__(proteins=(), complexes=(), protein_sources=None, complex_sources=None, use_fields=None, ncbi_tax_id=9606, swissprot_only=True, use_complexes=True, keep_annotators=True, create_dataframe=False, load=True, pickle_file=None)[source]§

Manages a custom set of annotation resources. Loads data and accepts queries, provides methods for converting the data to data frame.

Parameters:
  • proteins (set) – A reference set of proteins (UniProt IDs).

  • complexes (set) – A reference set of complexes.

  • protein_sources (set) – Class names providing the protein annotations. If not provided the module’s protein_sources_default attribute will be used.

  • complex_sources (set) – Class names providing the complex annotations. If not provided the module’s complex_sources_default attribute will be used.

  • use_fields (dict) – A dict with resource names as keys and tuple of field labels as values. If provided for any resource only these fields will be used for constructing the data frame. If None, the module’s default_fields settings will be used.

  • use_complexes (bool) – Whether to include complexes in the annotations.

  • create_dataframe (bool) – Whether to create a boolean data frame of annotations, apart from having the annotator objects.

  • load (bool) – Load the data upon initialization. If False, you will have a chance to call the load method later.

Methods

__init__([proteins, complexes, ...])

Manages a custom set of annotation resources.

all_annotations(entity)

Returns all annotation records for one protein in a single list.

all_annotations_str(protein)

Returns all annotation records for one protein serialized.

annotate_network(pa)

ensure_array([reference_set, rebuild])

export_network_stats(pa)

get_complexes()

get_entities([entity_type])

get_mirnas()

get_proteins()

keep(keep)

load()

load_complex_resources()

load_from_pickle(pickle_file)

load_protein_resources()

make_array([reference_set])

make_dataframe([reference_set])

make_narrow_df()

make_sets()

network_stats(pa)

numof_complexes()

numof_entities([entity_type])

numof_mirnas()

numof_proteins()

numof_records([entity_type])

numof_resources()

reload()

Reloads the object from the module level.

save_to_pickle(pickle_file)

search(protein)

Returns a dictionary with all annotations of a protein.

set_cols()

set_reference_set()

summaries_tab([outfile, return_table])

to_array([reference_set])

to_dataframe([reference_set])

update_summaries()

all_annotations(entity)[source]§

Returns all annotation records for one protein in a single list.

all_annotations_str(protein)[source]§

Returns all annotation records for one protein serialized.

reload()[source]§

Reloads the object from the module level.

search(protein)[source]§

Returns a dictionary with all annotations of a protein. Keys are the resource names.