示例#1
0
        args.showBadAbbrs = True
        args.showFormulas = True
        args.showCharges = True
        args.showCofactors = True

    # Read the compounds from the specified file.
    print 'Compound file: %s' % (args.cpdfile)
    helper = BiochemHelper()
    compounds = helper.readCompoundsFile(args.cpdfile)
    if compounds is None:
        print 'Error reading compounds file'
        exit(1)
    print 'Number of compounds: %d' % (len(compounds))

    # Create a dictionary keyed by id for fast lookup of compounds.
    compoundDict = helper.buildIndexDictFromListOfObjects(compounds)

    # Check for duplicates, missing and invalid values.
    idDict = dict()
    duplicateId = 0
    badIdChars = list()
    nameDict = dict()
    duplicateName = 0
    badNameChars = list()
    abbrDict = dict()
    duplicateAbbr = 0
    badAbbrChars = list()
    noFormula = list()
    largeCharge = list()
    noCharge = list()
    badCore = list()
        args.showBadAbbrs = True
        args.showFormulas = True
        args.showCharges = True
        args.showCofactors = True

    # Read the compounds from the specified file.
    print "Compound file: %s" % (args.cpdfile)
    helper = BiochemHelper()
    compounds = helper.readCompoundsFile(args.cpdfile)
    if compounds is None:
        print "Error reading compounds file"
        exit(1)
    print "Number of compounds: %d" % (len(compounds))

    # Create a dictionary keyed by id for fast lookup of compounds.
    compoundDict = helper.buildIndexDictFromListOfObjects(compounds)

    # Check for duplicates, missing and invalid values.
    idDict = dict()
    duplicateId = 0
    badIdChars = list()
    nameDict = dict()
    duplicateName = 0
    badNameChars = list()
    abbrDict = dict()
    duplicateAbbr = 0
    badAbbrChars = list()
    noFormula = list()
    largeCharge = list()
    noCharge = list()
    badCore = list()
示例#3
0
        args.showBadIds = True
        args.showDupNames = True
        args.showBadNames = True
        args.showStatus = True

    # Read the reactions from the specified file.
    print 'Reaction file: %s' % (args.rxnfile)
    helper = BiochemHelper()
    reactions = helper.readReactionsFile(args.rxnfile)
    if reactions is None:
        print 'Error reading reactions file'
        exit(1)
    print 'Number of reactions: %d' % (len(reactions))

    # Create a dictionary keyed by id for fast lookup of reactions.
    reactionDict = helper.buildIndexDictFromListOfObjects(reactions)

    # Check for duplicates, missing and invalid values.
    idDict = dict()
    duplicateId = 0
    badIdChars = list()
    nameDict = dict()
    duplicateName = 0
    badNameChars = list()
    abbrDict = dict()
    duplicateAbbr = 0
    badAbbrChars = list()
    badDirection = list()
    badReversibility = list()
    unknownReversibility = list()
    diffEquationCode = list()
示例#4
0
    biochem['cues'] = list()

    # The following fields are optional in a Biochemistry typed object.
    if args.name is not None:
        biochem['name'] = args.name
    if args.description is not None:
        biochem['description'] = args.description

    # Create a helper object.
    helper = BiochemHelper()

    # Add the compounds from the compounds file.
    print(('Adding compounds from %s ...' % (args.compoundfile)))
    biochem['compounds'] = helper.readCompoundsFile(args.compoundfile,
                                                    includeLinenum=False)
    compounds = helper.buildIndexDictFromListOfObjects(biochem['compounds'])

    # Start with an empty dictionary of compartments.  With compartment-free reactions, just add
    # place holder compartments as they are found processing the reactions.
    compartments = dict()

    # Add the reactions from the reactions file.
    print(('Adding reactions from %s ...' % (args.reactionfile)))
    biochem['reactions'] = list()
    reactions = helper.readReactionsFile(args.reactionfile,
                                         includeLinenum=False)

    for index in range(len(reactions)):
        rxn = reactions[index]
        reactants, products = helper.parseEquation(rxn['equation'])
        if reactants is None and products is None:  # @todo Need to confirm this
        args.showBadIds = True
        args.showDupNames = True
        args.showBadNames = True
        args.showStatus = True

    # Read the reactions from the specified file.
    print 'Reaction file: %s' %(args.rxnfile)
    helper = BiochemHelper()
    reactions = helper.readReactionsFile(args.rxnfile)
    if reactions is None:
        print 'Error reading reactions file'
        exit(1)
    print 'Number of reactions: %d' %(len(reactions))
    
    # Create a dictionary keyed by id for fast lookup of reactions.
    reactionDict = helper.buildIndexDictFromListOfObjects(reactions)

    # Check for duplicates, missing and invalid values.
    idDict = dict()
    duplicateId = 0
    badIdChars = list()
    nameDict = dict()
    duplicateName = 0
    badNameChars = list()
    abbrDict = dict()
    duplicateAbbr = 0
    badAbbrChars = list()
    badDirection = list()
    badReversibility = list()
    unknownReversibility = list()
    diffEquationCode = list()
    biochem['compoundSets'] = list()
    biochem['cues'] = list()

    # The following fields are optional in a Biochemistry typed object.
    if args.name is not None:
        biochem['name'] = args.name
    if args.description is not None:
        biochem['description'] = args.description

    # Create a helper object.
    helper = BiochemHelper()

    # Add the compounds from the compounds file.
    print 'Adding compounds from %s ...' %(args.compoundfile)
    biochem['compounds'] = helper.readCompoundsFile(args.compoundfile, includeLinenum=False)
    compounds = helper.buildIndexDictFromListOfObjects(biochem['compounds'])

    # Start with an empty dictionary of compartments.  With compartment-free reactions, just add
    # place holder compartments as they are found processing the reactions.
    compartments = dict()

    # Add the reactions from the reactions file.
    print 'Adding reactions from %s ...' %(args.reactionfile)
    biochem['reactions'] = list()
    reactions = helper.readReactionsFile(args.reactionfile, includeLinenum=False)
    
    for index in range(len(reactions)):
        rxn = reactions[index]
        reactants, products = helper.parseEquation(rxn['equation'])
        if reactants is None and products is None: # @todo Need to confirm this
            continue