schrodinger.livedesign.biologics.fasta module

class schrodinger.livedesign.biologics.fasta.FastaHeader(value)

Bases: enum.Enum

NOTE: Must remain in sync with LiveDesign, see: seurat/SEURAT-JavaScript/dev/src/bb/app/biologics/enums/EntityType.js

DNA_SENSE = 'DNA_SENSE_STRAND'
DNA_ANTISENSE = 'DNA_ANTISENSE_STRAND'
RNA_SENSE = 'RNA_SENSE_STRAND'
RNA_ANTISENSE = 'RNA_ANTISENSE_STRAND'
AB_HC = 'LC'
AB_LC = 'HC'
AB_HC1 = 'LC1'
AB_LC1 = 'HC1'
AB_HC2 = 'LC2'
AB_LC2 = 'HC2'
class schrodinger.livedesign.biologics.fasta.PolymerType(value)

Bases: enum.Enum

An enumeration.

NA = 'NUCLEIC_ACID'
AB = 'ANTIBODY'
class schrodinger.livedesign.biologics.fasta.PolymerAssembler(sequences: list[str], mappings: dict[FastaHeader, int])

Bases: object

POLYMER_SUBTYPES = None
HEADER_BY_SUBTYPE = None
__init__(sequences: list[str], mappings: dict[FastaHeader, int])
assemble() schrodinger.protein.helm._helm_parser.HelmModel
classmethod validate(subtypes: set[FastaHeader])
classmethod get_corresponding_header(subtype: schrodinger.livedesign.biologics.fasta.FastaHeader) Union[schrodinger.protein.helm._nucleic_acid.NucleicAcidHeader, schrodinger.application.bioluminate.antibody.io.csv_reader.Headers]
class schrodinger.livedesign.biologics.fasta.NucleicAcidAssembler(sequences: list[str], mappings: dict[FastaHeader, int])

Bases: schrodinger.livedesign.biologics.fasta.PolymerAssembler

POLYMER_SUBTYPES = {<FastaHeader.RNA_ANTISENSE: 'RNA_ANTISENSE_STRAND'>, <FastaHeader.RNA_SENSE: 'RNA_SENSE_STRAND'>, <FastaHeader.DNA_SENSE: 'DNA_SENSE_STRAND'>, <FastaHeader.DNA_ANTISENSE: 'DNA_ANTISENSE_STRAND'>}
HEADER_BY_SUBTYPE = {<FastaHeader.DNA_SENSE: 'DNA_SENSE_STRAND'>: <NucleicAcidHeader.S: 'Sense Strand'>, <FastaHeader.DNA_ANTISENSE: 'DNA_ANTISENSE_STRAND'>: <NucleicAcidHeader.AS: 'Antisense Strand'>, <FastaHeader.RNA_SENSE: 'RNA_SENSE_STRAND'>: <NucleicAcidHeader.S: 'Sense Strand'>, <FastaHeader.RNA_ANTISENSE: 'RNA_ANTISENSE_STRAND'>: <NucleicAcidHeader.AS: 'Antisense Strand'>}
DEOXY_SUBTYPES = {<FastaHeader.DNA_SENSE: 'DNA_SENSE_STRAND'>, <FastaHeader.DNA_ANTISENSE: 'DNA_ANTISENSE_STRAND'>}
assemble() schrodinger.protein.helm._helm_parser.HelmModel
__init__(sequences: list[str], mappings: dict[FastaHeader, int])
classmethod get_corresponding_header(subtype: schrodinger.livedesign.biologics.fasta.FastaHeader) Union[schrodinger.protein.helm._nucleic_acid.NucleicAcidHeader, schrodinger.application.bioluminate.antibody.io.csv_reader.Headers]
classmethod validate(subtypes: set[FastaHeader])
class schrodinger.livedesign.biologics.fasta.AntibodyAssembler(sequences: list[str], mappings: dict[FastaHeader, int])

Bases: schrodinger.livedesign.biologics.fasta.PolymerAssembler

POLYMER_SUBTYPES = {<FastaHeader.AB_HC: 'LC'>, <FastaHeader.AB_LC: 'HC'>, <FastaHeader.AB_HC2: 'LC2'>, <FastaHeader.AB_LC1: 'HC1'>, <FastaHeader.AB_HC1: 'LC1'>, <FastaHeader.AB_LC2: 'HC2'>}
HEADER_BY_SUBTYPE = {<FastaHeader.AB_HC: 'LC'>: <Headers.HC: 'HC'>, <FastaHeader.AB_LC: 'HC'>: <Headers.LC: 'LC'>, <FastaHeader.AB_HC1: 'LC1'>: <Headers.HC1: 'HC1'>, <FastaHeader.AB_LC1: 'HC1'>: <Headers.LC1: 'LC1'>, <FastaHeader.AB_HC2: 'LC2'>: <Headers.HC2: 'HC2'>, <FastaHeader.AB_LC2: 'HC2'>: <Headers.LC2: 'LC2'>}
assemble() schrodinger.protein.helm._helm_parser.HelmModel
__init__(sequences: list[str], mappings: dict[FastaHeader, int])
classmethod get_corresponding_header(subtype: schrodinger.livedesign.biologics.fasta.FastaHeader) Union[schrodinger.protein.helm._nucleic_acid.NucleicAcidHeader, schrodinger.application.bioluminate.antibody.io.csv_reader.Headers]
classmethod validate(subtypes: set[FastaHeader])
schrodinger.livedesign.biologics.fasta.get_fasta_helm_models(fasta_str: str, single_entity_mapping: Optional[dict[FastaHeader, int]] = None) Iterator[HelmModel]

Yield all helm models generated by the parsing of the fasta data. If single-entity, this will include one entry for each sequence, as well as entries for any recognized combined constructs

Parameters
  • fasta_str – a string containing fasta data

  • single_entity_mapping – dict indicating how to create a single entity; if absent, the fasta will be parsed as multiple entities

Returns

an iterator of helm models, one for each identified entity

schrodinger.livedesign.biologics.fasta.parse_multi_entity_fasta(fasta_str: str) Iterator[schrodinger.protein.helm._helm_parser.HelmModel]

Parse the fasta string as a standard peptide fasta, with one HelmModel per sequence

Parameters

fasta_str – a string containing fasta data

Returns

an iterator of helm models, one for each sequence

schrodinger.livedesign.biologics.fasta.get_single_chain_peptide_helm_model(seq: str) schrodinger.protein.helm._helm_parser.HelmModel

Create a HelmModel for a single simple peptide

Parameters

seq – the sequence of the peptide to add

Returns

a simple helm model with the given peptide sequence

schrodinger.livedesign.biologics.fasta.parse_single_entity_fasta(fasta_str: str, mappings: dict[FastaHeader, int]) Iterator[HelmModel]

Parse the single-entity-formatted fasta string as an antibody, with one HelmModel for each single-chain or multi-chain entity identified

Parameters
  • fasta_str – fasta string

  • mappings – dict of entry index by FastaHeader

Returns

an iterator of helm models, one for each hierarchical entity in the construct

Raises

ValueError – if the mappings are invalid for a single-entity fasta

schrodinger.livedesign.biologics.fasta.validate_mappings(mappings: dict[FastaHeader], num_sequences: int)

Validate that the given mappings are valid for a single-entity fasta

Parameters
  • mappings – a dictionary identifying which sequence index corresponds to which polymer subtype

  • num_sequences – the number of sequences in the fasta input

Raises

ValueError – if the mappings are empty or sequence indices do not match the fasta

schrodinger.livedesign.biologics.fasta.get_assembler_type(mappings: dict[FastaHeader, int]) type[PolymerAssembler]

Determine which type of assembler to use based on the group of subtypes in the mappings dict :param mappings: a dictionary identifying which sequence index corresponds to which polymer subtype :return: the assembler type that matches the given subtypes