Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respond to #24 #31

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ version = "0.1.0"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Compose = "a81c6b42-2e10-5240-aca2-a61377ecd94b"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
FASTX = "c2308a5c-f048-11e8-3e8a-31650f418d12"
Expand All @@ -14,6 +13,7 @@ Measures = "442fdcdd-2543-5da2-b0f3-8c86c306513e"
MolecularEvolution = "9f975960-e239-4209-8aa0-3d3ad5a82892"
NLopt = "76087f3c-5699-56af-9a33-bf431cd00edd"
ParameterHandling = "2412ca09-6db7-441c-8e3a-88d5709968c5"
Phylo = "aea672f4-3940-5932-aa44-993d1c3ff149"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"

Expand Down
2 changes: 1 addition & 1 deletion src/CodonMolecularEvolution.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module CodonMolecularEvolution

using FASTX, MolecularEvolution, Measures, Compose, Plots, StatsBase, Distributions, DataFrames, CSV, NLopt, ParameterHandling, LinearAlgebra
using FASTX, MolecularEvolution, Measures, Plots, StatsBase, Distributions, DataFrames, CSV, NLopt, ParameterHandling, LinearAlgebra, Phylo

abstract type difFUBARGrid end

Expand Down
19 changes: 11 additions & 8 deletions src/difFUBAR/difFUBAR.jl
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,17 @@ function difFUBAR_init(outpath_and_file_prefix, treestring, tags; tag_colors=DIF
push!(tag_colors, "black") #ASSUMPTION: background color is always black

if exports
#Replace with Phylo.jl based plot?
color_dict = Dict(zip(getnodelist(tree), [tag_colors[model_ind(n.name, tags)] for n in getnodelist(tree)]))
label_dict = Dict(zip(getnodelist(tree), [strip_tags_from_name(n.name) for n in getnodelist(tree)]))
img = tree_draw(tree, canvas_height=(3 + length(getleaflist(tree)) / 5)cm,
draw_labels=true, dot_color_dict=color_dict,
line_color_dict=color_dict, line_width=0.3, min_dot_size=0.01,
nodelabel_dict=label_dict)
img |> SVG(analysis_name * "_tagged_input_tree.svg", 15cm, (3 + length(getleaflist(tree)) / 5)cm)
#TODO: update plots in docs
phylo_tree = get_phylo_tree(tree)
tagging = [tag_colors[model_ind(n, tags)] for n in nodenameiter(phylo_tree)]
for node in nodeiter(phylo_tree)
renamenode!(phylo_tree, node, strip_tags_from_name(node.name))
end
#Warnings regarding marker- and linecolor also appear in the Phylo.jl docs example
#Note: sometimes long leafnames are truncated/not visible in the plot
pl = plot(phylo_tree,
showtips = true, tipfont = 6, markercolor = tagging, linecolor = tagging, markerstrokewidth = 0, size = (600, (120 + length(getleaflist(tree)) * 8)))
savefig_tweakSVG(analysis_name * "_tagged_input_tree.svg", pl)
end

#Tags and tag colors are now ordered, and tag_colors includes the untagged category
Expand Down
Loading