Python: How to encode DNA sequence using binary values?
问题 I would like to convert a file that contained few DNA sequences into binary values which is as follow: A=1000 C=0100 G=0010 T=0001 FileA.txt CCGAT GCTTA Desired output 01000100001010000001 00100100000100011000 I have tried using this code to solve my problem but the bin output file seem failed to output my desired answer. Can anyone help me? Code import sys if len(sys.argv) != 2 : sys.stderr.write('Usage: {} <nucleotide file>\n'.format(sys.argv[0])) sys.exit() # assumes the file only contains