Skip to content

Commit

Permalink
update normalization thershold. update browser list widget
Browse files Browse the repository at this point in the history
  • Loading branch information
rjdkmr committed Mar 20, 2017
1 parent 346b68e commit 313ade5
Show file tree
Hide file tree
Showing 17 changed files with 949 additions and 70 deletions.
1 change: 1 addition & 0 deletions docs/apidoc/genomicsDataHandler/hdf5handler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

.. autosummary::
HDF5Handler
HDF5Handler.setTitle
HDF5Handler.getChromList
HDF5Handler.getResolutionList
HDF5Handler.getDataNameList
Expand Down
1 change: 1 addition & 0 deletions docs/apidoc/summary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ genomicsDataHandler module

.. autosummary::
genomicsDataHandler.HDF5Handler
genomicsDataHandler.HDF5Handler.setTitle
genomicsDataHandler.HDF5Handler.getChromList
genomicsDataHandler.HDF5Handler.getResolutionList
genomicsDataHandler.HDF5Handler.getDataNameList
Expand Down
26 changes: 25 additions & 1 deletion gcMapExplorer/clui/normIC.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@
"""

vminHelp = \
""" Minimum thershold value for normalization.
If contact frequency is less than or equal to this thershold value,
this value is discarded during normalization.
"""

vmaxHelp = \
""" Maximum thershold value for normalization.
If contact frequency is greater than or equal to this thershold value,
this value is discarded during normalization.
"""

tolHelp = \
""" Tolerance for matrix balancing.
Smaller tolreance increases accuracy in sums of rows and columns.
Expand Down Expand Up @@ -161,13 +175,14 @@ def main():

if args.outputFileFormat == 'ccmap' and args.inputFileFormat == 'ccmap':
gmlib.normalizer.normalizeCCMapByIC(args.inputFile, tol=args.tol, iteration=args.iteration,
outFile=args.outputFile,
outFile=args.outputFile, vmin=args.vmin, vmax=args.vmax,
percentile_thershold_no_data=args.percentile_thershold_no_data,
thershold_data_occup=args.thershold_data_occup,
workDir=args.workDir)

if args.outputFileFormat == 'gcmap' and args.inputFileFormat == 'ccmap':
norm_ccmap = gmlib.normalizer.normalizeCCMapByIC(args.inputFile, tol=args.tol, iteration=args.iteration,
vmin=args.vmin, vmax=args.vmax,
percentile_thershold_no_data=args.percentile_thershold_no_data,
thershold_data_occup=args.thershold_data_occup,
workDir=args.workDir)
Expand All @@ -177,6 +192,7 @@ def main():
if args.outputFileFormat == 'gcmap' and args.inputFileFormat == 'gcmap':
gmlib.normalizer.normalizeGCMapByIC(args.inputFile, args.outputFile,
tol=args.tol, iteration=args.iteration,
vmin=args.vmin, vmax=args.vmax,
percentile_thershold_no_data=args.percentile_thershold_no_data,
thershold_data_occup=args.thershold_data_occup,
workDir=args.workDir)
Expand Down Expand Up @@ -212,6 +228,14 @@ def parseArguments():
type = float, default=1e-4,
help=tolHelp)

parser.add_argument('-vmax', '--maximum-value', action='store',
dest='vmax', type=float, metavar=None,
help=vminHelp)

parser.add_argument('-vmin', '--minimum-value', action='store',
dest='vmin', metavar=None, type=float,
help=vmaxHelp)

parser.add_argument('-c', '--iteration', action='store',
dest='iteration', metavar=500,
type = int, default=500,
Expand Down
28 changes: 26 additions & 2 deletions gcMapExplorer/clui/normKR.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,20 @@
"""

vminHelp = \
""" Minimum thershold value for normalization.
If contact frequency is less than or equal to this thershold value,
this value is discarded during normalization.
"""

vmaxHelp = \
""" Maximum thershold value for normalization.
If contact frequency is greater than or equal to this thershold value,
this value is discarded during normalization.
"""

mapSizeCeilingForMemoryHelp = \
""" Maximum size of contact map allowed for calculation using RAM.
If map size or shape is larger than this value, normalization will be
Expand Down Expand Up @@ -177,13 +191,15 @@ def main():
showErrorAndExit(parser, msg)

if args.outputFileFormat == 'ccmap' and args.inputFileFormat == 'ccmap':
gmlib.normalizer.normalizeCCMapByKR(args.inputFile, memory=args.memory, tol=args.tol, outFile=args.outputFile,
gmlib.normalizer.normalizeCCMapByKR(args.inputFile, memory=args.memory, tol=args.tol,
vmin=args.vmin, vmax=args.vmax, outFile=args.outputFile,
percentile_thershold_no_data=args.percentile_thershold_no_data,
thershold_data_occup=args.thershold_data_occup,
workDir=args.workDir)

if args.outputFileFormat == 'gcmap' and args.inputFileFormat == 'ccmap':
norm_ccmap = gmlib.normalizer.normalizeCCMapByKR(args.inputFile, memory=args.memory, tol=args.tol,
vmin=args.vmin, vmax=args.vmax,
percentile_thershold_no_data=args.percentile_thershold_no_data,
thershold_data_occup=args.thershold_data_occup,
workDir=args.workDir)
Expand All @@ -193,7 +209,7 @@ def main():
if args.outputFileFormat == 'gcmap' and args.inputFileFormat == 'gcmap':
gmlib.normalizer.normalizeGCMapByKR(args.inputFile, args.outputFile,
mapSizeCeilingForMemory=args.mapSizeCeilingForMemory,
tol=args.tol,
tol=args.tol, vmin=args.vmin, vmax=args.vmax,
percentile_thershold_no_data=args.percentile_thershold_no_data,
thershold_data_occup=args.thershold_data_occup,
workDir=args.workDir)
Expand Down Expand Up @@ -234,6 +250,14 @@ def parseArguments():
choices=['RAM', 'HDD'], default='RAM',
help=memoryHelp)

parser.add_argument('-vmax', '--maximum-value', action='store',
dest='vmax', type=float, metavar=None,
help=vminHelp)

parser.add_argument('-vmin', '--minimum-value', action='store',
dest='vmin', metavar=None, type=float,
help=vmaxHelp)

parser.add_argument('-mscm', '--map-size-ceiling-for-memory', action='store',
dest='mapSizeCeilingForMemory', metavar='20000',
type = int,
Expand Down
25 changes: 24 additions & 1 deletion gcMapExplorer/clui/normMCFS.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,20 @@
"""

vminHelp = \
""" Minimum thershold value for normalization.
If contact frequency is less than or equal to this thershold value,
this value is discarded during normalization.
"""

vmaxHelp = \
""" Maximum thershold value for normalization.
If contact frequency is greater than or equal to this thershold value,
this value is discarded during normalization.
"""

percentile_thershold_no_data_help = \
""" It can be used to filter the map, where rows/columns with largest numbers
of missing data can be discarded. Its value should be between 1 and 100.
Expand Down Expand Up @@ -142,12 +156,14 @@ def main():

if args.outputFileFormat == 'ccmap' and args.inputFileFormat == 'ccmap':
gmlib.normalizer.normalizeCCMapByMCFS(args.inputFile, stats=args.stats, outFile=args.outputFile,
vmin=args.vmin, vmax=args.vmax,
percentile_thershold_no_data=args.percentile_thershold_no_data,
thershold_data_occup=args.thershold_data_occup,
workDir=args.workDir)

if args.outputFileFormat == 'gcmap' and args.inputFileFormat == 'ccmap':
norm_ccmap = gmlib.normalizer.normalizeCCMapByMCFS(args.inputFile, stats=args.stats,
vmin=args.vmin, vmax=args.vmax,
percentile_thershold_no_data=args.percentile_thershold_no_data,
thershold_data_occup=args.thershold_data_occup,
workDir=args.workDir)
Expand All @@ -156,7 +172,7 @@ def main():

if args.outputFileFormat == 'gcmap' and args.inputFileFormat == 'gcmap':
gmlib.normalizer.normalizeGCMapByMCFS(args.inputFile, args.outputFile,
stats=args.stats,
stats=args.stats, vmin=args.vmin, vmax=args.vmax,
percentile_thershold_no_data=args.percentile_thershold_no_data,
thershold_data_occup=args.thershold_data_occup,
compression=args.compression,
Expand Down Expand Up @@ -190,6 +206,13 @@ def parseArguments():
dest='stats', metavar='median',
choices=['median', 'mean'], default='median',
help=statsHelp)
parser.add_argument('-vmax', '--maximum-value', action='store',
dest='vmax', type=float, metavar=None,
help=vminHelp)

parser.add_argument('-vmin', '--minimum-value', action='store',
dest='vmin', metavar=None, type=float,
help=vmaxHelp)

parser.add_argument('-ptnd', '--percentile-thershold-no-data', action='store',
dest='percentile_thershold_no_data', metavar=99,
Expand Down
Loading

0 comments on commit 313ade5

Please sign in to comment.