psite_annotation.annotators.MotifAnnotator

class psite_annotation.annotators.MotifAnnotator(annotation_file)

Bases: object

Annotate pandas dataframe with motifs from uniprot.

Requires “Site sequence context” column in the dataframe to be present. The “Site sequence context” column can be generated with PeptidePositionAnnotator().

Example

annotator = MotifAnnotator(<path_to_annotation_file>)
annotator.load_annotations()
df = annotator.annotate(df)

Initialize the input files and options for MotifAnnotator.

Parameters:

annotation_file (Union[str, IO]) – tab separated file with motifs and their identifiers

Methods

annotate

Adds column with motifs the site sequence context matches with.

load_annotations

Reads in tab separated file with motif annotations compiled from multiple databases.

annotate(df, inplace=False)

Adds column with motifs the site sequence context matches with.

Adds the following annotation columns to dataframe:

  • Motifs = semicolon separated list of motifs that match with the site sequence contexts

Parameters:
  • df (DataFrame) – pandas dataframe with “Site sequence context” column

  • inplace (bool) – Whether to modify the DataFrame rather than creating a new one.

Returns:

annotated dataframe

Return type:

pd.DataFrame

Required columns:

Site sequence context

load_annotations()

Reads in tab separated file with motif annotations compiled from multiple databases.

Return type:

None