Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
akahles committed Nov 18, 2019
2 parents 75dd142 + 3723e9a commit a7009fb
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# The short X.Y version
version = u'2.4'
# The full version, including alpha/beta/rc tags
release = u'2.4.1'
release = u'2.4.2'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.4.1
current_version = 2.4.2
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/ratschlab/spladder',
version='2.4.1',
version='2.4.2',
zip_safe=False,
)
2 changes: 1 addition & 1 deletion spladder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

__author__ = """Andre Kahles"""
__email__ = 'andre.kahles@inf.ethz.ch'
__version__ = '2.4.1'
__version__ = '2.4.2'
6 changes: 3 additions & 3 deletions spladder/count.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ def count_graph_coverage(genes, fn_bam=None, options=None, fn_out=None):

if options.sparse_bam and \
(fn_bam[f].endswith('npz') or \
os.path.exists(re.sub(r'bam$', '', fn_bam[f]) + 'npz') or \
os.path.exists(re.sub(r'[bB][aA][mM]|[cC][rR][aA][mM]$', '', fn_bam[f]) + 'npz') or \
fn_bam[f].endswith('hdf5') or \
os.path.exists(re.sub(r'bam$', '', fn_bam[f]) + 'hdf5')):
os.path.exists(re.sub(r'[bB][aA][mM]|[cC][rR][aA][mM]$', '', fn_bam[f]) + 'hdf5')):
### make sure that we query the right contig from cache
assert(gg.chr == contig)
(tracks, intron_list) = add_reads_from_sparse_bam(gg, fn_bam[f], contig, options.confidence, types=['exon_track','intron_list'], filter=None, cache=bam_cache)
Expand Down Expand Up @@ -290,7 +290,7 @@ def collect_single_quantification_results(fname_out, sample_idxs, options):
h5fid.create_dataset(name='edges', data=CIN['edges'][:], chunks=True, compression='gzip', maxshape=(CIN['edges'].shape[0], None))
h5fid.create_dataset(name='segments', data=CIN['segments'][:], chunks=True, compression='gzip', maxshape=(CIN['segments'].shape[0], None))
h5fid.create_dataset(name='seg_pos', data=CIN['seg_pos'][:], chunks=True, compression='gzip', maxshape=(CIN['seg_pos'].shape[0], None))
h5fid.create_dataset(name='strains', data=CIN['strains'][:], chunks=True, compression='gzip', maxshape=(None,))
h5fid.create_dataset(name='strains', data=CIN['strains'][:], dtype='|S255', chunks=True, compression='gzip', maxshape=(None,))
else:
appendToHDF5(h5fid, CIN['edges'][:], 'edges', faxis=1, daxis=1)
appendToHDF5(h5fid, CIN['segments'][:], 'segments', faxis=1, daxis=1)
Expand Down
2 changes: 1 addition & 1 deletion spladder/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def get_filename(which, options, sample_idx=None):
if which in ['fn_count_in', 'fn_count_out']:
if options.spladderfile == '-':
if options.merge == 'single':
fname = os.path.join(options.outdir, 'spladder', 'genes_graph_conf%i.%s%s.pickle' % (options.confidence, options.samples[sample_idx], prune_tag))
fname = os.path.join(options.outdir, 'spladder', 'genes_graph_conf%i.single.%s%s.pickle' % (options.confidence, options.samples[sample_idx], prune_tag))
else:
if (options.qmode == 'single' and which != 'fn_count_in') or (options.qmode == 'collect' and which == 'fn_count_in'):
fname = os.path.join(options.outdir, 'spladder', 'genes_graph_conf%i.%s.%s%s%s.pickle' % (options.confidence, options.merge, options.samples[sample_idx], prune_tag, validate_tag))
Expand Down
3 changes: 3 additions & 0 deletions spladder/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
__package__ = 'modules'

from .utils import *
from .classes.segmentgraph import Segmentgraph
from .count import count_graph_coverage_wrapper
from .editgraph import filter_by_edgecount
from . import rproc as rp
Expand Down Expand Up @@ -330,6 +331,8 @@ def merge_genes_by_splicegraph(options, merge_list=None, fn_out=None):

for g in genes:
g.label_alt()
if not g.segmentgraph.is_empty():
g.segmentgraph = Segmentgraph(g)
g.to_sparse()

### re-sort genes by position - makes quantification more efficient
Expand Down
2 changes: 1 addition & 1 deletion spladder/reads.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def add_reads_from_sparse_bam(gg, fname, contig, conf, types=None, filter=None,
if not filter is None:
IN = h5py.File(re.sub(r'[bB][aA][mM]|[cC][rR][aA][mM]$', '', fname) + 'conf_%i.' % conf + 'filt.' + 'hdf5', 'r')
else:
IN = h5py.File(re.sub(r'[bB][aA][mM]|[cC][rR][aA][mM]$', '', fname) + 'hdf5')
IN = h5py.File(re.sub(r'[bB][aA][mM]|[cC][rR][aA][mM]$', '', fname) + 'hdf5', 'r')

### re-build sparse matrix
cache['reads'] = scipy.sparse.coo_matrix((IN[contig + '_reads_dat'][:], (IN[contig + '_reads_row'][:], IN[contig + '_reads_col'][:])), shape=IN[contig + '_reads_shp'][:], dtype='uint32').tocsc()
Expand Down
2 changes: 2 additions & 0 deletions spladder/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ def parse_args(options, identity='main'):
### check existence of alignment files
for fname in flatten(options.bam_fnames):
if not os.path.isfile(fname):
if options.sparse_bam and os.path.isfile(re.sub(r'.[bB][aA][mM]$', '.hdf5', fname)):
continue
print('ERROR: Input file %s can not be found\n\n' % fname, file=sys.stderr)
sys.exit(2)
if not re.search(r'.[bB][aA][mM]$', fname) is None and not os.path.isfile(fname + '.bai'):
Expand Down

0 comments on commit a7009fb

Please sign in to comment.