15 return str(self.
value)
23 def hits(self):
return self.hits
24 def seen(self):
return self.seen
25 def id(self):
return self.id
26 def name(self):
return self.attr[2]
33 def hits(self):
return self.hits
34 def seen(self):
return self.hits
35 def id(self):
return self.id
41 return self.
id == nline.id()
47 return self.
count < nline.attr[4]
53 return self.
count < nline.attr[3]
59 return self.idset.get(nline.attr[0])!=
None
76 for line
in fin.names.xreadlines():
89 for line
in fin.names.xreadlines():
91 if int(a[3])==value:
break
100 for line
in fin.names.xreadlines():
102 if int(a[3])<cuttoff:
break
111 for line
in fin.names.xreadlines():
113 if ids.get(int(a[0]))!=
None:
124 def runme(in_nodefile, in_treefile, out_treefile, cutoff, cuttype)
125 fin_nodes = open(in_nodefile,
'r')
126 fin_paths = open(in_treefile,'r')
127 fout = open(out_treefile,'w')
130 for line
in fin.xreadlines():
149 for node
in tree.items():
151 print >>fout, node[1],
' ', node[0][0],
' ', node[0][1]
153 if __name__ ==
"__main__":
154 if len(sys.argv) < 5:
155 print "usage: ", sys.argv[0],
" in_prefix out_prefix cutoff type"
156 print " type = 0 means accept one exact match for cutoff value"
157 print " type = 1 means accept anything >= cutoff value"
160 in_nodefile = sys.argv[1]
161 in_treefile = sys.argv[2]
162 out_treefile = sys.argv[3]
163 cutoff = int(sys.argv[4])
164 cuttype = int(sys.argv[5])
166 runme(in_nodefile, in_treefile, out_treefile, cutoff, cuttype)