Mercurial > repos > rnateam > bctools
comparison remove_tail.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 Bio.SeqIO.QualityIO import FastqGeneralIterator | |
| 7 # avoid ugly python IOError when stdout output is piped into another program | |
| 8 # and then truncated (such as piping to head) | |
| 9 from signal import signal, SIGPIPE, SIG_DFL | |
| 10 signal(SIGPIPE, SIG_DFL) | |
| 2 | 11 |
| 3 tool_description = """ | 12 tool_description = """ |
| 4 Remove a certain number of nucleotides from the 3'-tails of sequences in fastq | 13 Remove a certain number of nucleotides from the 3'-tails of sequences in fastq |
| 5 format. | 14 format. |
| 6 | 15 |
| 15 Copyright: 2015 | 24 Copyright: 2015 |
| 16 License: Apache | 25 License: Apache |
| 17 Email: maticzkd@informatik.uni-freiburg.de | 26 Email: maticzkd@informatik.uni-freiburg.de |
| 18 Status: Testing | 27 Status: Testing |
| 19 """ | 28 """ |
| 20 | |
| 21 import argparse | |
| 22 import logging | |
| 23 from sys import stdout | |
| 24 from Bio.SeqIO.QualityIO import FastqGeneralIterator | |
| 25 | |
| 26 # avoid ugly python IOError when stdout output is piped into another program | |
| 27 # and then truncated (such as piping to head) | |
| 28 from signal import signal, SIGPIPE, SIG_DFL | |
| 29 signal(SIGPIPE, SIG_DFL) | |
| 30 | 29 |
| 31 # parse command line arguments | 30 # parse command line arguments |
| 32 parser = argparse.ArgumentParser(description=tool_description, | 31 parser = argparse.ArgumentParser(description=tool_description, |
| 33 epilog=epilog, | 32 epilog=epilog, |
| 34 formatter_class=argparse.RawDescriptionHelpFormatter) | 33 formatter_class=argparse.RawDescriptionHelpFormatter) |
