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
00f3e419
Commit
00f3e419
authored
Jun 04, 2018
by
Blaise Li
Browse files
Library function to make empty bigwig files.
parent
755568ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
libhts/__init__.py
View file @
00f3e419
from
.libhts
import
(
do_deseq2
,
gtf_2_genes_exon_lengths
,
median_ratio_to_pseudo_ref_size_factors
,
do_deseq2
,
gtf_2_genes_exon_lengths
,
make_empty_bigwig
,
median_ratio_to_pseudo_ref_size_factors
,
plot_boxplots
,
plot_counts_distribution
,
plot_histo
,
plot_lfc_distribution
,
plot_MA
,
plot_norm_correlations
,
plot_paired_scatters
,
plot_scatter
,
...
...
libhts/libhts.py
View file @
00f3e419
...
...
@@ -39,6 +39,7 @@ from rpy2.rinterface import RRuntimeError
from
rpy2.robjects.packages
import
importr
deseq2
=
importr
(
"DESeq2"
)
from
pybedtools
import
BedTool
import
pyBigWig
import
networkx
as
nx
...
...
@@ -175,6 +176,14 @@ def spikein_gtf_2_lengths(spikein_gtf):
name
=
(
"union_exon_len"
)).
rename_axis
(
"gene"
))
def
make_empty_bigwig
(
filename
,
chrom_sizes
):
bw_out
=
pyBigWig
.
open
(
filename
,
"w"
)
bw_out
.
addHeader
(
list
(
chrom_sizes
.
items
()))
for
(
chrom
,
chrom_len
)
in
bw_out
.
chroms
().
items
():
bw_out
.
addEntries
(
chrom
,
0
,
values
=
np
.
nan_to_num
(
np
.
zeros
(
chrom_len
)[
0
::
10
]),
span
=
10
,
step
=
10
)
bw_out
.
close
()
def
do_deseq2
(
cond_names
,
conditions
,
counts_data
,
formula
=
None
,
contrast
=
None
,
deseq2_args
=
None
):
"""Runs a DESeq2 differential expression analysis."""
...
...
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