def path2linkTuple(pathString):
   """
   Converts a path expressed as a sequence of nodes, e.g. [1,2,3,4] into a tuple
   of link IDs for use with the Path object (see path.py), in this case
   ((1,2),(2,3),(3,4))
   """
   
   # Remove braces
   pathString = pathString[1:-1]
   # Parse into node list
   nodeList = pathString.split(",")
   # Now create tuple
   linkList = list()
   prevNode = nodeList[0]
   for i in nodeList[1:]:
      curNode = i
      linkID = '(' + prevNode + ',' + curNode + ')'
      linkList.append(linkID)
      prevNode = i
   return tuple(linkList)