Mercurial > repos > rnateam > bctools
comparison coords2clnt.py @ 50:0b9aab6aaebf draft
Uploaded 16cfcafe8b42055c5dd64e62c42b82b455027a40
author | rnateam |
---|---|
date | Tue, 26 Jan 2016 04:38:27 -0500 |
parents | de4ea3aa1090 |
children |
comparison
equal
deleted
inserted
replaced
49:303f6402a035 | 50:0b9aab6aaebf |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | |
3 import argparse | |
4 import logging | |
5 from sys import stdout | |
6 from pybedtools import BedTool | |
7 from pybedtools.featurefuncs import five_prime | |
8 # avoid ugly python IOError when stdout output is piped into another program | |
9 # and then truncated (such as piping to head) | |
10 from signal import signal, SIGPIPE, SIG_DFL | |
11 signal(SIGPIPE, SIG_DFL) | |
2 | 12 |
3 tool_description = """ | 13 tool_description = """ |
4 Given coordinates of the aligned reads, calculate positions of the crosslinked | 14 Given coordinates of the aligned reads, calculate positions of the crosslinked |
5 nucleotides. Crosslinked nts are assumed to be one nt upstream of the 5'-end of | 15 nucleotides. Crosslinked nts are assumed to be one nt upstream of the 5'-end of |
6 the read. | 16 the read. |
22 Copyright: 2015 | 32 Copyright: 2015 |
23 License: Apache | 33 License: Apache |
24 Email: maticzkd@informatik.uni-freiburg.de | 34 Email: maticzkd@informatik.uni-freiburg.de |
25 Status: Testing | 35 Status: Testing |
26 """ | 36 """ |
27 | |
28 import argparse | |
29 import logging | |
30 from sys import stdout | |
31 from pybedtools import BedTool | |
32 from pybedtools.featurefuncs import five_prime | |
33 # avoid ugly python IOError when stdout output is piped into another program | |
34 # and then truncated (such as piping to head) | |
35 from signal import signal, SIGPIPE, SIG_DFL | |
36 signal(SIGPIPE, SIG_DFL) | |
37 | 37 |
38 # parse command line arguments | 38 # parse command line arguments |
39 parser = argparse.ArgumentParser(description=tool_description, | 39 parser = argparse.ArgumentParser(description=tool_description, |
40 epilog=epilog, | 40 epilog=epilog, |
41 formatter_class=argparse.RawDescriptionHelpFormatter) | 41 formatter_class=argparse.RawDescriptionHelpFormatter) |