예제 #1
0
 def getPathListFromFile( pathFile ):
     lPaths = []
     pathFileHandler = open( pathFile, "r" )
     while True:
         line = pathFileHandler.readline()
         if line == "":
             break
         iPath = Path()
         iPath.setFromString( line )
         lPaths.append( iPath )
     pathFileHandler.close()
     return lPaths
예제 #2
0
 def convertPathFileIntoSetFile( pathFile, setFile ):
     pathFileHandler = open( pathFile, "r" )
     setFileHandler = open( setFile, "w" )
     iPath = Path()
     while True:
         line = pathFileHandler.readline()
         if line == "":
             break
         iPath.setFromString( line )
         iSet = iPath.getSubjectAsSetOfQuery()
         iSet.write( setFileHandler )
     pathFileHandler.close()
     setFileHandler.close()
예제 #3
0
 def convertPathFileIntoAlignFile(pathFile, alignFile):
     pathFileHandler = open( pathFile, "r" )
     alignFileHandler = open( alignFile, "w" )
     iPath = Path()
     while True:
         line = pathFileHandler.readline()
         if line == "":
             break
         iPath.setFromString( line )
         iAlign = iPath.getAlignInstance()
         iAlign.write( alignFileHandler )
     pathFileHandler.close()
     alignFileHandler.close()
예제 #4
0
 def getDictOfListsWithIdAsKeyFromFile( pathFile ):
     dId2PathList = {}
     pathFileHandler = open( pathFile, "r" )
     while True:
         line = pathFileHandler.readline()
         if line == "":
             break
         iPath = Path()
         iPath.setFromString( line )
         if dId2PathList.has_key( iPath.id ):
             dId2PathList[ iPath.id ].append( iPath )
         else:
             dId2PathList[ iPath.id ] = [ iPath ]
     pathFileHandler.close()
     return dId2PathList