def getSetListFromQuery(self, query): lpath = self.getPathListFromQuery(query) lSet = PathUtils.getSetListFromQueries(lpath) return lSet
def getSetListIncludedInQueryCoord(self, query, start, end): lPath=self.getPathListIncludedInQueryCoord(query, start, end) lSet = PathUtils.getSetListFromQueries(lPath) return lSet
else: print "ERROR: unknown subject table type: %s" % ( stype ) sys.exit(1) lSetIdToRemovePaths = [] count = 0 # for each path ID for id in lPathId: string = "processing path '%i'..." % ( id ) if qtype == "path": lPaths = qtablePathAdaptator.getPathListFromId( id ) lQuerySets = PathUtils.getSetListFromQueries( lPaths ) elif qtype == "set": lQuerySets = qtableSetAdaptator.getSetListFromId( id ) lQuerySets.sort() qmin, qmax = SetUtils.getListBoundaries( lQuerySets ) qmin = qmin - 1 qmax = qmax + 1 if stype == "path": lPaths = stablePathAdaptator.getPathListOverlappingQueryCoord( lQuerySets[0].seqname.split()[0], qmin, qmax ) lSubjectSets = PathUtils.getSetListFromQueries( lPaths ) elif stype == "set": lSubjectSets = stableSetAdaptator.getSetListFromQueryCoord( lQuerySets[0].seqname.split()[0], qmin, qmax ) if verbose > 1:
def getSetListOverlappingQueryCoord(self, query, start, end): lPath = self.getPathListOverlappingQueryCoord(query, start, end) lSet = PathUtils.getSetListFromQueries(lPath) return lSet
if not os.path.exists( inFileName ): msg = "ERROR: can't find file '%s'" % ( inFileName ) sys.stderr.write( "%s\n" % msg ) help() sys.exit(1) if outFileName == "": outFileName = "%s.gff3" % ( inFileName ) if verbose > 0: msg = "START %s" % ( sys.argv[0].split("/")[-1] ) msg += "\ninput file: %s" % ( inFileName ) msg += "\nsource: %s" % ( source ) msg += "\noutput file: %s" % ( outFileName ) sys.stdout.write( "%s\n" % msg ) sys.stdout.flush() PathUtils.convertPathFileIntoGffFile( pathFile=inFileName, gffFile=outFileName, source=source, verbose=verbose ) if verbose > 0: print "END %s" % ( sys.argv[0].split("/")[-1] ) sys.stdout.flush() return 0 if __name__ == "__main__": main()