#!/usr/bin/env python
"""
Script to run nucleoatac.
Various functions for calling nucleosomes using ATAC-Seq data.

Copyright (c) 2015, Stanford University

This code is free software; you can redistribute it and/or modify it under the terms
of the MIT License (see the file COPYING included with the distribution).

@author: Alicia Schep
@contact: aschep@stanford.edu
"""

###-----------Import modules---------------####

import sys
from nucleoatac import __version__
import time
import matplotlib as mpl
mpl.use('PS')
from nucleoatac.cli import nucleoatac_parser, nucleoatac_main



if __name__ == '__main__':
    print "Command run:  "+ ' '.join(map(str,sys.argv))
    print "nucleoatac version " +  __version__
    print "start run at: " + time.strftime("%Y-%m-%d %H:%M")
    try:
        parser = nucleoatac_parser()
        args = parser.parse_args()
        nucleoatac_main(args)
        print "end run at: " + time.strftime("%Y-%m-%d %H:%M")
    except KeyboardInterrupt:
        sys.stderr.write("User interrupted nucleoatac.")
        sys.exit(0)


