本文整理汇总了Python中FUNC.hash方法的典型用法代码示例。如果您正苦于以下问题:Python FUNC.hash方法的具体用法?Python FUNC.hash怎么用?Python FUNC.hash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FUNC
的用法示例。
在下文中一共展示了FUNC.hash方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import FUNC [as 别名]
# 或者: from FUNC import hash [as 别名]
#.........这里部分代码省略.........
# (2, 0.0, 1), (2, 0.0, 1), (2, 0.0, 1),
# (2, 0.0, 1), (2, 0.0, 1), (2, 0.0, 1),
# (2, 0.0, 1), (2, 0.0, 1), (2, 0.0, 1),
# (2, 0.0, 1), (2, 0.0, 1), (2, 0.0, 1)],
# [], # IMPROPERS
# [], # VSITES
# [(), (), (), (), (), (), (), (), ()]], # EXCLUSIONS
# })
# self.base_connectivity.update({
# "DT": [[(2, 3), (3, 4), (4, 5), # BONDS
# (5, 3)],
# [(1, 2, 3), (2, 3, 4), (2, 3, 5), # ANGLES
# (3, 2, 6), (3, 4, 5), (4, 3, 5),
# (4, 5, 3), (2, 3, 6), (1, 3, 5),
# (2, 1, 3), (2, 1, 5)],
# [(0, 1, 2, 3), (0, 2, 3, 4), (0, 2, 3, 5), # DIHEDRALS
# (1, 2, 3, 4), (1, 2, 3, 5), (2, 7, 8, 9),
# (3, 2, 6, 7), (3, 2, 6, 8), (3, 2, 6, 9),
# (3, 6, 7, 9), (3, 7, 8, 9), (4, 2, 6, 7),
# (6, 2, 3, 4), (6, 2, 3, 5), (2, 1, 3, 5)],
# [], # IMPROPERS
# [], # VSITES
# [(0, 3), (0, 4), (0, 5), # EXCLUSIONS
# (1, 3), (1, 4), (1, 5),
# (2, 3), (2, 4), (2, 5)]],
# })
#----+----------------+
## D | SPECIAL BONDS |
#----+----------------+
self.special = {
# Used for sulfur bridges
# ATOM 1 ATOM 2 BOND LENGTH FORCE CONSTANT
(("SC1","CYS"), ("SC1","CYS")): (0.39, 5000),
}
# By default use an elastic network
self.ElasticNetwork = False
# Elastic networks bond shouldn't lead to exclusions (type 6)
# But Elnedyn has been parametrized with type 1.
self.EBondType = 6
#----+----------------+
## D | INTERNAL STUFF |
#----+----------------+
## BACKBONE BEAD TYPE ##
# Dictionary of default bead types (*D)
self.bbBeadDictD = FUNC.hash(SS.bbss,self.bbdef)
# Dictionary of dictionaries of types for specific residues (*S)
self.bbBeadDictS = dict([(i,FUNC.hash(SS.bbss,self.bbtyp[i])) for i in self.bbtyp.keys()])
# combine the connectivity records for different molecule types
self.connectivity = dict(self.base_connectivity.items() + self.aa_connectivity.items())
# XXX No need to do that, let's just use separate for DNA for now
## BB BOND TYPE ##
# Dictionary of default abond types (*D)
self.bbBondDictD = FUNC.hash(SS.bbss,zip(self.bbldef,self.bbkb))
# Dictionary of dictionaries for specific types (*S)
self.bbBondDictS = dict([(i,FUNC.hash(SS.bbss,zip(self.bbltyp[i],self.bbkbtyp[i]))) for i in self.bbltyp.keys()])
# This is tricky to read, but it gives the right bondlength/force constant
## BBB ANGLE TYPE ##
# Dictionary of default angle types (*D)
self.bbAngleDictD = FUNC.hash(SS.bbss,zip(self.bbadef,self.bbka))
# Dictionary of dictionaries for specific types (*S)
self.bbAngleDictS = dict([(i,FUNC.hash(SS.bbss,zip(self.bbatyp[i],self.bbkatyp[i]))) for i in self.bbatyp.keys()])
## BBBB DIHEDRAL TYPE ##
# Dictionary of default dihedral types (*D)
self.bbDihedDictD = FUNC.hash(SS.bbss,zip(self.bbddef,self.bbkd,self.bbdmul))
# Dictionary of dictionaries for specific types (*S)
self.bbDihedDictS = dict([(i,FUNC.hash(SS.bbss,zip(self.bbdtyp[i],self.bbkdtyp[i]))) for i in self.bbdtyp.keys()])
## DNA DICTIONARIES ##
# Dictionary for the connectivities and parameters of bonds between DNA backbone beads
self.dnaBbBondDictC = dict(zip(self.dna_con['bond'],self.dna_bb['bond']))
# Dictionary for the connectivities and parameters of angles between DNA backbone beads
self.dnaBbAngleDictC = dict(zip(self.dna_con['angle'],self.dna_bb['angle']))
# Dictionary for the connectivities and parameters of dihedrals between DNA backbone beads
self.dnaBbDihDictC = dict(zip(self.dna_con['dih'],self.dna_bb['dih']))
# Dictionary for exclusions for DNA backbone beads
self.dnaBbExclDictC = dict(zip(self.dna_con['excl'],self.dna_bb['excl']))
# Dictionary for pairs for DNA backbone beads
self.dnaBbPairDictC = dict(zip(self.dna_con['pair'],self.dna_bb['pair']))
## RNA DICTIONARIES ##
# Dictionary for the connectivities and parameters of bonds between RNA backbone beads
self.rnaBbBondDictC = dict(zip(self.rna_con['bond'],self.rna_bb['bond']))
# Dictionary for the connectivities and parameters of angles between rna backbone beads
self.rnaBbAngleDictC = dict(zip(self.rna_con['angle'],self.rna_bb['angle']))
# Dictionary for the connectivities and parameters of dihedrals between rna backbone beads
self.rnaBbDihDictC = dict(zip(self.rna_con['dih'],self.rna_bb['dih']))
# Dictionary for exclusions for RNA backbone beads
self.rnaBbExclDictC = dict(zip(self.rna_con['excl'],self.rna_bb['excl']))
示例2: __init__
# 需要导入模块: import FUNC [as 别名]
# 或者: from FUNC import hash [as 别名]
#.........这里部分代码省略.........
'LEU': [FUNC.spl("C1"), [(0.265, None)]],
'MET': [FUNC.spl("C5"), [(0.310, 2800)]],
'ASN': [FUNC.spl("P5"), [(0.250, None)]],
'PRO': [FUNC.spl("C3"), [(0.190, None)]],
'GLN': [FUNC.spl("P4"), [(0.300, 2400)]],
'SER': [FUNC.spl("P1"), [(0.195, None)]],
'THR': [FUNC.spl("P1"), [(0.195, None)]],
'VAL': [FUNC.spl("C2"), [(0.200, None)]],
'GLY': [],
'ALA': [],
}
# Not all (eg Elnedyn) forcefields use backbone-backbone-sidechain angles and BBBB-dihedrals.
self.UseBBSAngles = False
self.UseBBBBDihedrals = False
# Martini 2.2p has polar and charged residues with seperate charges.
self.polar = []
self.charged = []
# If masses or charged diverge from standard (45/72 and -/+1) they are defined here.
self.mass_charge = {
#RES MASS CHARGE
}
# Defines the connectivity between between beads
# Connectivity records for Elnedyn (read from cg-2.1.dat).
# For HIS the order of bonds is changed and a bond with fc=0 is added.
self.connectivity = {
#RES BONDS ANGLES DIHEDRALS V-SITE
"TRP": [[(0, 1), (1, 2), (2, 4), (4, 3), (3, 1), (1, 4)],[(0, 1, 2), (0, 1, 4), (0, 1, 3)],[(1, 2, 3, 4)]],
"TYR": [[(0, 1), (0, 2), (1, 2), (1, 3), (2, 3)], [(0, 1, 2), (0, 1, 3)]],
"PHE": [[(0, 1), (0, 2), (1, 2), (1, 3), (2, 3)], [(0, 1, 2), (0, 1, 3)]],
"HIS": [[(0, 1), (1, 2), (1, 3), (2, 3)], [(0, 1, 2), (0, 1, 3)]],
"HIH": [[(0, 1), (1, 2), (1, 3), (2, 3)], [(0, 1, 2), (0, 1, 3)]],
"GLN": [[(0,1)]],
"ASN": [[(0,1)]],
"SER": [[(0,1)]],
"THR": [[(0,1)]],
"ARG": [[(0,1),(1,2)], [(0,1,2)]],
"LYS": [[(0,1),(1,2)], [(0,1,2)]],
"ASP": [[(0,1)]],
"GLU": [[(0,1)]],
"CYS": [[(0,1)]],
"ILE": [[(0,1)]],
"LEU": [[(0,1)]],
"MET": [[(0,1)]],
"PRO": [[(0,1)]],
"HYP": [[(0,1)]],
"VAL": [[(0,1)]],
"ALA": [],
"GLY": [],
}
#----+----------------+
## C | SPECIAL BONDS |
#----+----------------+
self.special = {
# Used for sulfur bridges
# ATOM 1 ATOM 2 BOND LENGTH FORCE CONSTANT
(("SC1","CYS"), ("SC1","CYS")): (0.24, None),
}
# By default use an elastic network
self.ElasticNetwork = True
# Elastic networks bond shouldn't lead to exclusions (type 6)
# But Elnedyn has been parametrized with type 1.
self.EBondType = 1
#----+----------------+
## D | INTERNAL STUFF |
#----+----------------+
## BACKBONE BEAD TYPE ##
# Dictionary of default bead types (*D)
self.bbBeadDictD = FUNC.hash(SS.bbss,self.bbdef)
# Dictionary of dictionaries of types for specific residues (*S)
self.bbBeadDictS = dict([(i,FUNC.hash(SS.bbss,self.bbtyp[i])) for i in self.bbtyp.keys()])
## BB BOND TYPE ##
# Dictionary of default abond types (*D)
self.bbBondDictD = FUNC.hash(SS.bbss,zip(self.bbldef,self.bbkb))
# Dictionary of dictionaries for specific types (*S)
self.bbBondDictS = dict([(i,FUNC.hash(SS.bbss,zip(self.bbltyp[i],self.bbkbtyp[i]))) for i in self.bbltyp.keys()])
# This is tricky to read, but it gives the right bondlength/force constant
## BBB ANGLE TYPE ##
# Dictionary of default angle types (*D)
self.bbAngleDictD = FUNC.hash(SS.bbss,zip(self.bbadef,self.bbka))
# Dictionary of dictionaries for specific types (*S)
self.bbAngleDictS = dict([(i,FUNC.hash(SS.bbss,zip(self.bbatyp[i],self.bbkatyp[i]))) for i in self.bbatyp.keys()])
## BBBB DIHEDRAL TYPE ##
# Dictionary of default dihedral types (*D)
self.bbDihedDictD = FUNC.hash(SS.bbss,zip(self.bbddef,self.bbkd,self.bbdmul))
# Dictionary of dictionaries for specific types (*S)
self.bbDihedDictS = dict([(i,FUNC.hash(SS.bbss,zip(self.bbdtyp[i],self.bbkdtyp[i]))) for i in self.bbdtyp.keys()])
示例3: __init__
# 需要导入模块: import FUNC [as 别名]
# 或者: from FUNC import hash [as 别名]
#.........这里部分代码省略.........
"HYP": [FUNC.spl("P1"), [(0.300,7500)]],
"VAL": [FUNC.spl("C2"), [(0.265,None)]],
"ALA": [],
"GLY": [],
}
# Not all (eg Elnedyn) forcefields use backbone-backbone-sidechain angles and BBBB-dihedrals.
self.UseBBSAngles = True
self.UseBBBBDihedrals = True
# Martini 2.2p has polar and charged residues with seperate charges.
self.polar = ["GLN","ASN","SER","THR"]
self.charged = ["ARG","LYS","ASP","GLU","HIH"]
# If masses or charged diverge from standard (45/72 and -/+1) they are defined here.
self.mass_charge = {
#RES MASS CHARGE
"GLN":[[0,36,36], [0,0.42,-0.42]],
"ASN":[[0,36,36], [0,0.46,-0.46]],
"SER":[[0,36,36], [0,0.40,-0.40]],
"THR":[[0,36,36], [0,0.36,-0.36]],
"ARG":[[72,36,36], [0,0,1]],
"LYS":[[72,36,36], [0,0,1]],
"HIH":[[45,45,36,36], [0,0,0,1]],
"ASP":[[36,36], [0,-1]],
"GLU":[[36,36], [0,-1]],
}
self.connectivity = {
#RES BONDS ANGLES DIHEDRALS V-SITE
"TRP": [[(0,1),(1,2),(1,3),(2,3),(2,4),(3,4)], [(0,1,2),(0,1,3)], [(0,2,3,1),(1,2,4,3)]],
"TYR": [[(0,1),(1,2),(1,3),(2,3)], [(0,1,2),(0,1,3)], [(0,2,3,1)]],
"PHE": [[(0,1),(1,2),(1,3),(2,3)], [(0,1,2),(0,1,3)], [(0,2,3,1)]],
"HIS": [[(0,1),(1,2),(1,3),(2,3)], [(0,1,2),(0,1,3)], [(0,2,3,1)]],
"HIH": [[(0,1),(1,2),(1,3),(2,3),(3,4)], [(0,1,2),(0,1,3)], [(0,2,3,1)]],
"GLN": [[(0,1),(2,3)], [], [], [(1,2,3)]],
"ASN": [[(0,1),(2,3)], [], [], [(1,2,3)]],
"SER": [[(0,1),(2,3)], [], [], [(1,2,3)]],
"THR": [[(0,1),(2,3)], [], [], [(1,2,3)]],
"ARG": [[(0,1),(1,2),(2,3)], [(0,1,2)]],
"LYS": [[(0,1),(1,2),(2,3)], [(0,1,2)]],
"ASP": [[(0,1),(1,2)]],
"GLU": [[(0,1),(1,2)]],
"CYS": [[(0,1)]],
"ILE": [[(0,1)]],
"LEU": [[(0,1)]],
"MET": [[(0,1)]],
"PRO": [[(0,1)]],
"HYP": [[(0,1)]],
"VAL": [[(0,1)]],
"ALA": [],
"GLY": [],
}
#----+----------------+
## C | SPECIAL BONDS |
#----+----------------+
self.special = {
# Used for sulfur bridges
# ATOM 1 ATOM 2 BOND LENGTH FORCE CONSTANT
(("SC1","CYS"), ("SC1","CYS")): (0.24, None),
}
# By default use an elastic network
self.ElasticNetwork = False
# Elastic networks bond shouldn't lead to exclusions (type 6)
# But Elnedyn has been parametrized with type 1.
self.EBondType = 6
#----+----------------+
## D | INTERNAL STUFF |
#----+----------------+
## BACKBONE BEAD TYPE ##
# Dictionary of default bead types (*D)
self.bbBeadDictD = FUNC.hash(SS.bbss,self.bbdef)
# Dictionary of dictionaries of types for specific residues (*S)
self.bbBeadDictS = dict([(i,FUNC.hash(SS.bbss,self.bbtyp[i])) for i in self.bbtyp.keys()])
## BB BOND TYPE ##
# Dictionary of default abond types (*D)
self.bbBondDictD = FUNC.hash(SS.bbss,zip(self.bbldef,self.bbkb))
# Dictionary of dictionaries for specific types (*S)
self.bbBondDictS = dict([(i,FUNC.hash(SS.bbss,zip(self.bbltyp[i],self.bbkbtyp[i]))) for i in self.bbltyp.keys()])
# This is tricky to read, but it gives the right bondlength/force constant
## BBB ANGLE TYPE ##
# Dictionary of default angle types (*D)
self.bbAngleDictD = FUNC.hash(SS.bbss,zip(self.bbadef,self.bbka))
# Dictionary of dictionaries for specific types (*S)
self.bbAngleDictS = dict([(i,FUNC.hash(SS.bbss,zip(self.bbatyp[i],self.bbkatyp[i]))) for i in self.bbatyp.keys()])
## BBBB DIHEDRAL TYPE ##
# Dictionary of default dihedral types (*D)
self.bbDihedDictD = FUNC.hash(SS.bbss,zip(self.bbddef,self.bbkd,self.bbdmul))
# Dictionary of dictionaries for specific types (*S)
self.bbDihedDictS = dict([(i,FUNC.hash(SS.bbss,zip(self.bbdtyp[i],self.bbkdtyp[i]))) for i in self.bbdtyp.keys()])
示例4: naming
# 需要导入模块: import FUNC [as 别名]
# 或者: from FUNC import hash [as 别名]
##########################
import FUNC
dnares3 = " DA DC DG DT"
dnares1 = " dA dC dG dT"
rnares3 = " A C G U"
rnares1 = " rA rC rG rU"
# Amino acid nucleic acid codes:
# The naming (AA and '3') is not strictly correct when adding DNA/RNA, but we keep it like this for consistincy.
AA3 = FUNC.spl("TRP TYR PHE HIS HIH ARG LYS CYS ASP GLU ILE LEU MET ASN PRO HYP GLN SER THR VAL ALA GLY"+dnares3+rnares3) #@#
AA1 = FUNC.spl(" W Y F H H R K C D E I L M N P O Q S T V A G"+dnares1+rnares1) #@#
# Dictionaries for conversion from one letter code to three letter code v.v.
AA123, AA321 = FUNC.hash(AA1, AA3), FUNC.hash(AA3, AA1)
# Residue classes:
protein = AA3[:-8] # remove eight to get rid of DNA/RNA here.
water = FUNC.spl("HOH SOL TIP")
lipids = FUNC.spl("DPP DHP DLP DMP DSP POP DOP DAP DUP DPP DHP DLP DMP DSP PPC DSM DSD DSS")
nucleic = FUNC.spl("DAD DCY DGU DTH ADE CYT GUA THY URA DA DC DG DT")
residueTypes = dict(
[(i, "Protein") for i in protein ] +
[(i, "Water") for i in water ] +
[(i, "Lipid") for i in lipids ] +
[(i, "Nucleic") for i in nucleic ]
)
示例5: dict
# 需要导入模块: import FUNC [as 别名]
# 或者: from FUNC import hash [as 别名]
"H": FUNC.pat(".3. .33. .333. .3333. .13332. .113322. .1113222. .1111 2222.") #@#
}
#----+----------+
## C | INTERNAL |
#----+----------+
# Pymol Colors
# F E H 1 2 3 T S C
ssnum = (13, 4, 2, 2, 2, 2, 6, 22, 0) #@#
# Dictionary returning a number for a given type of secondary structure
# This can be used for setting the b-factor field for coloring
ss2num = FUNC.hash(bbss, ssnum)
# List of programs for which secondary structure definitions can be processed
programs = ssdefs.keys()
# Dictionaries mapping ss types to the CG ss types
ssd = dict([(i, FUNC.hash(ssdefs[i], cgss)) for i in programs])
# From the secondary structure dictionaries we create translation tables
# with which all secondary structure types can be processed. Anything
# not listed above will be mapped to C (coil).
# Note, a translation table is a list of 256 characters to map standard
# ascii characters to.