Skip to content

Commit

Permalink
ENH better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
psj1997 committed Feb 26, 2024
1 parent 5377260 commit 4e4b320
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions SemiBin/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ def generate_sequence_features_single(logger, contig_fasta,
sys.stderr.write(
f"Error: abundances from strobealign-aemb can only be used when samples used above or equal to 5.\n")
sys.exit(1)

logger.info('Reading abundance information from abundance files.')
abun, abun_split = generate_cov_from_abundances(abundances, output, contig_fasta, binned_length)

data = kmer_whole
Expand Down Expand Up @@ -913,9 +913,6 @@ def fasta_sample_iter(fn):
sys.exit(1)

must_link_threshold = get_must_link_threshold(contig_length_list) if args.ml_threshold is None else args.ml_threshold

logger.info('Calculating coverage for every sample.')

binning_threshold = {}
for sample in sample_list:
binning_threshold[sample] = utils.compute_min_length(
Expand All @@ -924,6 +921,7 @@ def fasta_sample_iter(fn):
args.ratio)

if args.bams:
logger.info('Calculating coverage for every sample.')
with Pool(min(args.num_process, len(args.bams))) as pool:
results = [
pool.apply_async(
Expand Down Expand Up @@ -1008,6 +1006,7 @@ def fasta_sample_iter(fn):
data_split.to_csv(ofile)

if args.abundances:
logger.info('Reading abundance information from abundance files.')
abun_split = generate_cov_from_abundances(args.abundances, os.path.join(args.output, 'samples'), args.contig_fasta, sep=args.separator, contig_threshold_dict=binning_threshold)
abun_split = abun_split.reset_index()
columns_list = list(abun_split.columns)
Expand Down

0 comments on commit 4e4b320

Please sign in to comment.