Network module

GNPS Utils - Network Module

This module provides functionality to connect to GNPS and retrieve data.

Author: Shahneh

modifinder.utilities.network.accession_to_usi(accession: str) str[source]

Get the USI from an accession id param accession: str return: str

modifinder.utilities.network.get_data(identifier: str) dict[source]
Get data from GNPS, either from USI or Accession. if the identifier points to a known item in gnps,

it will return the full data, otherwise it will return partial data (ms2 data)

param identifier: str - USI or Accession return: dict - dictionary of data

modifinder.utilities.network.get_matched_peaks(identifier1: str, identifier2: str) dict[source]

runs the gnps modified cosine matching algorithm and returns the matched peaks param identifier1: str - USI or Accession param identifier2: str - USI or Accession return: dict - dictionary of matched peaks

modifinder.utilities.network.get_np_classifier(smiles)[source]

Get the NP classifier data for a molecule

Parameters:

smiles (str) – SMILES string of the molecule.

Returns:

Dictionary with keys: class_types (list), superclasses (list), pathways (list), isglycoside (bool).

Return type:

dict

modifinder.utilities.network.usi_to_accession(usi: str) str[source]

Get the accession number from a USI param usi: str return: str if found, None otherwise