parser.add_argument('--show-status', help='show details on reactions with different status', action='store_true', dest='showStatus', default=False) parser.add_argument('--show-stoich', help='show details on reactions with different stoichiometry', action='store_true', dest='showStoich', default=False) usage = parser.format_usage() parser.description = desc1 + ' ' + usage + desc2 parser.usage = argparse.SUPPRESS args = parser.parse_args() # The --show-details option turns on all of the detail options. if args.showDetails: args.showNames = True args.showStatus = True args.showStoich = True # Read the reactions from the first file. helper = BiochemHelper() firstReactions = helper.buildDictFromListOfObjects(helper.readReactionsFile(args.rxnfile1)) print 'First reaction file: %s' %(args.rxnfile1) print ' Number of reactions: %d' %(len(firstReactions)) # Read the compounds from the second file. secondReactions = helper.buildDictFromListOfObjects(helper.readReactionsFile(args.rxnfile2)) print 'Second reaction file: %s' %(args.rxnfile2) print ' Number of reactions: %d' %(len(secondReactions)) # Track differences in reactions. reactionsOnlyInFirst = list() reactionsOnlyInSecond = list() diffNames = set() diffStatus = set() diffStoich = set() different = set()
dest='flatFile', default=False) usage = parser.format_usage() parser.description = desc1 + ' ' + usage + desc2 parser.usage = argparse.SUPPRESS args = parser.parse_args() # The --show-details option turns on all of the detail options. if args.showDetails: args.showNames = True args.showFormulas = True args.showCharges = True # Read the compounds from the first file. helper = BiochemHelper() firstCompounds = helper.buildDictFromListOfObjects( helper.readCompoundsFile(args.cpdfile1)) if (args.flatFile == False): print('First compound file: %s' % (args.cpdfile1)) print(' Number of compounds: %d' % (len(firstCompounds))) # Read the compounds from the second file. secondCompounds = helper.buildDictFromListOfObjects( helper.readCompoundsFile(args.cpdfile2)) if (args.flatFile == False): print('Second compound file: %s' % (args.cpdfile2)) print(' Number of compounds: %d' % (len(secondCompounds))) # Keep track of differences in compounds. compoundsOnlyInFirst = list() compoundsOnlyInSecond = list() diffNames = set()
parser.add_argument('--show-charges', help='show details on compounds with different charges', action='store_true', dest='showCharges', default=False) parser.add_argument('--flat', help='Prints out requested differences in a flat-file format', action='store_true', dest='flatFile', default=False) usage = parser.format_usage() parser.description = desc1 + ' ' + usage + desc2 parser.usage = argparse.SUPPRESS args = parser.parse_args() # The --show-details option turns on all of the detail options. if args.showDetails: args.showNames = True args.showFormulas = True args.showCharges = True # Read the compounds from the first file. helper = BiochemHelper() firstCompounds = helper.buildDictFromListOfObjects(helper.readCompoundsFile(args.cpdfile1)) if(args.flatFile == False): print 'First compound file: %s' %(args.cpdfile1) print ' Number of compounds: %d' %(len(firstCompounds)) # Read the compounds from the second file. secondCompounds = helper.buildDictFromListOfObjects(helper.readCompoundsFile(args.cpdfile2)) if(args.flatFile == False): print 'Second compound file: %s' %(args.cpdfile2) print ' Number of compounds: %d' %(len(secondCompounds)) # Keep track of differences in compounds. compoundsOnlyInFirst = list() compoundsOnlyInSecond = list() diffNames = set() diffFormulas = set()