Skip to content

Commit

Permalink
allow user provided biomass library
Browse files Browse the repository at this point in the history
  • Loading branch information
cdanielmachado committed Sep 28, 2017
1 parent afafd27 commit 7655630
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions scripts/build_universe
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ from carveme.reconstruction.utils import load_biomass_db
from framed.io.sbml import load_cbmodel


def main(mode, noheuristics=False, nothermo=False, allow_unbalanced=False, allow_blocked=False, biomass=None, outputfile=None):
def main(mode, noheuristics=False, nothermo=False, allow_unbalanced=False, allow_blocked=False,
biomass=None, biomass_db_path=None, outputfile=None):

if mode == 'draft':

Expand Down Expand Up @@ -60,8 +61,10 @@ def main(mode, noheuristics=False, nothermo=False, allow_unbalanced=False, allow
unbalanced = pd.read_csv(unbalanced, header=None)
unbalanced = unbalanced[0].tolist()

biomass_library = project_dir + config.get('input', 'biomass_library')
biomass_db = load_biomass_db(biomass_library)
if biomass_db_path is None:
biomass_db_path = project_dir + config.get('input', 'biomass_library')

biomass_db = load_biomass_db(biomass_db_path)

if not biomass:
biomass = config.get('universe', 'default_biomass')
Expand Down Expand Up @@ -134,6 +137,8 @@ if __name__ == '__main__':

parser.add_argument('--biomass', help="Advanced options: biomass equation identifier")

parser.add_argument('--biomass-db', dest='biomass_db', help="Advanced options: biomass database file")

args = parser.parse_args()

if args.nothermo and (args.draft or args.thermo):
Expand Down Expand Up @@ -166,5 +171,6 @@ if __name__ == '__main__':
allow_unbalanced=args.unbalanced,
allow_blocked=args.blocked,
biomass=args.biomass,
biomass_db_path=args.biomass_db,
outputfile=args.output)

0 comments on commit 7655630

Please sign in to comment.