Skip to content

Commit e1b2f28

Browse files
committed
fixed minor break in same_yaxis_scales from last commit
1 parent c9f2075 commit e1b2f28

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

samplot/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/usr/bin/env python
2-
__version__ = "1.1.3"
2+
__version__ = "1.1.4"

samplot/samplot.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ def plot_coverage(
277277
max_coverage,
278278
tracktype,
279279
yaxis_label_fontsize,
280-
same_yaxis_labels,
281280
max_coverage_points,
282281
):
283282
"""Plots high and low quality coverage for the region
@@ -314,8 +313,8 @@ def plot_coverage(
314313
cover_y_highqual = np.array(cover_y_highqual)
315314
cover_y_all = np.array(cover_y_all)
316315

317-
if max_coverage > 0:# and same_yaxis_labels:
318-
max_plot_depth = max_coverage#+5
316+
if max_coverage > 0:
317+
max_plot_depth = max_coverage
319318
elif cover_y_all.max() > 3 * cover_y_all.mean():
320319
max_plot_depth = max(
321320
np.percentile(cover_y_all, 99.5), np.percentile(cover_y_all, 99.5)
@@ -2758,7 +2757,8 @@ def get_read_data(
27582757
read_data["all_pairs"] = downsample_pairs(
27592758
max_depth, z_score, read_data["all_pairs"]
27602759
)
2761-
2760+
if not same_yaxis_scales:
2761+
max_coverage = 0
27622762
return read_data, max_coverage
27632763

27642764

@@ -2871,7 +2871,6 @@ def plot_samples(
28712871
max_coverage,
28722872
coverage_tracktype,
28732873
yaxis_label_fontsize,
2874-
same_yaxis_scales,
28752874
max_coverage_points,
28762875
)
28772876

@@ -3593,6 +3592,8 @@ def plot(parser):
35933592
options.start_ci,
35943593
options.end_ci,
35953594
)
3595+
if options.max_coverage:
3596+
max_coverage = options.max_coverage
35963597

35973598
# Plot each sample
35983599
current_axis_idx = plot_samples(
@@ -3611,7 +3612,7 @@ def plot(parser):
36113612
options.annotation_files,
36123613
options.transcript_file,
36133614
options.max_coverage_points,
3614-
min(max_coverage,options.max_coverage),
3615+
max_coverage,
36153616
marker_size,
36163617
options.coverage_only,
36173618
)

test/func/samplot_test.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ sv_chrm=chr4
1515
sv_start=115928730
1616
sv_end=115931875
1717
sv_type=DEL
18-
out_file_name=$func_path"test.png"
18+
out_file_name=$func_path"test_del.png"
1919

2020
rm -f $out_file_name
2121
run basic_operation \
@@ -74,11 +74,16 @@ if [ $coverage_only ]; then
7474
fi
7575

7676
out_file_name=$func_path"test_same_yaxis.png"
77+
78+
sv_chrm=chrX
79+
sv_start=101055330
80+
sv_end=101067156
81+
sv_type=DUP
7782
rm -f $out_file_name
7883
run same_yaxis \
7984
samplot plot \
8085
-c $sv_chrm -s $sv_start -e $sv_end \
81-
-b $bam_1 \
86+
-b $bam_1 $bam_2 $bam_3\
8287
-o $out_file_name \
8388
-t $sv_type \
8489
--same_yaxis_scales
@@ -89,6 +94,10 @@ if [ $basic_operation ]; then
8994
assert_no_stderr
9095
fi
9196

97+
sv_chrm=chr4
98+
sv_start=115928730
99+
sv_end=115931875
100+
sv_type=DEL
92101
out_file_name=$func_path"test_zoom.png"
93102
rm -f $out_file_name
94103
run basic_operation_zoom \

0 commit comments

Comments
 (0)