Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflicts in MDL String Reaction Output #96

Open
cnlbob opened this issue Oct 6, 2015 · 0 comments
Open

Conflicts in MDL String Reaction Output #96

cnlbob opened this issue Oct 6, 2015 · 0 comments

Comments

@cnlbob
Copy link
Contributor

cnlbob commented Oct 6, 2015

The current implementation of the MDL String feature can create file naming conflicts.

Assume that "vm" is a molecule that's being counted in the world.
Also assume that you'd like to count "vm" inside some other object as well.

The first counting of "vm" in the world will generate an output file named "vm.World.dat".
Right now, the MDL counting of "vm" will produce the same file name and MCell won't run:

   Fatal error: COUNT statements in the same reaction data output 
          block should have unique output file names 
          ("./react_data/seed_00001/vm.World.dat" appears more than once)

The problem can be seen in the code from "export_mcell_mdl.py" here:

elif rxn_output.rxn_or_mol == 'MDLString':
  outputStr = rxn_output.mdl_string
  output_file = rxn_output.molecule_name
  if outputStr not in ['', None]:
    outputStr = '{%s} =>  "./react_data/seed_" & seed & \"/%s.World.dat\"\n' % (outputStr, output_file)
    out_file.write(outputStr)
  else:
    print('Found invalid reaction output {0}'.format(rxn_output.name))

The output file name for the MDL String is using the "World" name, and this conflicts with counting that same molecule in the World. It's also not really accurate since it's not known where that molecule is being counted (unless we actually parse the MDL string itself). We might replace "World" with "MDL" or "CustomMDL" or something other than "World" as a quick patch. But then, multiple MDL String output definitions using the same molecule would also collide. Another approach would be to specify the full MDL line (file name and everything), but even then there's a problem when running with multiple seeds.

This may require some more careful thinking about how to ensure that proper file names are generated from the MDL output statement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant