Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions maxatac/analyses/average.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def run_averaging(args):
4) Loop through each entry in the chromosome sizes dictionary and calculate the average across all inputs
5) Write the bigwig file

:param args: bigwig_files, output_dir, name, chromosomes, chromosome_sizes
:param args: bigwig_files, output_dir, name, chromosomes, chromosome_sizes, max_zooms

:return: A bigwig file
"""
Expand Down Expand Up @@ -60,7 +60,7 @@ def run_averaging(args):
header = [(x, chromosome_sizes_dictionary[x]) for x in sorted(args.chromosomes)]

# Write the header to the file
output_bw.addHeader(header)
output_bw.addHeader(header, maxZooms = args.max_zooms)

# TODO Use parallel processing to speed up. Must write chromosomes in same order as header
# Loop through the chromosomes and average the values across files
Expand All @@ -86,7 +86,7 @@ def run_averaging(args):
ends=chrom_length,
span=1,
step=1,
values=chrom_vals.tolist()
values=chrom_vals.astype(np.float16).tolist()
)

# Measure time of averaging
Expand All @@ -99,4 +99,4 @@ def run_averaging(args):

logging.info("Total averaging time: %d:%d:%d.\n" % (hours, mins, secs))

logging.info("Results saved to: " + output_bigwig_filename)
logging.info("Results saved to: " + output_bigwig_filename)