Skip to content

Commit

Permalink
fix transcript_id and transcript_name issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ygidtu committed Feb 5, 2025
1 parent 936eee9 commit f871fa8
Show file tree
Hide file tree
Showing 9 changed files with 567 additions and 271 deletions.
2 changes: 1 addition & 1 deletion AppImageBuilder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ AppDir:
app_info:
id: org.appimage-crafters.trackplot
name: trackplot
version: 0.5.1
version: 0.5.2
# Set the python executable as entry point
exec: "bin/python3"
# Set the application main script path as argument. Use '$@' to forward CLI parameters
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "trackplot"
version = "0.5.1"
version = "0.5.2"
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/"
authors = ["ygidtu <[email protected]>"]
license = "BSD-3"
Expand All @@ -23,9 +23,9 @@ hicmatrix = "^17"
loguru = "^0.6.0"
matplotlib = "^3.6.3"
numpy = "^1.24.1"
pandas = { version = "^1.5.3", allow-prereleases = true }
pandas = "^1.5.3"
pybigwig = "^0.3.18"
pysam = { version = "^0.21.0", allow-prereleases = true }
pysam = "^0.21.0"
requests = "^2.28.2"
scipy = "^1.10.0"
seaborn = "^0.12.2"
Expand Down
2 changes: 1 addition & 1 deletion trackplot/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import os
import sys
from multiprocessing import cpu_count
from typing import Optional, Dict, Set, Tuple
from typing import Optional

import click
from click_option_group import optgroup
Expand Down
3 changes: 1 addition & 2 deletions trackplot/file/Bam.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ def load(self,
spanned_junctions = kwargs.get("junctions", {})
included_junctions = kwargs.get("included_junctions", {})
remove_duplicate_umi = kwargs.get("remove_duplicate_umi", False)
spanned_junctions_plus = dict()
spanned_junctions_minus = dict()
spanned_junctions_plus, spanned_junctions_minus = {}, {}
plus, minus = np.zeros(len(region), dtype=np.int32), np.zeros(len(region), dtype=np.int32)
site_plus, site_minus = np.zeros(len(region), dtype=np.int32), np.zeros(len(region), dtype=np.int32)

Expand Down
2 changes: 1 addition & 1 deletion trackplot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
faulthandler.enable()


__version__ = "0.5.1"
__version__ = "0.5.2"
__author__ = "ygidtu & Ran Zhou"
__email__ = "[email protected]"

Expand Down
14 changes: 11 additions & 3 deletions trackplot/plot_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,13 @@ def plot_annotation(
for transcript in data:
strand = transcript.strand
# @2018.12.20 add transcript id, based on fixed coordinates
if transcript.transcript:
# @2025.02.04 add warnings for transcript name and id check
if transcript.transcript or transcript.transcript_id:
show_text = transcript.transcript
if not transcript.transcript:
logger.warning(f"there is not transcript_name, using transcript_id instead")
show_text = transcript.transcript_id

if show_gene and transcript.gene and transcript.gene_id != transcript.transcript_id:
if show_id:
ax.text(x=-.01 * max(graph_coords), y=y_loc + 0.25,
Expand All @@ -445,9 +451,11 @@ def plot_annotation(
s=transcript.transcript_id, fontsize=font_size, ha="right")
else:
ax.text(x=-.01 * max(graph_coords), y=y_loc,
s=transcript.gene + " | " + transcript.transcript, fontsize=font_size, ha="right")
s=transcript.gene + " | " + show_text, fontsize=font_size, ha="right")
else:
ax.text(x=-1, y=y_loc - 0.1, s=transcript.transcript, fontsize=font_size, ha="right")
ax.text(x=-1, y=y_loc - 0.1, s=show_text, fontsize=font_size, ha="right")
else:
logger.warning(f"there is no transcript_name and transcript_id")

# @2018.12.19
# s and e is the start and end site of single exon
Expand Down
6 changes: 3 additions & 3 deletions web/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "trackplot",
"private": true,
"version": "0.5.1",
"version": "0.5.2",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -22,9 +22,9 @@
"vue-router": "^4.5.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^3.2.0",
"@vitejs/plugin-vue": "^5.2.1",
"unplugin-auto-import": "^0.11.5",
"unplugin-vue-components": "^0.22.12",
"vite": "^3.2.11"
"vite": "^6.0.11"
}
}
Loading

0 comments on commit f871fa8

Please sign in to comment.