Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Blaise LI
libhts
Commits
2807a83a
Commit
2807a83a
authored
Oct 04, 2018
by
Blaise Li
Browse files
More explicit handling of absence of data to plot.
parent
17f3b0bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
libhts/libhts.py
View file @
2807a83a
...
...
@@ -409,7 +409,14 @@ def plot_histo(outfile, data, title=None):
plt
.
setp
(
ax
.
get_xticklabels
(),
rotation
=
90
)
if
title
is
not
None
:
plt
.
title
(
title
)
plt
.
savefig
(
outfile
)
## debug
try
:
plt
.
savefig
(
outfile
)
except
RuntimeError
as
e
:
print
(
data
.
index
)
print
(
title
)
raise
##
def
plot_boxplots
(
data
,
ylabel
):
...
...
@@ -597,6 +604,8 @@ def plot_MA(res,
"""*fold_type* is "log2FoldChange" by default.
It can also be "lfcMLE", which is based on uncorrected values.
This may not be good for genes with low expression levels."""
if
not
len
(
res
):
raise
ValueError
(
"No data to plot."
)
fig
,
ax
=
plt
.
subplots
()
# Make a column indicating whether the gene is DE or NS
data
=
res
.
assign
(
is_DE
=
res
.
apply
(
set_de_status
,
axis
=
1
))
...
...
@@ -684,6 +693,8 @@ def plot_scatter(data,
x_range
=
None
,
y_range
=
None
,
axes_style
=
None
):
if
not
len
(
data
):
raise
ValueError
(
"No data to plot."
)
fig
,
ax
=
plt
.
subplots
()
# ax.set_adjustable('box')
# First plot the data in grey
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment