import tm3
import string
import sys
import dot

if -1 != string.find(sys.argv[0], "tm3rescomp.py"):
  tmDataList = []
  nameOrNum = sys.argv[1]
  resList = sys.argv[2]
  for filename in sys.argv[3:]:
    tmDataList.append(tm3.tmTreeFromFile(filename))
  colName = "Residue Number List"
  if nameOrNum == "name":
    colName = "Residue Name List"
  dotData = dot.dotResidues(tmDataList, resList, colNameIn=colName, penalty=3.0)
  #print dotData.treeToBestNode
  #dotData.write("temp.dot")
  #dotData.writeGdl("temp.gdl", force=False)
  #print "dot -Tpng temp.dot > temp.png"
  print "output file also written to temp.tab.txt and temp.animation.py"
  matchList = tm3.findSimilarNodes(
      tmDataList, [
          "Surface Area", "Volume", "height",
          #"mean absolute Curvature",
          "mean Curvature", "mouths",
          "longest dimension", "middle dimension", "short dimension",
          "Area of Biggest Mouth", "Diameter of Biggest Mouth", "mean height"],
      10000000, 1000, 50,
      resCols=["Atom Name List"], sizeColName="Volume",
      sizeMin=-1., sizeMax=10000000000,
#!/usr/bin/env python

#reports pockets with highest overlap with the set of residues

import tm3
import string
import sys
import statistics
import dot

if -1 != string.find(sys.argv[0], "tm3residues.py"):
  prefix = "temp"
  tmDataList = []
  nameOrNum = sys.argv[1]
  resList = sys.argv[2]
  for filename in sys.argv[3:]:
    tmDataList.append(tm3.tmTreeFromFile(filename))
  colName = "Residue Number List"
  if nameOrNum == "name":
    colName = "Residue Name List"
  dotData = dot.dotResidues(
      tmDataList, resList, colNameIn=colName, printHelpful=False)
  dotData.printHelpful(prefix)
  dotData.write(prefix + ".dot")
  dotData.writeGdl(prefix + ".gdl", force=False)
  print "dot -Tpng "+prefix+".dot > "+prefix+".png"
  print "output files written to " + prefix + ".tab.txt and " + prefix + \
      ".animation.py"