comparison convert_bc_to_binary_RY.py @ 50:0b9aab6aaebf draft

Uploaded 16cfcafe8b42055c5dd64e62c42b82b455027a40
author rnateam
date Tue, 26 Jan 2016 04:38:27 -0500
parents 17ef0e0dae68
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 string import maketrans
6 from sys import stdout
7 from Bio import SeqIO
8 from Bio.Seq import Seq
9 from Bio.Alphabet import IUPAC
2 10
3 tool_description = """ 11 tool_description = """
4 Convert standard nucleotides to IUPAC nucleotide codes used for binary barcodes. 12 Convert standard nucleotides to IUPAC nucleotide codes used for binary barcodes.
5 13
6 A and G are converted to nucleotide code R. T, U and C are converted to Y. By 14 A and G are converted to nucleotide code R. T, U and C are converted to Y. By
16 Copyright: 2015 24 Copyright: 2015
17 License: Apache 25 License: Apache
18 Email: maticzkd@informatik.uni-freiburg.de 26 Email: maticzkd@informatik.uni-freiburg.de
19 Status: Testing 27 Status: Testing
20 """ 28 """
21
22 import argparse
23 import logging
24 from string import maketrans
25 from sys import stdout
26 from Bio import SeqIO
27 from Bio.Seq import Seq
28 from Bio.Alphabet import IUPAC
29
30 # # avoid ugly python IOError when stdout output is piped into another program
31 # # and then truncated (such as piping to head)
32 # from signal import signal, SIGPIPE, SIG_DFL
33 # signal(SIGPIPE, SIG_DFL)
34 29
35 # parse command line arguments 30 # parse command line arguments
36 parser = argparse.ArgumentParser(description=tool_description, 31 parser = argparse.ArgumentParser(description=tool_description,
37 epilog=epilog, 32 epilog=epilog,
38 formatter_class=argparse.RawDescriptionHelpFormatter) 33 formatter_class=argparse.RawDescriptionHelpFormatter)