Converting¶
convert¶
- convert(glycan=None, glycan_list=None, glycan_file=None, glycan_generator=None, output_file=None, returning=True, verbose=20, cpu_count=1, full=True)[source]¶
Convert glycans of different input formats. All glycans have to be in IUPAC-condensed notation, but how they’re organized, can change. Either as single glycan, list or tuples of glycans, a file, or a generator. All will be converted to SMILES.
- Parameters
glycan (str) – Single glycan to be converted from IUPAC to SMILES
glycan_list (List[str]) – list of glycans to convert
glycan_file (str) – File to read the glycans from
glycan_generator (generator) – generator yielding iupac representation. Together with output_generator=True this does not create any lists
output_file (str) – File to save the converted glycans in
returning (bool) – Flag indicating to return a list of tuples
verbose (Union[int, None]) – Flag indicating to have no prints from this method
cpu_count (int) – Number of CPU cores to use for parallel processing. Behavior as described in joblib: https://joblib.readthedocs.io/en/latest/generated/joblib.Parallel.html
full (bool) – Flag indicating that only fully convertible glycans should be returned, i.e. all modifications such as 3-Anhydro-[…] are also present in the SMILES
- Returns
List of type (IUPAC, SMILES) items giving the converted SMILES formulas. Only if returning=True is set.
convert_generator¶
- convert_generator(glycan=None, glycan_list=None, glycan_file=None, glycan_generator=None, verbose=20, cpu_count=1, full=True)[source]¶
Convert glycans of different input formats. All glycans have to be in IUPAC-condensed notation, but how they’re organized, can change. Either as single glycan, list or tuples of glycans, a file, or a generator. All will be converted to SMILES, output by a generator.
- Parameters
glycan (str) – Single glycan to be converted from IUPAC to SMILES
glycan_list (List[str]) – list of glycans to convert
glycan_file (str) – File to read the glycans from
glycan_generator (generator) – generator yielding iupac representation. Together with output_generator=True this does not create any lists
verbose (Union[int, None]) – Flag indicating to have no output-messages from this method
cpu_count (int) – Number of CPU cores to use for parallel processing. Behavior as described in joblib: https://joblib.readthedocs.io/en/latest/generated/joblib.Parallel.html
full (bool) – Flag indicating that only fully convertible glycans should be returned, i.e. all modifications such as 3-Anhydro-[…] are also present in the SMILES
- Returns
Generator generating pairs of type (IUPAC, SMILES) items giving the converted SMILES formulas for the IUPACs.