Skip to content

Commit

Permalink
Added version string and report it in log
Browse files Browse the repository at this point in the history
  • Loading branch information
cerebis committed Jul 28, 2018
1 parent cd66270 commit a4450d0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ After stage 2 has been successfully completed, binned assembly contigs can be fo
#### Clustering result
The most portable format of the clustering result is `clustering.mcl` which follows the format established by MCL (surprisingly). In this format, each line pertains to a cluster (counting from 1), while the contents of a line is a space-separated list of member sequences.

Therefore a file with the contents:
E.g. For a MCL file of three lines with the following contents:

```
seq1 seq4 seq5
seq3
seq2
L1: seq1 seq4 seq5
L2: seq2
L3: seq2
```

There are 3 clusters, with memberships as follows:
Expand Down
14 changes: 14 additions & 0 deletions bin3C.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
import logging
import sys

__version__ = '0.1'

if __name__ == '__main__':
import argparse

def mk_version():
return 'bin3C v{}'.format(__version__)

def out_name(base, suffix):
return '{}{}'.format(base, suffix)

global_parser = argparse.ArgumentParser(add_help=False)
global_parser.add_argument('-V', '--version', help='Show the application version')
global_parser.add_argument('-v', '--verbose', default=False, action='store_true', help='Verbose output')
global_parser.add_argument('--clobber', default=False, action='store_true', help='Clobber existing files')
global_parser.add_argument('--log', help='Log file path [OUTDIR/bin3C.log]')
Expand Down Expand Up @@ -75,6 +81,10 @@ def out_name(base, suffix):

args = parser.parse_args()

if args.version:
print mk_version()
sys.exit(0)

try:
make_dir(args.OUTDIR, args.clobber)
except IOError as e:
Expand Down Expand Up @@ -110,6 +120,10 @@ def out_name(base, suffix):
fh.setFormatter(formatter)
root.addHandler(fh)

# Add some environmental details
logger.debug(mk_version())
logger.debug(sys.version.replace('\n', ' '))

try:

if args.command == 'mkmap':
Expand Down

0 comments on commit a4450d0

Please sign in to comment.