Commit 00f3e419 authored by Blaise Li's avatar Blaise Li
Browse files

Library function to make empty bigwig files.

parent 755568ef
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,
......
......@@ -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."""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment