Skip to content

Commit

Permalink
v0.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
zhpn1024 committed Aug 12, 2019
1 parent ef3bbab commit cf507ae
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 8 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2019-8-12 ribotish 0.2.3

Fix problem reading NCBI gff files.

Python3 compatibility.

Add support for transcript annotation starting at CDS start (no 5'UTR) in quality module.

Fix chrmap problem in genome fa file.

2019-4-2 ribotish 0.2.2

Python3 compatibility. Ribo-TISH can run in python 3.7.2 now.
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
README for Ribo-TISH (0.2.2)
README for Ribo-TISH (0.2.3)
==================================
<2019-4-2 Peng Zhang>
<2019-8-12 Peng Zhang>

Introduction
============
Expand Down
2 changes: 1 addition & 1 deletion bin/ribotish
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file COPYING included with
the distribution).
@status: Alpha
@version: 0.2.2
@version: 0.2.3
@author: Peng Zhang
@contact: [email protected]
"""
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/python
#Last-modified: 15 Jan 2018
#Last-modified: 12 Aug 2019

# Module/Scripts Description
#
Expand All @@ -10,7 +10,7 @@
# the distribution).
#
# @status: Alpha
# @version: 0.2.2
# @version: 0.2.3
# @author: Peng Zhang
# @contact: [email protected]

Expand Down
2 changes: 1 addition & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__all__=["run"]
__version__ = '0.2.2'
__version__ = '0.2.3'
20 changes: 20 additions & 0 deletions src/zbio/bam.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,26 @@ def is_m0(self):
if self.read2.get_tag('MD')[-1] == '0' :
if not self.read2.get_tag('MD')[-2].isdigit() : return True
return False
def mismatches(self):
import re
mm = {}
md = self.read.get_tag('MD')
ns = re.split('[ATGC^]+', md)
ms = re.split('\d+', md)
l = self.cdna_length()
p = 0
for i, n in enumerate(ns):
n = int(n)
if ms[i] != '':
q = p
p += len(ms[i])
if ms[i].startswith('^'): p -= 1
if self.is_reverse(): q = l - p
mm[q] = ms[i]
p += n
return mm


def compatible_bam_iter(bamfile, trans, mis = 0, sense = True, maxNH = None, minMapQ = None, secondary = False, flank = 0):
'''compatible version of transReadsIter, slightly different
'''
Expand Down
11 changes: 9 additions & 2 deletions src/zbio/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def riboShow(ax, trans, cnts, start = 0, stop = -1, ymax = None, scale = 1, col
for i in range(3):
ax.bar(fx[i], fy[i], color=col[i], bottom = ymax * bottom,width=fw[i], alpha=0.2, linewidth = 0, align='edge')

def orfShow(ax, orfs, start = 0, stop = -1, col = ['r','g','b'], cds = [None, None], title = 'Potential ORFs in 3 reading frames', alt = True, morecds = None, morecdsbox = False, morecdslabel = None):
def orfShow(ax, orfs, start = 0, stop = -1, col = ['r','g','b'], cds = [None, None], title = 'Potential ORFs in 3 reading frames', alt = True, morecds = None, morecdsbox = False, morecdslabel = None, markpept = None):
'''plot possible ORFs
'''
if stop < start : stop = trans.cdna_length()
Expand Down Expand Up @@ -150,7 +150,14 @@ def orfShow(ax, orfs, start = 0, stop = -1, col = ['r','g','b'], cds = [None, No
ax.bar(newcds[0], [0.4] ,color='None', bottom=2-i+0.3, width=newcds[1]-newcds[0], alpha=0.8, fill=False, edgecolor=col[i], linewidth=2, align='edge')
if morecdslabel is not None:
ax.text(max(newcds[0],0), 2-i+0.8, morecdslabel[j], color=col[i])

if markpept is not None:
for j, mc in enumerate(markpept):
if mc[0]>stop or mc[1]< start: continue
i = mc[0] % 3
newcds = [c - start for c in mc]
if newcds[0] < 0: newcds[0] = 0
if mc[1] > stop: newcds[1] = rlen
ax.bar(newcds[0], [0.2], color='k', bottom=2-i+0.4, width=newcds[1]-newcds[0], alpha=0.8, linewidth=0, align='edge')
# start & stop codons
lx = [[],[],[]]
ly = [[],[],[]]
Expand Down

0 comments on commit cf507ae

Please sign in to comment.