diff --git a/install.sh b/install.sh index be31f2cd..6e0f5605 100755 --- a/install.sh +++ b/install.sh @@ -43,7 +43,7 @@ fi ${CONDA_INSTALL_CMD} install -y \ --prefix $BASEDIR/envs/Macrel_env \ ngless \ - pyrodigal>=0.7.3 \ + "pyrodigal>=0.7.3" \ megahit \ paladin \ pandas \ diff --git a/macrel/data/models/AMP.pkl.gz b/macrel/data/models/AMP.pkl.gz index 32b600c2..97360a23 100644 Binary files a/macrel/data/models/AMP.pkl.gz and b/macrel/data/models/AMP.pkl.gz differ diff --git a/macrel/data/models/Hemo.pkl.gz b/macrel/data/models/Hemo.pkl.gz index 10f6ccfc..21a01b27 100644 Binary files a/macrel/data/models/Hemo.pkl.gz and b/macrel/data/models/Hemo.pkl.gz differ diff --git a/macrel/main.py b/macrel/main.py index 26f3e2b1..5e2f9796 100644 --- a/macrel/main.py +++ b/macrel/main.py @@ -294,13 +294,14 @@ def do_density(args, clen, prediction): clen = clen.merge(on='contig', right=tpred, how='outer').fillna(0) clen[clen.columns[1:]] = clen[clen.columns[1:]].astype(int) ofile = path.join(args.output, args.outtag + '.percontigs.gz') + sample = clen.set_index('contig').sum(axis=0).tolist() + sample_density = sample[-1] * 1e6 / sample[0] with open_output(ofile, mode='wb') as raw_out: with gzip.open(raw_out, 'wt') as out: - from macrel_version import __version__ + from .macrel_version import __version__ out.write('# Prediction from macrel v{}\n'.format(__version__)) + out.write(f'# Macrel calculated for the sample a density of {sample_density:.3f} AMPs / Mbp.\n') clen.to_csv(out, sep='\t', index=False, float_format="%.3f") - sample = clen.set_index('contig').sum(axis=0).tolist() - sample_density = sample[-1] * 1e6 / sample[0] print(f'Macrel processed the sample and verified a density of {sample_density:.3f} AMPs / Mbp.') def do_get_examples(args): diff --git a/mkdocs.yml b/mkdocs.yml index 1d17dc2d..1ed90bc7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -23,6 +23,7 @@ nav: - 'Macrel': index.md - 'Install': install.md - 'Usage': usage.md + - 'Tutorial': tutorial.md - "What's New (history)": whatsnew.md - 'Contacts': contact.md - 'FAQ': faq.md diff --git a/tests/contigs.nosmorfs/expected.percontigs b/tests/contigs.nosmorfs/expected.percontigs index a11e9aa3..138570d7 100644 --- a/tests/contigs.nosmorfs/expected.percontigs +++ b/tests/contigs.nosmorfs/expected.percontigs @@ -1,3 +1,4 @@ # Prediction from macrel v1.2.0 +# Macrel calculated for the sample a density of 0.000 AMPs / Mbp. contig length ORFs smORFs AMPs scaffold2530_2_MH0058 1324 1 0 0 diff --git a/tests/contigs/expected.percontigs b/tests/contigs/expected.percontigs index ab77aced..5c6b96ac 100644 --- a/tests/contigs/expected.percontigs +++ b/tests/contigs/expected.percontigs @@ -1,4 +1,5 @@ # Prediction from macrel v1.2.0 +# Macrel calculated for the sample a density of 45.062 AMPs / Mbp. contig length ORFs smORFs AMPs scaffold2530_2_MH0058 717 2 2 0 scaffold75334_1_MH0058 3424 1 1 1 diff --git a/tests/reads.se/expected.percontigs b/tests/reads.se/expected.percontigs index ea16872d..3565512c 100644 --- a/tests/reads.se/expected.percontigs +++ b/tests/reads.se/expected.percontigs @@ -1,4 +1,5 @@ # Prediction from macrel v1.2.0 +# Macrel calculated for the sample a density of 59.743 AMPs / Mbp. contig length ORFs smORFs AMPs k47_0 3379 4 2 0 k47_1 6046 9 4 0 diff --git a/tests/reads/expected.percontigs b/tests/reads/expected.percontigs index de622811..62e1c85d 100644 --- a/tests/reads/expected.percontigs +++ b/tests/reads/expected.percontigs @@ -1,4 +1,5 @@ # Prediction from macrel v1.2.0 +# Macrel calculated for the sample a density of 57.627 AMPs / Mbp. contig length ORFs smORFs AMPs k77_3 1270 1 0 0 k77_5 5202 6 3 0