Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix Issue#350 #353

Merged
merged 4 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions autometa-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ channels:
dependencies:
- attrs # test-data requirement
- bedtools
- biopython
- biopython>=1.82
- bowtie2
- diamond>=2.0
- gdown
- hmmer
- numba>=0.47
- numpy>=1.13
- pandas>=1.1
- pandas>=1.5
- parallel
- pip
- prodigal # NOTE: 2.5 and 2.6 output format is different for sequence headers
Expand Down
2 changes: 1 addition & 1 deletion autometa/binning/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def get_metabin_taxonomies(
outcols = [cluster_col, "length", "taxid", *canonical_ranks]
tmp_lines = (
bin_df[outcols]
.to_csv(sep="\t", index=False, header=False, line_terminator="\n")
.to_csv(sep="\t", index=False, header=False, lineterminator="\n")
.split("\n")
)
taxonomies = {}
Expand Down
4 changes: 2 additions & 2 deletions autometa/common/metagenome.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def length_weighted_gc(self) -> float:
for seq in self.sequences:
weight = len(seq) / self.size
add_weight(weight)
gc_content = SeqUtils.GC(seq)
gc_content = SeqUtils.gc_fraction(seq) * 100
add_gc_contents(gc_content)
return np.average(a=gc_contents, weights=weights)

Expand Down Expand Up @@ -312,7 +312,7 @@ def gc_content(self) -> pd.DataFrame:
[
{
"contig": record.id,
"gc_content": SeqUtils.GC(record.seq),
"gc_content": SeqUtils.gc_fraction(seq) * 100,
"length": len(record.seq),
}
for record in self.seqrecords
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/test_metagenome.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May need to address this later but will merge for now

Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_length_weighted_gc(metagenome):
if metagenome.nseqs == 3:
expected = 65.3167472932504
elif metagenome.nseqs == 4:
expected = 63.195548489666145
expected = 63.19554848966614
else:
expected = None
assert isinstance(metagenome.length_weighted_gc, float)
Expand Down
Loading