Skip to content

Commit

Permalink
Add --with_sequence_edits option to script
Browse files Browse the repository at this point in the history
The optionannotates the Genbank file with edits.
  • Loading branch information
veghp committed Sep 7, 2021
1 parent df1145c commit 610ce59
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions scripts/dnachisel
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@
DNA Chisel Command Line Interface
Usage:
dnachisel <source> <target> [--circular] [--mute]
dnachisel <source> <target> [--circular] [--mute] [--with_sequence_edits]
Where ``source`` is a fasta or Genbank file, and target can be one of:
- A folder name or a zip name (extension .zip). In this case a complete report
along with the sequence will be generated.
- A Genbank file. In this case, only the optimized sequence file is created.
The with_sequence_edits option specifies that edits are also annotated in the
Genbank file. Note that the filename must end with '.gb'.
Note: this CLI will be developed on a per-request basis, so don't hesitate to
ask for more handles and options on Github
(https://github.com/Edinburgh-Genome-Foundry/DnaChisel/issues)
Example to output the result to a genbank (filename must end with '.gb'):
Example to output the result to a genbank:
>>> dnachisel annotated_record.gb optimized_record.gb
Expand Down Expand Up @@ -57,11 +60,15 @@ if __name__ == "__main__":
)

if target.lower().endswith(".gb"): # save genbank
if params["--with_sequence_edits"]:
annotate_edits=True
else:
annotate_edits=False
verbose_print("Resolving Constraints...")
problem.resolve_constraints()
verbose_print("Optimizing...")
problem.optimize()
problem.to_record(filepath=target, with_sequence_edits=True)
problem.to_record(filepath=target, with_sequence_edits=annotate_edits)

else: # save into zip or folder
project_name = os.path.basename(source)
Expand Down

0 comments on commit 610ce59

Please sign in to comment.