Skip to content

Commit

Permalink
fix text! syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
mmkim1210 committed Jun 5, 2024
1 parent ec9cbb9 commit 426f5ff
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GeneticsMakie"
uuid = "8ca62643-82d8-47b5-a233-a06d1654fb35"
authors = ["Minsoo <[email protected]> and contributors"]
version = "0.2.1"
version = "0.2.2"

[deps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Expand Down
15 changes: 6 additions & 9 deletions src/plotgenes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ function plotgenes!(
[1 - height / 2 - (rows[j] - 1) * (0.25 + height), 1 - height / 2 - (rows[j] - 1) * (0.25 + height)],
color = genecolor, linewidth = 0.5)
g = (strand[j] == "+" ? genes[j] * "" : "" * genes[j])
text!(ax, "$g",
position = ((bs[j, 1] + bs[j, 2]) / 2, 1 - (rows[j] - 1) * (0.25 + height)),
align = (:center, :bottom), fontsize = 6, color = textcolor)
text!(ax, (bs[j, 1] + bs[j, 2]) / 2, 1 - (rows[j] - 1) * (0.25 + height),
text = "$g", align = (:center, :bottom), fontsize = 6, color = textcolor)
end
ax.spinewidth = 0.75
hidexdecorations!(ax)
Expand Down Expand Up @@ -161,18 +160,16 @@ function plotgenes!(
[1 - height / 2 - (rows[j] - 1) * (0.25 + height), 1 - height / 2 - (rows[j] - 1) * (0.25 + height)],
color = highlight[2][ind], linewidth = 0.5)
g = (strand[j] == "+" ? genes[j] * "" : "" * genes[j])
text!(ax, "$g",
position = ((bs[j, 1] + bs[j, 2]) / 2, 1 - (rows[j] - 1) * (0.25 + height)),
align = (:center, :bottom), fontsize = 6, color = highlight[2][ind])
text!(ax, (bs[j, 1] + bs[j, 2]) / 2, 1 - (rows[j] - 1) * (0.25 + height),
text = "$g", align = (:center, :bottom), fontsize = 6, color = highlight[2][ind])
else
poly!(ax, ps[j], color = "gray60", strokewidth = 0)
lines!(ax, [bs[j, 1], bs[j, 2]],
[1 - height / 2 - (rows[j] - 1) * (0.25 + height), 1 - height / 2 - (rows[j] - 1) * (0.25 + height)],
color = "gray60", linewidth = 0.5)
g = (strand[j] == "+" ? genes[j] * "" : "" * genes[j])
text!(ax, "$g",
position = ((bs[j, 1] + bs[j, 2]) / 2, 1 - (rows[j] - 1) * (0.25 + height)),
align = (:center, :bottom), fontsize = 6, color = "gray60")
text!(ax, (bs[j, 1] + bs[j, 2]) / 2, 1 - (rows[j] - 1) * (0.25 + height),
text = "$g", align = (:center, :bottom), fontsize = 6, color = "gray60")
end
end
ax.spinewidth = 0.75
Expand Down
20 changes: 8 additions & 12 deletions src/plotisoforms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,15 @@ function plotisoforms!(
lines!(ax, [bs[j, 1], bs[j, 2]],
[1 - height / 2 - (rows[j] - 1) * (0.25 + height), 1 - height / 2 - (rows[j] - 1) * (0.25 + height)],
color = isoformcolor, linewidth = 0.5)
text!(ax, "$(isoforms[j])",
position = ((bs[j, 1] + bs[j, 2]) / 2, 1 - (rows[j] - 1) * (0.25 + height)),
align = (:center, :bottom), fontsize = 6, color = textcolor)
text!(ax, (bs[j, 1] + bs[j, 2]) / 2, 1 - (rows[j] - 1) * (0.25 + height),
text = "$(isoforms[j])", align = (:center, :bottom), fontsize = 6, color = textcolor)
else
poly!(ax, ps[j], color = highlight[2][ind], strokewidth = 0)
lines!(ax, [bs[j, 1], bs[j, 2]],
[1 - height / 2 - (rows[j] - 1) * (0.25 + height), 1 - height / 2 - (rows[j] - 1) * (0.25 + height)],
color = highlight[2][ind], linewidth = 0.5)
text!(ax, "$(isoforms[j])",
position = ((bs[j, 1] + bs[j, 2]) / 2, 1 - (rows[j] - 1) * (0.25 + height)),
align = (:center, :bottom), fontsize = 6, color = textcolor)
text!(ax, (bs[j, 1] + bs[j, 2]) / 2, 1 - (rows[j] - 1) * (0.25 + height),
text = "$(isoforms[j])", align = (:center, :bottom), fontsize = 6, color = textcolor)
end
end
elseif text == :bottom || text == :b
Expand All @@ -119,17 +117,15 @@ function plotisoforms!(
lines!(ax, [bs[j, 1], bs[j, 2]],
[1 - height / 2 - (rows[j] - 1) * (0.25 + height), 1 - height / 2 - (rows[j] - 1) * (0.25 + height)],
color = isoformcolor, linewidth = 0.5)
text!(ax, "$(isoforms[j])",
position = ((bs[j, 1] + bs[j, 2]) / 2, 1 - height - (rows[j] - 1) * (0.25 + height)),
align = (:center, :top), fontsize = 6, color = textcolor)
text!(ax, (bs[j, 1] + bs[j, 2]) / 2, 1 - height - (rows[j] - 1) * (0.25 + height),
text = "$(isoforms[j])", align = (:center, :top), fontsize = 6, color = textcolor)
else
poly!(ax, ps[j], color = highlight[2][ind], strokewidth = 0)
lines!(ax, [bs[j, 1], bs[j, 2]],
[1 - height / 2 - (rows[j] - 1) * (0.25 + height), 1 - height / 2 - (rows[j] - 1) * (0.25 + height)],
color = highlight[2][ind], linewidth = 0.5)
text!(ax, "$(isoforms[j])",
position = ((bs[j, 1] + bs[j, 2]) / 2, 1 - height - (rows[j] - 1) * (0.25 + height)),
align = (:center, :top), fontsize = 6, color = textcolor)
text!(ax, (bs[j, 1] + bs[j, 2]) / 2, 1 - height - (rows[j] - 1) * (0.25 + height),
text = "$(isoforms[j])", align = (:center, :top), fontsize = 6, color = textcolor)
end
end
else
Expand Down
4 changes: 2 additions & 2 deletions src/plotlocus.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ function plotlocus!(
bp = df.BP[ind]
p = df.P[ind]
scatter!(ax, [bp], [p], color = :purple1, markersize = 4.0, marker = '')
text!(ax, "$(df.index[1])", position = (bp, p), fontsize = 6, align = (:center, :bottom))
text!(ax, bp, p, text = "$(df.index[1])", fontsize = 6, align = (:center, :bottom))
elseif length(df.index[1]) > 0
ind = findfirst(df.SNP .== df.index[1])
bp, p = df.BP[ind], df.P[ind]
scatter!(ax, [bp], [p], color = :purple1, markersize = 4.0, marker = '')
text!(ax, "$(df.index[1])", position = (bp, p), fontsize = 6, align = (:center, :bottom))
text!(ax, bp, p, text = "$(df.index[1])", fontsize = 6, align = (:center, :bottom))
end
else
scatter!(ax, df.BP, df.P, color = :gray60, markersize = 1.5)
Expand Down
2 changes: 1 addition & 1 deletion src/plotqq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function plotqq!(
band!(ax, expect, low, high, color = :gray90)
scatter!(ax, expect, obs, markersize = 2, color = :black)
lines!(ax, expect, expect, color = :red2, linewidth = 0.75)
text!(ax, "λgc = $(round(λgc, digits = 2))", position = (xmax - 0.5, 1),
text!(ax, xmax - 0.5, 1, text = "λgc = $(round(λgc, digits = 2))",
fontsize = 6, align = (:right, :bottom))
xlims!(ax, 0, xmax)
ylims!(ax, 0, ymax)
Expand Down

2 comments on commit 426f5ff

@mmkim1210
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

No significant changes. Bumped up versions of CairoMakie and Makie to 0.12 and 0.21, respectively.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/108278

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.2 -m "<description of version>" 426f5ffb65cd352b55a5dbe981d5227a0b53147a
git push origin v0.2.2

Please sign in to comment.