Closed nafisahis closed 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:
savePlot=True
to savePlot=False
in the readme and a549/tgfb_garnet.cfg
to match the default optionparser.add_argument('--plot'
in garnet.py
because the variable is being set by the config fileos.path.join(outdir, 'regression_plots')
instead of os.path.join(outdir.split('//')[0],'regression_plots')
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?
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.
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.
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'.