Skip to content

Commit

Permalink
bugfix to exon plotting python3
Browse files Browse the repository at this point in the history
  • Loading branch information
jluebeck committed Jan 30, 2024
1 parent a791518 commit a13b3ba
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions CycleViz.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
segment_bar_height = -8.0 / 3
gene_to_locations = defaultdict(list)
overlap_genes = []
all_relGenes = []
# all_relGenes = []


# get the start and end angle from the linear start and end
Expand Down Expand Up @@ -599,7 +599,6 @@ def plot_gene_bars(currStart, currEnd, relGenes, pTup, total_length, seg_dir, in
# e_posns is a list of tuples of exon (start,end)
# these can be plotted similarly to how the coding region is marked
gname, gstart, gend, e_posns = gObj.gname, gObj.gstart, gObj.gend, gObj.eposns
# print(gname, gstart, gend, pTup, len(gObj.gdrops))
seg_len = pTup[2] - pTup[1]
hasStart = False
hasEnd = False
Expand Down Expand Up @@ -704,7 +703,7 @@ def plot_genes(ref_placements, cycle, isCycle, onco_set=None):
for ind, refObj in ref_placements.items():
seg_coord_tup = (refObj.chrom, refObj.ref_start, refObj.ref_end)
relGenes = vu.rel_genes(gene_tree, seg_coord_tup, copy.copy(onco_set))
all_relGenes.extend(relGenes)
# all_relGenes.extend(relGenes)
# plot the gene track
# print(ind, refObj.to_string(), len(relGenes))
flanked = refObj.next_is_adjacent or refObj.prev_is_adjacent
Expand Down Expand Up @@ -1137,9 +1136,11 @@ def construct_cycle_ref_placements(cycle, segSeqD, raw_cycle_length, prev_seg_in
ref_choices = ["hg19", "hg38", "GRCh37", "GRCh38", "mm10", "GRCh38_viral"]
if not args.ref:
print("--ref is required")
sys.exit(1)

elif args.ref not in ref_choices:
print("--ref must be one of " + str(ref_choices))
sys.exit(1)


if args.ref == "GRCh38" or args.ref == "GRCh38_viral":
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CycleViz

Latest version: **0.1.8**.
Latest version: **0.1.10**.

Visualize outputs of [AmpliconArchitect](https://github.com/AmpliconSuite/AmpliconArchitect/) &
[AmpliconReconstructor](https://github.com/jluebeck/AmpliconReconstructor) (AR) in Circos-style images.
Expand Down
4 changes: 2 additions & 2 deletions VizUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def __init__(self, gchrom, gstart, gend, gdata, highlight_name):
self.highlight_name = highlight_name
estarts = [int(x) for x in gdata[9].rsplit(",") if x]
eends = [int(x) for x in gdata[10].rsplit(",") if x]
self.eposns = zip(estarts, eends)
self.eposns = list(zip(estarts, eends))
self.gdrops = []
self.gdrops_go_to_link = set()

Expand Down Expand Up @@ -430,7 +430,7 @@ def rel_genes(chrIntTree, pTup, gene_set=None):
oldTStart = currGenes[gname].gstart
oldTEnd = currGenes[gname].gend
if gObj.gend - gObj.gstart > oldTEnd - oldTStart:
currGenes[gname] = copy.copy(gObj)
currGenes[gname] = copy.deepcopy(gObj)

else:
if gObj.gstart < oldTStart:
Expand Down
2 changes: 1 addition & 1 deletion _version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.9"
__version__ = "0.1.10"

0 comments on commit a13b3ba

Please sign in to comment.