Skip to content

Commit

Permalink
updated dependencies; addressing #192
Browse files Browse the repository at this point in the history
  • Loading branch information
akahles committed Apr 3, 2024
1 parent 1993adc commit 286dcac
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 19 deletions.
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
numpy>=1.14.6
numba>=0.52.0
matplotlib>=2.2
scipy>=1.3
numpy>=1.26
numba>=0.59.0
matplotlib>=3.7
scipy>=1.13
intervaltree>=3.0.0
h5py>=2.2
pysam>=0.15.3
statsmodels>=0.9.0
pysam>=0.22.0
statsmodels>=0.14.0
14 changes: 6 additions & 8 deletions spladder/alt_splice/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def verify_intron_retention(event, gene, counts_segments, counts_edges, counts_s
### check intron confirmation as sum of valid intron scores
### intron score is the number of reads confirming this intron
# intron conf
idx = np.where(counts_edges[:, 0] == np.ravel_multi_index([seg_exon1[-1], seg_exon2[0]], segs.seg_edges.shape))[0]
idx = np.where(counts_edges[:, 0] == np.ravel_multi_index([seg_exon1[-1], seg_exon2[0]], segs.seg_edges.shape))[0].item()
info[4] = counts_edges[idx, 1]

if (info[4] >= options.intron_retention['min_non_retention_count']) or \
Expand Down Expand Up @@ -245,19 +245,19 @@ def verify_exon_skip(event, gene, counts_segments, counts_edges, options):
### check intron confirmation as sum of valid intron scores
### intron score is the number of reads confirming this intron
# exon_pre_exon_conf
idx = np.where(counts_edges[:, 0] == np.ravel_multi_index([seg_exon_pre[-1], seg_exon[0]], segs.seg_edges.shape))[0]
idx = np.where(counts_edges[:, 0] == np.ravel_multi_index([seg_exon_pre[-1], seg_exon[0]], segs.seg_edges.shape))[0].item()
info[4] = counts_edges[idx, 1]
if (info[4] >= options.exon_skip['min_non_skip_count']) or \
(options.use_anno_support and intron_pre in gene.introns_anno):
verified[1] = 1
# exon_exon_aft_conf
idx = np.where(counts_edges[:, 0] == np.ravel_multi_index([seg_exon[-1], seg_exon_aft[0]], segs.seg_edges.shape))[0]
idx = np.where(counts_edges[:, 0] == np.ravel_multi_index([seg_exon[-1], seg_exon_aft[0]], segs.seg_edges.shape))[0].item()
info[5] = counts_edges[idx, 1]
if (info[5] >= options.exon_skip['min_non_skip_count']) or \
(options.use_anno_support and intron_aft in gene.introns_anno):
verified[2] = 1
# exon_pre_exon_aft_conf
idx = np.where(counts_edges[:, 0] == np.ravel_multi_index([seg_exon_pre[-1], seg_exon_aft[0]], segs.seg_edges.shape))[0]
idx = np.where(counts_edges[:, 0] == np.ravel_multi_index([seg_exon_pre[-1], seg_exon_aft[0]], segs.seg_edges.shape))[0].item()
info[6] = counts_edges[idx, 1]
if (info[6] >= options.exon_skip['min_skip_count']) or \
(options.use_anno_support and intron_skip in gene.introns_anno):
Expand Down Expand Up @@ -353,12 +353,10 @@ def verify_alt_prime(event, gene, counts_segments, counts_edges, options):
### check intron confirmations as sum of valid intron scores
### intron score is the number of reads confirming this intron
# intron1_conf
idx = np.where(counts_edges[:, 0] == np.ravel_multi_index([segs_exon11[-1], segs_exon12[0]], segs.seg_edges.shape))[0]
assert(idx.shape[0] > 0)
idx = np.where(counts_edges[:, 0] == np.ravel_multi_index([segs_exon11[-1], segs_exon12[0]], segs.seg_edges.shape))[0].item()
info[4] = counts_edges[idx, 1]
# intron2_conf
idx = np.where(counts_edges[:, 0] == np.ravel_multi_index([segs_exon21[-1], segs_exon22[0]], segs.seg_edges.shape))[0]
assert(idx.shape[0] > 0)
idx = np.where(counts_edges[:, 0] == np.ravel_multi_index([segs_exon21[-1], segs_exon22[0]], segs.seg_edges.shape))[0].item()
info[5] = counts_edges[idx, 1]

if (min(info[4], info[5]) >= options.alt_prime['min_intron_count']) or \
Expand Down
2 changes: 1 addition & 1 deletion spladder/spladder_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.style.use('seaborn')
plt.style.use('seaborn-v0_8-whitegrid')
import matplotlib.gridspec as gridspec
import matplotlib.patches as patches
import numpy as np
Expand Down
4 changes: 2 additions & 2 deletions spladder/viz/coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def cov_from_segments(gene, seg_counts, edge_counts, edge_idx, size_factors, ax,

### draw grid
if grid:
ax.grid(b=True, which='major', linestyle='--', linewidth=0.2, color='#222222')
ax.grid(visible=True, which='major', linestyle='--', linewidth=0.2, color='#222222')
ax.xaxis.grid(False)

ax.set_ylim([0, int(seg_counts.max() * 1.1)])
Expand Down Expand Up @@ -320,7 +320,7 @@ def cov_from_bam(chrm, start, stop, files, subsample=0, verbose=False,

### draw grid
if grid:
ax.grid(b=True, which='major', linestyle='--', linewidth=0.2, color='#222222')
ax.grid(visible=True, which='major', linestyle='--', linewidth=0.2, color='#222222')
ax.xaxis.grid(False)

if marker_pos is not None:
Expand Down
2 changes: 1 addition & 1 deletion spladder/viz/genelets.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def single(exon_set, ax=None, x_range=None, count=1, color='blue', grid=False, l

### draw grid
if grid:
ax.grid(b=True, which='major', linestyle='--', linewidth=0.2, color='#222222')
ax.grid(visible=True, which='major', linestyle='--', linewidth=0.2, color='#222222')
ax.yaxis.grid(False)

min_ex = None
Expand Down
2 changes: 1 addition & 1 deletion spladder/viz/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def plot_graph(vertices, edges, ax, xlim=None, highlight=None, highlight_color='
stop = vertices.ravel().max()

### draw grid
ax.grid(b=True, which='major', linestyle='--', linewidth=0.2, color='#222222')
ax.grid(visible=True, which='major', linestyle='--', linewidth=0.2, color='#222222')
ax.yaxis.grid(False)

### nodes
Expand Down

0 comments on commit 286dcac

Please sign in to comment.