def parse_args(self):
		args = super(RunFitter, self).parse_args()

		if args.timestamp:
			args.sim_outdir = fp.timestamp() + '__' + args.sim_outdir.replace(
				' ', '_')

		args.sim_path = fp.makedirs(fp.ROOT_PATH, "out", args.sim_outdir)
		return args
Exemplo n.º 2
0
def parse_timestamp_description(sim_path):
    # type: (str) -> Tuple[str, str]
    """Parse `timestamp, description` from a sim_path that ends with a dir like
	'20190704.101500__Latest_sim_run' or failing that, return defaults.
	"""
    sim_dir = os.path.basename(sim_path)
    if not sim_dir:  # sim_path is empty or ends with '/'
        sim_dir = os.path.basename(os.path.dirname(sim_path))

    match = re.match(SIM_DIR_PATTERN, sim_dir)
    if match:
        timestamp = match.group(1)
        description = match.group(2).replace('_', ' ')
    else:
        timestamp = fp.timestamp()
        description = 'a manual run'

    return timestamp, description
Exemplo n.º 3
0
DISABLE_RNAP_FRACTION_INCREASE = bool(int(os.environ.get("DISABLE_RNAP_FRACTION_INCREASE", "0")))
DISABLE_RIBOSOME_ACTIVITY_FIX = bool(int(os.environ.get("DISABLE_RIBOSOME_ACTIVITY_FIX", "0")))
SAVE_CELL_SPECS = bool(int(os.environ.get("SAVE_CELL_SPECS", "0")))
CELL_SPECS_FILE = bool(int(os.environ.get("CELL_SPECS_FILE", "0")))
WRITE_TRANSLATION_EFFICIENCIES = bool(int(os.environ.get("WRITE_TRANSLATION_EFFICIENCIES", "0")))

if not RUN_AGGREGATE_ANALYSIS:
	COMPRESS_OUTPUT = False

### Set path variables and create directories

WC_ECOLI_DIRECTORY = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
OUT_DIRECTORY = filepath.makedirs(WC_ECOLI_DIRECTORY, "out")
CACHED_SIM_DATA_DIRECTORY = os.path.join(WC_ECOLI_DIRECTORY, "cached")

SUBMISSION_TIME = filepath.timestamp()
INDIV_OUT_DIRECTORY = filepath.makedirs(OUT_DIRECTORY, SUBMISSION_TIME + "__" + SIM_DESCRIPTION)
KB_DIRECTORY = filepath.makedirs(INDIV_OUT_DIRECTORY, "kb")
METADATA_DIRECTORY = filepath.makedirs(INDIV_OUT_DIRECTORY, "metadata")


if VERBOSE_QUEUE:
	print "Building filestructure."

for i in VARIANTS_TO_RUN:
	VARIANT_DIRECTORY = filepath.makedirs(INDIV_OUT_DIRECTORY, VARIANT + "_%06d" % i)
	VARIANT_SIM_DATA_DIRECTORY = filepath.makedirs(VARIANT_DIRECTORY, "kb")
	VARIANT_METADATA_DIRECTORY = filepath.makedirs(VARIANT_DIRECTORY, "metadata")
	VARIANT_COHORT_PLOT_DIRECTORY = filepath.makedirs(VARIANT_DIRECTORY, "plotOut")

	for j in xrange(N_INIT_SIMS):