sidechainnet/structure/StructureBuilder.py
def _get_residue_build_iter(res, build_dictionary):
    """Return an iterator over (bond-lens, angles, torsions, atom names) for a residue.

    This function makes it easy to iterate over the huge amount of data contained in
    the dictionary sidechainnet.structure.build_info.SC_BUILD_INFO. This dictionary
    contains all of the various standard bond and angle values that are used during atomic
    reconstruction of a residue from its angles.

    Args:
        res (int): An interger representing the integer code for a particular amino acid,
            e.g. 'Ala' == 'A' == 0 in sequence.py.
        build_dictionary (dict): A dictionary mapping 3-letter amino acid codes to
            dictionaries of information relevant to the construction of this amino acid
            from angles (i.e. angle names, atom types, bond lengths, bond types, torsion
            types, etc.). See sidechainnet.structure.build_info.SC_BUILD_INFO.

    Returns:
        iterator: An iterator that yields 4-tuples of (bond-value, angle-value,
        torsion-value, atom-name). These values can be used to generating atomic
        coordinates for a residue via the NeRF algorithm
        (sidechainnet.structure.structure.nerf).
    """
    r = build_dictionary[VOCAB.int2chars(int(res))]
    bond_vals = [torch.tensor(b, dtype=torch.float32) for b in r["bonds-vals"]]
    pbond_vals = [torch.tensor(BB_BUILD_INFO['BONDLENS']['n-ca'], dtype=torch.float32)
                 ] + [torch.tensor(b, dtype=torch.float32) for b in r["bonds-vals"]][:-1]
    angle_vals = [torch.tensor(a, dtype=torch.float32) for a in r["angles-vals"]]
    torsion_vals = [
        torch.tensor(t, dtype=torch.float32) if t not in ["p", "i"] else t
        for t in r["torsion-vals"]
    ]
    return iter(
        zip(pbond_vals, bond_vals, angle_vals, torsion_vals,
            [t.split("-") for t in r["torsion-names"]]))
Return an iterator over (bond-lens, angles, torsions, atom names) for a residue.

    This function makes it easy to iterate over the huge amount of data contained in
    the dictionary sidechainnet.structure.build_info.SC_BUILD_INFO. This dictionary
    contains all of the various standard bond and angle values that are used during atomic
    reconstruction of a residue from its angles.

    Args:
        res (int): An interger representing the integer code for a particular amino acid,
            e.g. 'Ala' == 'A' == 0 in sequence.py.
        build_dictionary (dict): A dictionary mapping 3-letter amino acid codes to
            dictionaries of information relevant to the construction of this amino acid
            from angles (i.e. angle names, atom types, bond lengths, bond types, torsion
            types, etc.). See sidechainnet.structure.build_info.SC_BUILD_INFO.

    Returns:
        iterator: An iterator that yields 4-tuples of (bond-value, angle-value,
        torsion-value, atom-name). These values can be used to generating atomic
        coordinates for a residue via the NeRF algorithm
        (sidechainnet.structure.structure.nerf).
    
Return an iterator over (bond-lens, angles, torsions, atom names) for a residue.
This function makes it easy to iterate over the huge amount of data contained in
the dictionary sidechainnet.structure.build_info.SC_BUILD_INFO. This dictionary
contains all of the various standard bond and angle values that are used during atomic
reconstruction of a residue from its angles.
Return an iterator over ( bond - lens angles torsions atom names ) for a residue . This function makes it easy to iterate over the huge amount of data contained in the dictionary sidechainnet . structure . build_info . SC_BUILD_INFO . This dictionary contains all of the various standard bond and angle values that are used during atomic reconstruction of a residue from its angles .
def _get_residue_build_iter(res, build_dictionary):
    r = build_dictionary[VOCAB.int2chars(int(res))]
    bond_vals = [torch.tensor(b, dtype=torch.float32) for b in r["bonds-vals"]]
    pbond_vals = [torch.tensor(BB_BUILD_INFO['BONDLENS']['n-ca'], dtype=torch.float32)
                 ] + [torch.tensor(b, dtype=torch.float32) for b in r["bonds-vals"]][:-1]
    angle_vals = [torch.tensor(a, dtype=torch.float32) for a in r["angles-vals"]]
    torsion_vals = [
        torch.tensor(t, dtype=torch.float32) if t not in ["p", "i"] else t
        for t in r["torsion-vals"]
    ]
    return iter(
        zip(pbond_vals, bond_vals, angle_vals, torsion_vals,
            [t.split("-") for t in r["torsion-names"]]))
def _get_residue_build_iter ( res , build_dictionary ) : r = build_dictionary [ VOCAB . int2chars ( int ( res ) ) ] bond_vals = [ torch . tensor ( b , dtype = torch . float32 ) for b in r [ "bonds-vals" ] ] pbond_vals = [ torch . tensor ( BB_BUILD_INFO [ 'BONDLENS' ] [ 'n-ca' ] , dtype = torch . float32 ) ] + [ torch . tensor ( b , dtype = torch . float32 ) for b in r [ "bonds-vals" ] ] [ : - 1 ] angle_vals = [ torch . tensor ( a , dtype = torch . float32 ) for a in r [ "angles-vals" ] ] torsion_vals = [ torch . tensor ( t , dtype = torch . float32 ) if t not in [ "p" , "i" ] else t for t in r [ "torsion-vals" ] ] return iter ( zip ( pbond_vals , bond_vals , angle_vals , torsion_vals , [ t . split ( "-" ) for t in r [ "torsion-names" ] ] ) )
Return an iterator over (bond-lens, angles, torsions, atom names) for a residue.
Return an iterator over ( bond - lens angles torsions atom names ) for a residue .
"""Return an iterator over (bond-lens, angles, torsions, atom names) for a residue.

    This function makes it easy to iterate over the huge amount of data contained in
    the dictionary sidechainnet.structure.build_info.SC_BUILD_INFO. This dictionary
    contains all of the various standard bond and angle values that are used during atomic
    reconstruction of a residue from its angles.

    Args:
        res (int): An interger representing the integer code for a particular amino acid,
            e.g. 'Ala' == 'A' == 0 in sequence.py.
        build_dictionary (dict): A dictionary mapping 3-letter amino acid codes to
            dictionaries of information relevant to the construction of this amino acid
            from angles (i.e. angle names, atom types, bond lengths, bond types, torsion
            types, etc.). See sidechainnet.structure.build_info.SC_BUILD_INFO.

    Returns:
        iterator: An iterator that yields 4-tuples of (bond-value, angle-value,
        torsion-value, atom-name). These values can be used to generating atomic
        coordinates for a residue via the NeRF algorithm
        (sidechainnet.structure.structure.nerf).
    """
An iterator that yields 4-tuples of (bond-value, angle-value,
torsion-value, atom-name). These values can be used to generating atomic
coordinates for a residue via the NeRF algorithm
(sidechainnet.structure.structure.nerf).
An iterator that yields 4 - tuples of ( bond - value angle - value torsion - value atom - name ) . These values can be used to generating atomic coordinates for a residue via the NeRF algorithm ( sidechainnet . structure . structure . nerf ) .
iterator
res
An interger representing the integer code for a particular amino acid,
e.g.
An interger representing the integer code for a particular amino acid e . g .
build_dictionary
A dictionary mapping 3-letter amino acid codes to
dictionaries of information relevant to the construction of this amino acid
from angles . See sidechainnet.structure.build_info.SC_BUILD_INFO.
A dictionary mapping 3 - letter amino acid codes to dictionaries of information relevant to the construction of this amino acid from angles . See sidechainnet . structure . build_info . SC_BUILD_INFO .