Repository 's_mart'
hg clone https://toolshed.g2.bx.psu.edu/repos/yufei-luo/s_mart

Changeset 50:6283667d1f34 (2013-12-13)
Previous changeset 49:80a080dc3ee8 (2013-12-13) Next changeset 51:0037e4802e65 (2014-01-10)
Commit message:
Deleted selected files
removed:
SMART/Java/Python/GetReadDistribution.py
SMART/Java/Python/GetReadSizes.py
b
diff -r 80a080dc3ee8 -r 6283667d1f34 SMART/Java/Python/GetReadDistribution.py
--- a/SMART/Java/Python/GetReadDistribution.py Fri Dec 13 10:37:16 2013 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
b'@@ -1,303 +0,0 @@\n-#! /usr/bin/env python\n-#\n-# Copyright INRA-URGI 2009-2010\n-# \n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use,\n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info".\n-# \n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability.\n-# \n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or\n-# data to be ensured and, more generally, to use and operate it in the\n-# same conditions as regards security.\n-# \n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-#\n-import random, os, glob, subprocess\n-from commons.core.parsing.ParserChooser import ParserChooser\n-from commons.core.parsing.GffParser import GffParser\n-from SMART.Java.Python.misc.UnlimitedProgress import UnlimitedProgress\n-from SMART.Java.Python.misc.Progress import Progress\n-from SMART.Java.Python.misc import Utils\n-from commons.core.LoggerFactory import LoggerFactory\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-\n-LOG_DEPTH      = "smart"\n-DEFAULT_REGION = "_all_"\n-MULTIPLE_STR   = {1: "", 1000: " (in kbp)", 1000000: " (in Gbp)"}\n-\n-class GetReadDistribution(object):\n-\n-\tdef __init__(self, verbosity = 0):\n-\t\tself.xLab         = ""\n-\t\tself.yLab         = "# reads"\n-\t\tself.verbosity    = verbosity\n-\t\tself.number       = random.randint(0, 100000)\n-\t\tself.log          = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self.verbosity)\n-\t\tself.parsers      = {}\n-\t\tself.distribution = {}\n-\t\tself.factors      = {}\n-\t\tself.regions      = None\n-\t\tself.tmpDatName   = None\n-\t\tself.tmpRName     = None\n-\t\tself.quorum       = 1\n-\t\tself.strands      = False\n-\t\tself.width        = 800\n-\t\tself.height       = 300\n-\t\tself.arial        = False\n-\n-\tdef setNames(self, names):\n-\t\tself.names = names\n-\n-\tdef setInputFiles(self, fileNames, format):\n-\t\tchooser = ParserChooser(self.verbosity)\n-\t\tchooser.findFormat(format)\n-\t\tfor cpt, fileName in enumerate(fileNames):\n-\t\t\tself.parsers[self.names[cpt]] = chooser.getParser(fileName)\n-\n-\tdef setOutputFileName(self, fileName):\n-\t\tself.outputFileName = fileName\n-\n-\tdef setLabs(self, xLab, yLab):\n-\t\tself.xLab = xLab\n-\t\tself.yLab = yLab\n-\n-\tdef setBinSize(self, binSize):\n-\t\tself.binSize = binSize\n-\n-\tdef setColors(self, colors):\n-\t\tself.colors = colors\n-\n-\tdef setFactors(self, factors):\n-\t\tif factors == None:\n-\t\t\tself.factors = dict([name, 1.0] for name in self.names)\n-\t\telse:\n-\t\t\tself.factors = dict(zip(self.names, factors))\n-\n-\tdef setMultiple(self, boolean):\n-\t\tself.multiple = boolean\n-\t\n-\tdef setImageSize(self, width, height):\n-\t\tif width != None:\n-\t\t\tself.width = width\n-\t\tif height != None:\n-\t\t\tself.height = height\n-\n-\tdef setQuorum(self, quorum):\n-\t\tself.quorum = quorum\n-\n-\tdef setRegionsFile(self, fileName):\n-\t\tif fileName != None:\n-\t\t\tself._loadRegions(fileName)\n-\n-\tdef setBothStrands(self, strands):\n-\t\tself.strands = strands\n-\n-\tdef setArial(self, arial):\n-\t\tself.arial = arial\n-\n-\tdef _checkOptions(self):\n-\t\tif not self.parsers:\n-\t\t\tse'..b' separated by commas [compulsory] [format: string]")\n-\tparser.add_option("-f", "--format",    dest="format",          action="store",      default=None,      type="string", help="format of the input [compulsory] [format: transcript or sequence file format]")\n-\tparser.add_option("-n", "--names",     dest="names",           action="store",      default=None,      type="string", help="name of the input data, separated by commas [compulsory] [format: string]")\n-\tparser.add_option("-o", "--output",    dest="outputFileName",  action="store",      default=None,      type="string", help="output file [format: output file in PNG format]")\n-\tparser.add_option("-s", "--binSize",   dest="binSize",         action="store",      default=10000,     type="int",    help="bin size [format: int] [default: 10000]")\n-\tparser.add_option("-l", "--xLabel",    dest="xLab",            action="store",      default="",        type="string", help="x-axis label name [format: string]")\n-\tparser.add_option("-L", "--yLabel",    dest="yLab",            action="store",      default="# reads", type="string", help="y-axis label name [format: string] [default: Reads]")\n-\tparser.add_option("-c", "--colors",    dest="colors",          action="store",      default=None,      type="string", help="colors of the bars, separated by commas  [format: string]")\n-\tparser.add_option("-a", "--factors",   dest="factors",         action="store",      default=None,      type="string", help="normalization factors, separated by commas  [format: string]")\n-\tparser.add_option("-r", "--regions",   dest="regionsFileName", action="store",      default=None,      type="string", help="regions to plot [format: transcript file in GFF format]")\n-\tparser.add_option("-2", "--strands",   dest="strands",         action="store_true", default=False,                    help="plot negative strands on the negative x-axis [format: boolean] [default: False]")\n-\tparser.add_option("-m", "--multiple",  dest="multiple",        action="store_true", default=False,                    help="use human readable genomic positions (k, G) [format: boolean] [default: False]")\n-\tparser.add_option("-q", "--quorum",    dest="quorum",          action="store",      default=1,         type="int",    help="minimum number of intervals to plot a region [format: int] [default: 1]")\n-\tparser.add_option("-z", "--width",     dest="width",           action="store",      default=800,       type="int",    help="width of the image [format: int] [default: 800]")\n-\tparser.add_option("-Z", "--height",    dest="height",          action="store",      default=300,       type="int",    help="height of the image [format: int] [default: 300]")\n-\tparser.add_option("-A", "--arial",     dest="arial",           action="store_true", default=False,                    help="use Arial font [format: boolean] [default: false]")\n-\tparser.add_option("-v", "--verbosity", dest="verbosity",       action="store",      default=1,         type="int",    help="trace level [format: int]")\n-\toptions = parser.parse_args()[0]\n-\tiGetReadDistribution = GetReadDistribution(options.verbosity)\n-\tiGetReadDistribution.setNames(options.names.split(","))\n-\tiGetReadDistribution.setInputFiles(options.inputFileNames.split(","), options.format)\n-\tiGetReadDistribution.setOutputFileName(options.outputFileName)\n-\tiGetReadDistribution.setLabs(options.xLab, options.yLab)\n-\tiGetReadDistribution.setBinSize(options.binSize)\n-\tiGetReadDistribution.setColors(None if options.colors == None else options.colors.split(","))\n-\tiGetReadDistribution.setFactors(None if options.factors == None else map(float, options.factors.split(",")))\n-\tiGetReadDistribution.setRegionsFile(options.regionsFileName)\n-\tiGetReadDistribution.setMultiple(options.multiple)\n-\tiGetReadDistribution.setQuorum(options.quorum)\n-\tiGetReadDistribution.setImageSize(options.width, options.height)\n-\tiGetReadDistribution.setBothStrands(options.strands)\n-\tiGetReadDistribution.setArial(options.arial)\n-\tiGetReadDistribution.run()\n-\n'
b
diff -r 80a080dc3ee8 -r 6283667d1f34 SMART/Java/Python/GetReadSizes.py
--- a/SMART/Java/Python/GetReadSizes.py Fri Dec 13 10:37:16 2013 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
b'@@ -1,282 +0,0 @@\n-#! /usr/bin/env python\n-#\n-# Copyright INRA-URGI 2009-2010\n-# \n-# This software is governed by the CeCILL license under French law and\n-# abiding by the rules of distribution of free software. You can use,\n-# modify and/ or redistribute the software under the terms of the CeCILL\n-# license as circulated by CEA, CNRS and INRIA at the following URL\n-# "http://www.cecill.info".\n-# \n-# As a counterpart to the access to the source code and rights to copy,\n-# modify and redistribute granted by the license, users are provided only\n-# with a limited warranty and the software\'s author, the holder of the\n-# economic rights, and the successive licensors have only limited\n-# liability.\n-# \n-# In this respect, the user\'s attention is drawn to the risks associated\n-# with loading, using, modifying and/or developing or reproducing the\n-# software by the user in light of its specific status of free software,\n-# that may mean that it is complicated to manipulate, and that also\n-# therefore means that it is reserved for developers and experienced\n-# professionals having in-depth computer knowledge. Users are therefore\n-# encouraged to load and test the software\'s suitability as regards their\n-# requirements in conditions enabling the security of their systems and/or\n-# data to be ensured and, more generally, to use and operate it in the\n-# same conditions as regards security.\n-# \n-# The fact that you are presently reading this means that you have had\n-# knowledge of the CeCILL license and that you accept its terms.\n-#\n-import random, os, glob, subprocess\n-from commons.core.parsing.ParserChooser import ParserChooser\n-from commons.core.parsing.GffParser import GffParser\n-from SMART.Java.Python.misc.UnlimitedProgress import UnlimitedProgress\n-from SMART.Java.Python.misc.Progress import Progress\n-from SMART.Java.Python.misc import Utils\n-from commons.core.LoggerFactory import LoggerFactory\n-from commons.core.utils.RepetOptionParser import RepetOptionParser\n-\n-LOG_DEPTH      = "smart"\n-DEFAULT_REGION = "_all_"\n-\n-class GetReadSizes(object):\n-\n-\tdef __init__(self, verbosity = 0):\n-\t\tself.xLab       = "Size"\n-\t\tself.yLab       = "# reads"\n-\t\tself.verbosity  = verbosity\n-\t\tself.number     = random.randint(0, 100000)\n-\t\tself.log        = LoggerFactory.createLogger("%s.%s" % (LOG_DEPTH, self.__class__.__name__), self.verbosity)\n-\t\tself.parsers    = {}\n-\t\tself.sizes      = {}\n-\t\tself.factors    = {}\n-\t\tself.regions    = None\n-\t\tself.percentage = False\n-\t\tself.tmpDatName = None\n-\t\tself.tmpRName   = None\n-\t\tself.width      = 800\n-\t\tself.height     = 300\n-\t\tself.arial      = False\n-\n-\tdef setNames(self, names):\n-\t\tself.names = names\n-\n-\tdef setInputFiles(self, fileNames, format):\n-\t\tchooser = ParserChooser(self.verbosity)\n-\t\tchooser.findFormat(format)\n-\t\tfor cpt, fileName in enumerate(fileNames):\n-\t\t\tself.parsers[self.names[cpt]] = chooser.getParser(fileName)\n-\t\tif not self.factors:\n-\t\t\tself.factors = dict([name, 1.0] for name in self.names)\n-\n-\tdef setOutputFileName(self, fileName):\n-\t\tself.outputFileName = fileName\n-\n-\tdef setLabs(self, xLab, yLab):\n-\t\tself.xLab = xLab\n-\t\tself.yLab = yLab\n-\n-\tdef setSizes(self, minSize, maxSize):\n-\t\tself.minSize = minSize\n-\t\tself.maxSize = maxSize\n-\n-\tdef setColors(self, colors):\n-\t\tself.colors = colors\n-\n-\tdef setFactors(self, factors):\n-\t\tif factors:\n-\t\t\tself.factors = dict(zip(self.names, factors))\n-\n-\tdef setRegionsFile(self, fileName):\n-\t\tif fileName != None:\n-\t\t\tself._loadRegions(fileName)\n-\n-\tdef setPercentage(self, percentage):\n-\t\tself.percentage = percentage\n-\t\tself.xLab = "% reads"\n-\n-\tdef setImageSize(self, width, height):\n-\t\tif width != None:\n-\t\t\tself.width = width\n-\t\tif height != None:\n-\t\t\tself.height = height\n-\n-\tdef setArial(self, arial):\n-\t\tself.arial = arial\n-\n-\tdef _checkOptions(self):\n-\t\tif not self.parsers:\n-\t\t\tself.logAndRaise("ERROR: Missing input file names")\n-\n-\tdef _logAndRaise(self, errorMsg):\n-\t\tself.log.error(errorMsg)\n-\t\traise Exception(errorMsg)\n-\n-\tdef _loadRegions(self, f'..b't()\n-\t\tself._cleanFiles()\n-\t\tself.log.info("END Get Read Sizes")\n-\n-\n-if __name__ == "__main__":\n-\tdescription = "Usage: GetReadSizes.py [options]\\n\\nGet Read Sizes v1.0.1: Get the sizes of a set of reads. [Category: Personal]\\n"\n-\tepilog = ""\n-\tparser = RepetOptionParser(description = description, epilog = epilog)\n-\tparser.add_option("-i", "--input",     dest="inputFileNames",  action="store",      default=None,     type="string", help="input files, separated by commas [compulsory] [format: string]")\n-\tparser.add_option("-f", "--format",    dest="format",          action="store",      default=None,     type="string", help="format of the input [compulsory] [format: transcript or sequence file format]")\n-\tparser.add_option("-n", "--names",     dest="names",           action="store",      default=None,     type="string", help="name of the input data, separated by commas [compulsory] [format: string]")\n-\tparser.add_option("-o", "--output",    dest="outputFileName",  action="store",      default=None,      type="string", help="output file [format: output file in PNG format]")\n-\tparser.add_option("-s", "--minSize",   dest="minSize",         action="store",      default=None,      type="int",    help="minimum size [format: int]")\n-\tparser.add_option("-S", "--maxSize",   dest="maxSize",         action="store",      default=None,      type="int",    help="maximum size [format: int]")\n-\tparser.add_option("-l", "--xLabel",    dest="xLab",            action="store",      default="Size",    type="string", help="x-axis label name [format: string] [default: Size]")\n-\tparser.add_option("-L", "--yLabel",    dest="yLab",            action="store",      default="# reads", type="string", help="y-axis label name [format: string] [default: Reads]")\n-\tparser.add_option("-c", "--colors",    dest="colors",          action="store",      default=None,      type="string", help="colors of the bars, separated by commas  [format: string]")\n-\tparser.add_option("-a", "--factors",   dest="factors",         action="store",      default=None,      type="string", help="normalization factors, separated by commas  [format: string]")\n-\tparser.add_option("-r", "--regions",   dest="regionsFileName", action="store",      default=None,      type="string", help="regions to plot [format: transcript file in GFF format]")\n-\tparser.add_option("-p", "--percent",   dest="percentage",      action="store_true", default=False,                    help="compute percentage instead [format: boolean] [default: false]")\n-\tparser.add_option("-z", "--width",     dest="width",           action="store",      default=800,       type="int",    help="width of the image [format: int] [default: 800]")\n-\tparser.add_option("-Z", "--height",    dest="height",          action="store",      default=300,       type="int",    help="height of the image [format: int] [default: 300]")\n-\tparser.add_option("-A", "--arial",     dest="arial",           action="store_true", default=False,                    help="use Arial font [format: boolean] [default: false]")\n-\tparser.add_option("-v", "--verbosity", dest="verbosity",       action="store",      default=1,         type="int",    help="trace level [format: int]")\n-\toptions = parser.parse_args()[0]\n-\tiGetReadSizes = GetReadSizes(options.verbosity)\n-\tiGetReadSizes.setNames(options.names.split(","))\n-\tiGetReadSizes.setInputFiles(options.inputFileNames.split(","), options.format)\n-\tiGetReadSizes.setOutputFileName(options.outputFileName)\n-\tiGetReadSizes.setSizes(options.minSize, options.maxSize)\n-\tiGetReadSizes.setColors(None if options.colors == None else options.colors.split(","))\n-\tiGetReadSizes.setFactors(None if options.factors == None else map(float, options.factors.split(",")))\n-\tiGetReadSizes.setRegionsFile(options.regionsFileName)\n-\tiGetReadSizes.setPercentage(options.percentage)\n-\tiGetReadSizes.setImageSize(options.width, options.height)\n-\tiGetReadSizes.setLabs(options.xLab, options.yLab)\n-\tiGetReadSizes.setArial(options.arial)\n-\tiGetReadSizes.run()\n'