Mercurial > repos > rnateam > bctools
diff extract_aln_ends.py @ 50:0b9aab6aaebf draft
Uploaded 16cfcafe8b42055c5dd64e62c42b82b455027a40
author | rnateam |
---|---|
date | Tue, 26 Jan 2016 04:38:27 -0500 |
parents | 570a7de9f151 |
children |
line wrap: on
line diff
--- a/extract_aln_ends.py Sat Dec 19 06:16:22 2015 -0500 +++ b/extract_aln_ends.py Tue Jan 26 04:38:27 2016 -0500 @@ -1,5 +1,17 @@ #!/usr/bin/env python +import argparse +import logging +from sys import stdout +from shutil import rmtree +from tempfile import mkdtemp +from pybedtools import BedTool +import pysam +# avoid ugly python IOError when stdout output is piped into another program +# and then truncated (such as piping to head) +from signal import signal, SIGPIPE, SIG_DFL +signal(SIGPIPE, SIG_DFL) + tool_description = """ Extract alignment ends from sam file. @@ -32,25 +44,12 @@ Status: Development """ -import argparse -import logging -from sys import stdout -from shutil import rmtree -from tempfile import mkdtemp -from pybedtools import BedTool -import pysam - class DefaultsRawDescriptionHelpFormatter(argparse.ArgumentDefaultsHelpFormatter, argparse.RawDescriptionHelpFormatter): # To join the behaviour of RawDescriptionHelpFormatter with that of ArgumentDefaultsHelpFormatter pass -# avoid ugly python IOError when stdout output is piped into another program -# and then truncated (such as piping to head) -from signal import signal, SIGPIPE, SIG_DFL -signal(SIGPIPE, SIG_DFL) - # parse command line arguments parser = argparse.ArgumentParser(description=tool_description, epilog=epilog,