Skip to content

Commit 2bce53e

Browse files
committed
update v0.5.7, fix sorting issue while check where junctions should be included
1 parent f01d1da commit 2bce53e

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "trackplot"
3-
version = "0.5.6"
3+
version = "0.5.7"
44
description = "The trackplot is a tool for visualizing various next-generation sequencing (NGS) data, including DNA-seq, RNA-seq, single-cell RNA-seq and full-length sequencing datasets. https://sashimi.readthedocs.io/"
55
authors = [
66
{ name = "ygidtu", email = "ygidtu@gmail.com" }

trackplot/file/Bam.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ def check_junction_exists(ref: List[Junction], dst: Junction, with_strand: bool
2727
u"""
2828
判断junction是否存在于included_junctions
2929
"""
30-
31-
ref = sorted([Junction.create_junction(x) for x in ref])
32-
30+
ref = sorted([Junction.create_junction(x) for x in ref], key=lambda x: (x.chromosome, x.start, x.end))
3331
for i in ref:
34-
if abs(i.start - dst.start) < 2 and abs(i.end - dst.end) < 2:
35-
if not with_strand:
36-
# in outer code, this function will called twice, with with_strand = True and False. therefore, only print log once is enough
37-
logger.warning(f"1 bp mismatch between {i} (from bam file) and {dst} (user input), please check the coordinates")
38-
3932
if i.is_downstream(dst):
4033
return False
4134
if i.eq(dst, with_strand):
4235
return True
43-
36+
elif abs(i.start - dst.start) < 2 and abs(i.end - dst.end) < 2:
37+
if (not with_strand) or (with_strand and i.strand == dst.strand):
38+
# in outer code, this function will twice,
39+
# with with_strand = True and False. therefore, only print log once is enough
40+
logger.warning(
41+
f"1 bp mismatch between {i} (from bam file) and {dst} (user input), please check the coordinates"
42+
)
43+
4444
return False
4545

4646

@@ -310,10 +310,11 @@ def load(self,
310310
logger.debug(f"{str(k)} is included")
311311
else:
312312
kept = check_junction_exists(included_junctions, k, with_strand=False)
313-
logger.debug(f"{str(k)} is included, but strand is ignored")
314313

315314
if not kept:
316315
logger.debug(f"{str(k)} is not included")
316+
else:
317+
logger.debug(f"{str(k)} is included, but strand is ignored")
317318

318319
if kept:
319320
if k.strand == "+":

trackplot/plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
faulthandler.enable()
3131

3232

33-
__version__ = "0.5.6"
33+
__version__ = "0.5.7"
3434
__author__ = "Yiming Zhang & Ran Zhou"
3535
__email__ = "ygidtu@gmail.com"
3636

trackplot/plot_func.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,6 @@ def plot_density(
799799
-right_dens - current_height,
800800
-right_dens if not ss2_modified else -right_dens - current_height
801801
]
802-
803802
"""
804803
@2018.12.26
805804
scale the junctions line width

web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "trackplot",
33
"private": true,
4-
"version": "0.5.5",
4+
"version": "0.5.7",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

0 commit comments

Comments
 (0)