except: print "ERROR: problem parsing cluster%% filter values '%s'" % opts['-p'] usage() exit(1) if '-s' in opts: pattern = opts['-s'] if DEBUG: print "Pattern : |%s|" % pattern if '-f' in opts: files = [ opts['-f'] ] elif '-d' in opts: if '-R' in opts: recursive = True files = pathToList( path = opts['-d'], recursive = recursive, pattern = pattern ) if not files: print "WARNING: no VS results in the dir:", opts['-d'] exit(1) elif '-F' in opts: try: files = getLines(opts['-F'], doStrip = True) print "%d files from list file %s" % (len(files), opts['-F']) except: print "ERROR opening the input list: " , opts['-F'] exit(1) else: print "ERROR: Either file (-f), directory (-d) or list file (-F) input options must be specified" usage() exit(1)
pattern = opts['-p'] #print "PATTERN", pattern if DEBUG: print "File pattern:", pattern if '-f' in opts: input_files = opts['-f'].split(",") if DEBUG: print "[ file mode:", input_files, "]" elif '-d' in opts: dir_root = opts['-d'] if DEBUG: print "[ directory mode: %s ]" % dir_root if recursive: print "- scanning sub-directories of [ %s ]..." % dir_root else: print "- scanning directory [ %s ]" % dir_root #print recursive, pattern input_files = pathToList(dir_root, recursive=recursive, pattern=pattern) print "- %d results found" % (len(input_files)) #print input else: print "ERROR: Missing input source: specify either file or directories" usage() exit(2) if not input_files: print "No input files found." exit(0) if '-r' in opts: # TODO caching could occur here? receptor = opts['-r'] if not os.path.isfile(opts['-r']): print "ERROR! the specified filename is not accessible:", receptor
pattern = opts['-p'] #print "PATTERN", pattern pattern = pattern.replace('\\', '') if DEBUG: print "File pattern:", pattern if '-f' in opts: input_files = opts['-f'].split(",") if DEBUG: print "[ file mode:", input_files,"]" elif '-d' in opts: dir_root = opts['-d'] if DEBUG: print "[ directory mode: %s ]" % dir_root if recursive: print "- scanning sub-directories of [ %s ]..." % dir_root else: print "- scanning directory [ %s ]" % dir_root #print recursive, pattern input_files = pathToList(dir_root, recursive = recursive, pattern = pattern) print "- %d results found" % (len(input_files)) #print input else: print "ERROR: Missing input source: specify either file or directories" usage() exit(2) if not input_files: print "No input files found." exit(0) if '-r' in opts: # TODO caching could occur here? receptor = opts['-r'] if not os.path.isfile(opts['-r']):