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
06c17d33
Commit
06c17d33
authored
Dec 14, 2017
by
Blaise Li
Browse files
Code cleaning and documenting.
parent
ed111f22
Changes
1
Hide whitespace changes
Inline
Side-by-side
libhts/libhts.py
View file @
06c17d33
...
...
@@ -264,32 +264,32 @@ def plot_norm_correlations(correlations):
#correlations.plot.kde(ax=ax1)
#sns.violinplot(data=correlations, orient="h", ax=ax2)
#ax2.set_xlabel("Pearson correlation coefficient")
ax
=
sns
.
violinplot
(
data
=
correlations
,
cut
=
0
)
ax
.
set_ylabel
(
"Pearson correlation coefficient"
)
ax
is
=
sns
.
violinplot
(
data
=
correlations
,
cut
=
0
)
ax
is
.
set_ylabel
(
"Pearson correlation coefficient"
)
def
plot_counts_distribution
(
data
,
xlabel
):
# TODO: try to plot with semilog x axis
#ax = data.plot.kde(legend=None)
#ax.set_xlabel(xlabel)
#ax.legend(ncol=len(REPS))
#ax
is
= data.plot.kde(legend=None)
#ax
is
.set_xlabel(xlabel)
#ax
is
.legend(ncol=len(REPS))
try
:
ax
=
data
.
plot
.
kde
()
ax
is
=
data
.
plot
.
kde
()
except
ValueError
as
e
:
msg
=
""
.
join
([
"There seems to be a problem with the data.
\n
"
,
"The data matrix has %d lines and %d columns.
\n
"
%
(
len
(
data
),
len
(
data
.
columns
))])
warnings
.
warn
(
msg
)
raise
ax
.
set_xlabel
(
xlabel
)
ax
is
.
set_xlabel
(
xlabel
)
def
plot_boxplots
(
data
,
ylabel
):
fig
=
plt
.
figure
(
figsize
=
(
6
,
12
))
ax
=
fig
.
add_subplot
(
111
)
data
.
plot
.
box
(
ax
=
ax
)
ax
.
set_ylabel
(
ylabel
)
for
label
in
ax
.
get_xticklabels
():
ax
is
=
fig
.
add_subplot
(
111
)
data
.
plot
.
box
(
ax
=
ax
is
)
ax
is
.
set_ylabel
(
ylabel
)
for
label
in
ax
is
.
get_xticklabels
():
label
.
set_rotation
(
90
)
plt
.
tight_layout
()
...
...
@@ -352,9 +352,9 @@ def plot_lfc_distribution(res, contrast, fold_type=None):
fold_type
=
"log2FoldChange"
lfc
=
getattr
(
res
,
fold_type
).
dropna
()
lfc
.
name
=
contrast
ax
=
sns
.
kdeplot
(
lfc
)
ax
.
set_xlabel
(
fold_type
)
ax
.
set_ylabel
(
"frequency"
)
ax
is
=
sns
.
kdeplot
(
lfc
)
ax
is
.
set_xlabel
(
fold_type
)
ax
is
.
set_ylabel
(
"frequency"
)
def
make_status2colour
(
down_statuses
,
up_statuses
):
...
...
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