schrodinger.livedesign.biologics.fasta module¶
- class schrodinger.livedesign.biologics.fasta.FastaHeader(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
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, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
enum.Enum
- NA = 'NUCLEIC_ACID'¶
- AB = 'ANTIBODY'¶
- class schrodinger.livedesign.biologics.fasta.PolymerAssembler(sequences: list[str], mappings: dict[schrodinger.livedesign.biologics.fasta.FastaHeader, int])¶
Bases:
object
- POLYMER_SUBTYPES = None¶
- HEADER_BY_SUBTYPE = None¶
- __init__(sequences: list[str], mappings: dict[schrodinger.livedesign.biologics.fasta.FastaHeader, int])¶
- assemble() schrodinger.protein.helm._helm_parser.HelmModel ¶
- classmethod validate(subtypes: set[schrodinger.livedesign.biologics.fasta.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[schrodinger.livedesign.biologics.fasta.FastaHeader, int])¶
Bases:
schrodinger.livedesign.biologics.fasta.PolymerAssembler
- POLYMER_SUBTYPES = {<FastaHeader.RNA_SENSE: 'RNA_SENSE_STRAND'>, <FastaHeader.DNA_ANTISENSE: 'DNA_ANTISENSE_STRAND'>, <FastaHeader.DNA_SENSE: 'DNA_SENSE_STRAND'>, <FastaHeader.RNA_ANTISENSE: 'RNA_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_ANTISENSE: 'DNA_ANTISENSE_STRAND'>, <FastaHeader.DNA_SENSE: 'DNA_SENSE_STRAND'>}¶
- assemble() schrodinger.protein.helm._helm_parser.HelmModel ¶
- class schrodinger.livedesign.biologics.fasta.AntibodyAssembler(sequences: list[str], mappings: dict[schrodinger.livedesign.biologics.fasta.FastaHeader, int])¶
Bases:
schrodinger.livedesign.biologics.fasta.PolymerAssembler
- POLYMER_SUBTYPES = {<FastaHeader.AB_LC2: 'HC2'>, <FastaHeader.AB_HC2: 'LC2'>, <FastaHeader.AB_LC: 'HC'>, <FastaHeader.AB_LC1: 'HC1'>, <FastaHeader.AB_HC: 'LC'>, <FastaHeader.AB_HC1: 'LC1'>}¶
- 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 ¶
- schrodinger.livedesign.biologics.fasta.get_fasta_helm_models(fasta_str: str, single_entity_mapping: Optional[dict[schrodinger.livedesign.biologics.fasta.FastaHeader, int]] = None) Iterator[schrodinger.protein.helm._helm_parser.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[schrodinger.livedesign.biologics.fasta.FastaHeader, int]) Iterator[schrodinger.protein.helm._helm_parser.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[schrodinger.livedesign.biologics.fasta.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[schrodinger.livedesign.biologics.fasta.FastaHeader, int]) type[schrodinger.livedesign.biologics.fasta.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