def test(): rule = "RFC25" content = component_union.union(rule, sys.argv[1:]) # path = 'F:/igemgit/project/Python27/web/test/BBa_E1010.xml' # content = component_union.union(rule, path) dna_sequence = component_union.connect(rule, content) sbol = component_union.formatter_v11(content, dna_sequence) print sbol print sequence_serializer.format_to_json(sbol)
def get_new_part_sequence(component, rule = "RFC10"): content = [] for i in range(len(component)): info = {} if component[i][0:3] == "BBa": xml_file = find_file(component[i] + ".xml", '.') t = ET.parse(xml_file) path = "part_list/part/" dna_sequence = t.find(path+"sequences/seq_data").text[1:-1] info["sequences"] = filter(lambda x: x != '\n', dna_sequence) info["dna"] = {"type": t.find(path+"part_type").text} else: info["sequences"] = component[i] info["dna"] = {"type": "Sequence"} content.append(info) dna_sequence = component_union.connect(rule, content) return dna_sequence