sidechainnet/structure/StructureBuilder.py
def build_sc(self):
        """Build the sidechain atoms for this residue.

        Care is taken when placing the first sc atom (the beta-Carbon). This is
        because the dihedral angle that places this atom must be defined using a
        neighboring (previous or next) residue.
        """
        assert len(self.bb) > 0, "Backbone must be built first."
        self.atom_names = ["N", "CA", "C", "O"]
        self.pts = {"N": self.bb[0], "CA": self.bb[1], "C": self.bb[2]}
        if self.next_res:
            self.pts["N+"] = self.next_res.bb[0]
        else:
            self.pts["C-"] = self.prev_res.bb[2]

        last_torsion = None
        for i, (pbond_len, bond_len, angle, torsion, atom_names) in enumerate(
                _get_residue_build_iter(self.name, SC_BUILD_INFO)):
            # Select appropriate 3 points to build from
            if self.next_res and i == 0:
                a, b, c = self.pts["N+"], self.pts["C"], self.pts["CA"]
            elif i == 0:
                a, b, c = self.pts["C-"], self.pts["N"], self.pts["CA"]
            else:
                a, b, c = (self.pts[an] for an in atom_names[:-1])

            # Select appropriate torsion angle, or infer if part of a planar configuration
            if type(torsion) is str and torsion == "p":
                torsion = self.ang[SC_ANGLES_START_POS + i]
            elif type(torsion) is str and torsion == "i" and last_torsion is not None:
                torsion = last_torsion - np.pi

            new_pt = nerf(a,
                          b,
                          c,
                          bond_len,
                          angle,
                          torsion,
                          l_bc=pbond_len,
                          nerf_method=self.nerf_method)
            self.pts[atom_names[-1]] = new_pt
            self.sc.append(new_pt)
            last_torsion = torsion
            self.atom_names.append(atom_names[-1])

        return self.sc
Build the sidechain atoms for this residue.

        Care is taken when placing the first sc atom (the beta-Carbon). This is
        because the dihedral angle that places this atom must be defined using a
        neighboring (previous or next) residue.
        
Build the sidechain atoms for this residue.
Care is taken when placing the first sc atom (the beta-Carbon). This is
because the dihedral angle that places this atom must be defined using a
neighboring (previous or next) residue.
Build the sidechain atoms for this residue . Care is taken when placing the first sc atom ( the beta - Carbon ) . This is because the dihedral angle that places this atom must be defined using a neighboring ( previous or next ) residue .
def build_sc(self):
        assert len(self.bb) > 0, "Backbone must be built first."
        self.atom_names = ["N", "CA", "C", "O"]
        self.pts = {"N": self.bb[0], "CA": self.bb[1], "C": self.bb[2]}
        if self.next_res:
            self.pts["N+"] = self.next_res.bb[0]
        else:
            self.pts["C-"] = self.prev_res.bb[2]
        last_torsion = None
        for i, (pbond_len, bond_len, angle, torsion, atom_names) in enumerate(
                _get_residue_build_iter(self.name, SC_BUILD_INFO)):
            if self.next_res and i == 0:
                a, b, c = self.pts["N+"], self.pts["C"], self.pts["CA"]
            elif i == 0:
                a, b, c = self.pts["C-"], self.pts["N"], self.pts["CA"]
            else:
                a, b, c = (self.pts[an] for an in atom_names[:-1])
            if type(torsion) is str and torsion == "p":
                torsion = self.ang[SC_ANGLES_START_POS + i]
            elif type(torsion) is str and torsion == "i" and last_torsion is not None:
                torsion = last_torsion - np.pi
            new_pt = nerf(a,
                          b,
                          c,
                          bond_len,
                          angle,
                          torsion,
                          l_bc=pbond_len,
                          nerf_method=self.nerf_method)
            self.pts[atom_names[-1]] = new_pt
            self.sc.append(new_pt)
            last_torsion = torsion
            self.atom_names.append(atom_names[-1])
        return self.sc
def build_sc ( self ) : assert len ( self . bb ) > 0 , "Backbone must be built first." self . atom_names = [ "N" , "CA" , "C" , "O" ] self . pts = { "N" : self . bb [ 0 ] , "CA" : self . bb [ 1 ] , "C" : self . bb [ 2 ] } if self . next_res : self . pts [ "N+" ] = self . next_res . bb [ 0 ] else : self . pts [ "C-" ] = self . prev_res . bb [ 2 ] last_torsion = None for i , ( pbond_len , bond_len , angle , torsion , atom_names ) in enumerate ( _get_residue_build_iter ( self . name , SC_BUILD_INFO ) ) : if self . next_res and i == 0 : a , b , c = self . pts [ "N+" ] , self . pts [ "C" ] , self . pts [ "CA" ] elif i == 0 : a , b , c = self . pts [ "C-" ] , self . pts [ "N" ] , self . pts [ "CA" ] else : a , b , c = ( self . pts [ an ] for an in atom_names [ : - 1 ] ) if type ( torsion ) is str and torsion == "p" : torsion = self . ang [ SC_ANGLES_START_POS + i ] elif type ( torsion ) is str and torsion == "i" and last_torsion is not None : torsion = last_torsion - np . pi new_pt = nerf ( a , b , c , bond_len , angle , torsion , l_bc = pbond_len , nerf_method = self . nerf_method ) self . pts [ atom_names [ - 1 ] ] = new_pt self . sc . append ( new_pt ) last_torsion = torsion self . atom_names . append ( atom_names [ - 1 ] ) return self . sc
Build the sidechain atoms for this residue.
Build the sidechain atoms for this residue .
"""Build the sidechain atoms for this residue.

        Care is taken when placing the first sc atom (the beta-Carbon). This is
        because the dihedral angle that places this atom must be defined using a
        neighboring (previous or next) residue.
        """ # Select appropriate 3 points to build from # Select appropriate torsion angle, or infer if part of a planar configuration
self