Skip to content

Commit

Permalink
Use correct parameter name
Browse files Browse the repository at this point in the history
  • Loading branch information
nvictus committed Mar 29, 2018
1 parent e060d0c commit 91456d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions cooler/_binning.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,11 @@ def __init__(self, filepath, chromsizes, bins, map=map, n_chunks=1, is_one_based
n_lines = f.get_linecount()
max_chunk = int(100e6)
n_chunks = n_lines // 2 // max_chunk
old_n = self.n_chunks
self.n_chunks = max(self.n_chunks, n_chunks)
logger.info("Pairs file has {} lines. Increasing max-split to {}.".format(
n_lines, self.n_chunks))
if self.n_chunks > old_n:
logger.info("Pairs file has {} lines. Increasing max-split to {}.".format(
n_lines, self.n_chunks))

# all requested contigs will be placed in the output matrix
self.gs = GenomeSegmentation(chromsizes, bins)
Expand Down
6 changes: 4 additions & 2 deletions cooler/cli/cload.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ def tabix(bins, pairs_path, cool_path, metadata, assembly, nproc, zero_based, ma
opts['C2'] = kwargs['chrom2'] - 1
if 'pos2' in kwargs:
opts['P2'] = kwargs['pos2'] - 1
iterator = TabixAggregator(pairs_path, chromsizes, bins, map=map, zero_based=zero_based, n_chunks=max_split, **opts)
iterator = TabixAggregator(pairs_path, chromsizes, bins, map=map,
is_one_based=(not zero_based), n_chunks=max_split, **opts)
create(cool_path, bins, iterator, metadata, assembly)
finally:
if nproc > 1:
Expand Down Expand Up @@ -257,7 +258,8 @@ def pairix(bins, pairs_path, cool_path, metadata, assembly, nproc, zero_based, m
map = pool.imap
else:
map = six.moves.map
iterator = PairixAggregator(pairs_path, chromsizes, bins, map=map, zero_based=zero_based, n_chunks=max_split)
iterator = PairixAggregator(pairs_path, chromsizes, bins, map=map,
is_one_based=(not zero_based), n_chunks=max_split)
create(cool_path, bins, iterator, metadata, assembly)
finally:
if nproc > 1:
Expand Down

0 comments on commit 91456d7

Please sign in to comment.