示例#1
0
#!/usr/bin/env python3

import sys
import ws2016 as ws

list_of_dict_bin = []

if len(sys.argv) > 1:
    f = open(sys.argv[1], "rb")
    data = ws.pars4fasta_bytearray(list_of_dict_bin, f)

    f.close()

#print(list_of_dict_bin)

print("-------RAW")
print(ws.get_raw(list_of_dict_bin, 0).getvalue())
print("-------ID")
print(ws.get_id(list_of_dict_bin, 0))
print("-------DESCR")
print(ws.get_description(list_of_dict_bin, 0))
print("-------SEQU")
print(ws.get_sequence(list_of_dict_bin, 0).getvalue())
示例#2
0
import ws2016
import sys

file = open(sys.argv[1], 'rb')
data = ws2016.fasta_parser(file.read())

try:
    index = int(sys.argv[2])
except:
    index = 0

print('{}: {}'.format(ws2016.get_id(data, index),
                      ws2016.get_gc_content(data, index)))
示例#3
0
import ws2016
import sys

filename = open(sys.argv[1],'rb')
data = ws2016.fasta_parser(filename.read())

try:
    index = int(sys.argv[2])
except:
    index = 0

# Enter attribute function you want to use (see ws2016.py)
print('{}: {}'.format(ws2016.get_id(data,index), ws2016.get_gc_content(data,index)))