Skip to content

Commit

Permalink
Merge pull request #691 from padix-key/examples
Browse files Browse the repository at this point in the history
Refactor some examples
  • Loading branch information
padix-key authored Nov 4, 2024
2 parents 1659cb2 + b7c0643 commit 10f7977
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
13 changes: 3 additions & 10 deletions doc/examples/scripts/sequence/annotation/plasmid_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
import biotite.sequence.io.genbank as gb

PLASMID_URL = (
"https://media.addgene.org/snapgene-media/v1.7.9-0-g88a3305/"
"sequences/12250/9998fdbe-051f-4dc6-ba0f-24e65127a0c5/"
"addgene-plasmid-26092-sequence-12250.gbk"
"https://media.addgene.org/snapgene-media/v2.0.0/sequences/12250/"
"9998fdbe-051f-4dc6-ba0f-24e65127a0c5/addgene-plasmid-26092-sequence-12250.gbk"
)


Expand All @@ -46,12 +45,6 @@
],
)
_, seq_length, _, _, _, _ = gb.get_locus(gb_file)
# AddGene stores the plasmid name in the 'KEYWORDS' field
# [0][0][0] ->
# The first (and only) 'KEYWORDS' field
# The first entry in the tuple
# The first (and only) line in the field
plasmid_name = gb_file.get_fields("KEYWORDS")[0][0][0]


def custom_feature_formatter(feature):
Expand Down Expand Up @@ -79,7 +72,7 @@ def custom_feature_formatter(feature):
ax,
annotation,
plasmid_size=seq_length,
label=plasmid_name,
label="pET15-MHL",
feature_formatter=custom_feature_formatter,
)
fig.tight_layout()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def draw_arrow(ax, feature, loc):
annotation = gb.get_annotation(gb_file, include_only=["CDS", "rRNA", "tRNA"])

n_rows = int(np.ceil(len(unique_alignments) / N_COL))
fig, axes = plt.subplots(n_rows, N_COL, figsize=(8.0, 24.0), constrained_layout=True)
fig, axes = plt.subplots(n_rows, N_COL, figsize=(8.0, 1.5 * n_rows))

for (alignment, log_evalue), ax in zip(unique_alignments, axes.flatten()):
# Transform 0-based sequence index to 1-based sequence position
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies:
- sphinxcontrib-bibtex >=2.3
- sphinx-copybutton >=0.5
- sphinx-design >=0.5
- sphinx-gallery =0.15.0
- sphinx-gallery =0.18.0
- sphinx-notfound-page >=1.0
# Extra packages used in example gallery
- pandas >=1.5.2
Expand Down

0 comments on commit 10f7977

Please sign in to comment.