schrodinger.protein.mafft_utils module

schrodinger.protein.mafft_utils.generate_allowed_hex_codes(exclude_hex_codes: list[str]) list[str]

Generates a list of 2-digit lowercase hexadecimal strings for integers from 1 to 255, excluding any hex codes present in the exclude_hex_codes list.

schrodinger.protein.mafft_utils.map_residue_names_to_hex(seqs: list[ProteinSequence]) dict[str, str]

Maps unique residue names in given sequences to hex code. Returns a dictionary mapping residue name (str) to hex string (str).

Parameters:

seqs – List of protein sequences.

class schrodinger.protein.mafft_utils.MafftHexReader

Bases: object

A class to read and write MAFFT hex files and extract seqeunces hex codes.

classmethod read(file_name: str)

Read a MAFFT hex file and extract sequences as hex codes.

class schrodinger.protein.mafft_utils.MafftHexWriter

Bases: object

A class to write sequences to a MAFFT hex file.

classmethod write(file_name: str, sequences: list[ProteinSequence], residue_mapper: dict[str, str])

Write sequences to a MAFFT hex file. Residue names are converted to hex codes using the provided mapper.