From 0664cc7a281287679263845f5974b1e598327942 Mon Sep 17 00:00:00 2001 From: Michael Coleman Date: Thu, 22 May 2008 15:27:08 -0500 Subject: [PATCH] shuffle: add copyright, minor code cleanups --- greylag_shuffle_database.py | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/greylag_shuffle_database.py b/greylag_shuffle_database.py index d28a85a..f03802a 100755 --- a/greylag_shuffle_database.py +++ b/greylag_shuffle_database.py @@ -20,6 +20,30 @@ some purposes. """ +__copyright__ = ''' + greylag, a collection of programs for MS/MS protein analysis + Copyright (C) 2006-2008 Stowers Institute for Medical Research + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + Contact: Mike Coleman + Stowers Institute for Medical Research + 1000 East 50th Street + Kansas City, Missouri 64110 + USA +''' + from collections import defaultdict import hashlib @@ -38,11 +62,6 @@ def error(s): sys.exit('error: ' + s) -whitespace = re.compile('[ \t]+') - -default_wrap=80 - - class abstract_decoy_maker: def make(self, s): """Return a decoy sequence of the same length. (Argument is a list of @@ -172,11 +191,14 @@ def main(): help="don't output original sequences") parser.add_option("-v", "--verbose", action="store_true", dest="verbose", help="be verbose") + DEFAULT_WRAP = 80 parser.add_option("-w", "--wrap", dest="wrap", type="int", - default=default_wrap, + default=DEFAULT_WRAP, help="wrap sequence to specified width" - " [default %s, 0 means don't wrap at all]" % default_wrap, + " [default %s, 0 means don't wrap at all]" % DEFAULT_WRAP, metavar="COLUMNS") + parser.add_option("--copyright", action="store_true", dest="copyright", + help="print copyright and exit") (options, args) = parser.parse_args() if (len(args) != 1 @@ -210,5 +232,6 @@ def main(): len(sixmers[1]) - len(common_sixmers), len(common_sixmers))) + if __name__ == '__main__': main() -- 2.11.4.GIT