4 def get_sequence_from_pdb(pdb):
6 from a standard pdb file, return all RESNAME entries
11 for line
in f.readlines():
12 if line[13:15] ==
"CA":
13 resnames.append(line[17:20])
21 resis = get_sequence_from_pdb(pdb)
22 if all(r ==
'ALA' for r
in resis):
28 def is_length_correct(pdb):
31 lenseq = int(os.path.basename(pdb).split(
"_")[-2])
32 resis = get_sequence_from_pdb(pdb)
33 if len(resis) == lenseq:
39 def is_length_correct_for_parts(pdb):
42 resis = get_sequence_from_pdb(pdb)
49 def get_adjacent_values(em, voxel):
53 loc = em.get_location_by_voxel(voxel)
55 vecs = [(0, 0, 1), (0, 1, 0), (1, 0, 0),
56 (0, 0, -1), (0, -1, 0), (-1, 0, 0)]
62 values.append(em.get_value(loc+d))
69 def get_voxel_position_string(dmap):
71 for v
in range(dmap.get_number_of_voxels()):
72 vstring += str(dmap.get_location_by_voxel(v))+
" "
76 def get_voxel_value_string(dmap, const=1):
78 for v
in range(dmap.get_number_of_voxels()):
79 vstring += str(round(dmap.get_value(v), 4))+
" "
83 def get_xml_line(xml, field):
86 for line
in f.readlines():
94 def get_pdbid_from_xml(xml):
95 line = get_xml_line(xml,
"<fittedPDBEntryId>")
98 return line.strip().split(
"<fittedPDBEntryId>")[-1][0:4]
101 def get_threshold_from_xml(xml):
102 line = get_xml_line(xml,
"contourLevel")
105 return float(line.strip().split(
">")[1].split(
"<")[0])
110 from config
import get_xml
111 return get_resolution_from_xml(get_xml(emdb))
114 def get_resolution_from_xml(xml):
115 line = get_xml_line(xml,
"<resolutionByAuthor>")
118 return float(line.strip().split(
"<resolutionByAuthor>")[-1].split(
"<")[0])
121 def get_spacing_from_xml(xml):
122 line = get_xml_line(xml,
"pixelX")
123 return float(line.strip().split(
">")[1].split(
"<")[0])
126 def get_statistics_from_xml(xml):
128 line = get_xml_line(xml,
"<minimum>")
129 minimum = float(line.strip().split(
">")[1].split(
"<")[0])
130 line = get_xml_line(xml,
"<maximum>")
131 maximum = float(line.strip().split(
">")[1].split(
"<")[0])
132 line = get_xml_line(xml,
"<average>")
133 average = float(line.strip().split(
">")[1].split(
"<")[0])
134 line = get_xml_line(xml,
"<std>")
135 std = float(line.strip().split(
">")[1].split(
"<")[0])
136 return (minimum, maximum, average, std)
139 def catstring(stuff, delimiter=" "):
142 outstring += str(s)+delimiter
144 return outstring[0:-1]
147 def tint(value, n=2):
148 return int(value*10**n)/10**n
General purpose algebraic and geometric methods that are expected to be used by a wide variety of IMP...
double get_resolution(Model *m, ParticleIndex pi)
Estimate the resolution of the hierarchy as used by Representation.