-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
from snapgene_reader import snapgene_file_to_dict, snapgene_file_to_seqrecord
from Bio.Seq import Seq
file_path = "/cluster/facility/hlhuang/zifeng001/snapgene/LMB.dna"
dictionary = snapgene_file_to_dict(file_path)
seqrecord = snapgene_file_to_seqrecord(file_path)
for i, value in dictionary.items():
# print(value)
if isinstance(value, list):
# print(value)
for anno in value:
# print(anno)
if anno["name"] == "sgRNA":
# print(anno["name"])
start = anno["start"]
end = anno["end"]
dictionary["seq"] = dictionary["seq"].replace(
dictionary["seq"][start:end], new_sgRNA_sequence
)
I used this code to find and replace the sequence. Then I want to regenerate the snapgene file. What should I do?
Metadata
Metadata
Assignees
Labels
No labels