fraenkel-lab / OmicsIntegrator

This repository is the working directory for the Garnet-Forest bundle of python scripts for analyzing diverse forms of 'omic' data in a network context.
http://fraenkel.mit.edu/omicsintegrator
BSD 2-Clause "Simplified" License
31 stars 21 forks source link

Adding [regression] section for saving regression plots #15

Closed nafisahis closed 8 years ago

nafisahis commented 8 years ago

Changed configuration file to allow the user to enable or disable regression plot generation. By adding a parameter savePlot, this can handle saving plots in the subdirectory named 'regression_plots'.

agitter commented 8 years ago

The regression plots are a helpful way for users to visualize the Garnet output. @nafisahis and I use them as a standard part of our Garnet analyses, so I recommend merging this pull request. I'll leave it open for a few days to give others time to comment.

There are a few small changes I recommend before merging:

We could consider adding a default value for the config parser if savePlot is not provided so that existing config files can be used. What is the current behavior if this config option is not provided? Will the parser throw an error?

agitter commented 8 years ago

After these new commits, I think this is ready to be merged. I'll check back in a couple days and merge if no one else has comments.

nafisahis commented 8 years ago

Made first two changes. But for third one just changed outdir.split('//') to os.path.split(outdir).

The reason I am using split function on outdir is that in motif_regression.py outdir is not a single path to output directory rather it is a concatenation of path to output directory and of three different file name. [This will make sense if we look into cmd construction inside getTfsFromRegression function in garnet.py]

I needed the first path which is the actual path to the output directory. So, I split the string with .split('//') initially and used only first component ending with .../output/ which is output directory.

Later, changed outdir.split('//') to os.path.split(outdir) to make this os independant.