frag_pele/PlopRotTemp_S_2017/template/templateBuilder.py
def build_triangular_matrix(self, stretchings, tors, phis, atom_names):
        """
            Build triangular interaction matrix.
            You can find more information in PELE's docs
        """
        bonds = stretchings

        counts = []
        connections = []
        for i, atom_name in enumerate(atom_names):
            count = 0
            connected = []
            for stretching in bonds[:]:
                if i in stretching:
                    count += 1
                    if i == stretching[0]:
                        connected.append(str(stretching[1]+1))
                    else:
                        connected.append(str(stretching[0]+1))
                    bonds.remove(stretching)
            for tor in tors[:]:
                if str(i+1) in tor[0:3]:
                    count += 1
                    tors.remove(tor)
            for phi in phis[:]:
                if str(i+1) in phi[0:4]:
                    count += 1
                    phis.remove(phi)
            counts.append(count)
            connections.append(connected)
        final_counts = " ".join([str(count) for count in counts if count != 0 ])
        connections_repited = [ " ".join(connection) if connection else "0" for connection in connections ]
        final_connections = [x[0] for x in groupby(connections_repited)]
        triangular_matrix = final_counts+"\n"+"\n".join(final_connections)

            Build triangular interaction matrix.
            You can find more information in PELE's docs
        
Build triangular interaction matrix.
You can find more information in PELE's docs
Build triangular interaction matrix . You can find more information in PELE ' s docs
def build_triangular_matrix(self, stretchings, tors, phis, atom_names):
        bonds = stretchings
        counts = []
        connections = []
        for i, atom_name in enumerate(atom_names):
            count = 0
            connected = []
            for stretching in bonds[:]:
                if i in stretching:
                    count += 1
                    if i == stretching[0]:
                        connected.append(str(stretching[1]+1))
                    else:
                        connected.append(str(stretching[0]+1))
                    bonds.remove(stretching)
            for tor in tors[:]:
                if str(i+1) in tor[0:3]:
                    count += 1
                    tors.remove(tor)
            for phi in phis[:]:
                if str(i+1) in phi[0:4]:
                    count += 1
                    phis.remove(phi)
            counts.append(count)
            connections.append(connected)
        final_counts = " ".join([str(count) for count in counts if count != 0 ])
        connections_repited = [ " ".join(connection) if connection else "0" for connection in connections ]
        final_connections = [x[0] for x in groupby(connections_repited)]
        triangular_matrix = final_counts+"\n"+"\n".join(final_connections)
def build_triangular_matrix ( self , stretchings , tors , phis , atom_names ) : bonds = stretchings counts = [ ] connections = [ ] for i , atom_name in enumerate ( atom_names ) : count = 0 connected = [ ] for stretching in bonds [ : ] : if i in stretching : count += 1 if i == stretching [ 0 ] : connected . append ( str ( stretching [ 1 ] + 1 ) ) else : connected . append ( str ( stretching [ 0 ] + 1 ) ) bonds . remove ( stretching ) for tor in tors [ : ] : if str ( i + 1 ) in tor [ 0 : 3 ] : count += 1 tors . remove ( tor ) for phi in phis [ : ] : if str ( i + 1 ) in phi [ 0 : 4 ] : count += 1 phis . remove ( phi ) counts . append ( count ) connections . append ( connected ) final_counts = " " . join ( [ str ( count ) for count in counts if count != 0 ] ) connections_repited = [ " " . join ( connection ) if connection else "0" for connection in connections ] final_connections = [ x [ 0 ] for x in groupby ( connections_repited ) ] triangular_matrix = final_counts + "\n" + "\n" . join ( final_connections )
Build triangular interaction matrix.
Build triangular interaction matrix .
"""
            Build triangular interaction matrix.
            You can find more information in PELE's docs
        """
self
stretchings
tors
phis
atom_names