Skip to content

Commit

Permalink
Fix Issue#350 (#353)
Browse files Browse the repository at this point in the history
* Fix pandas version

* :up-arrow: Update pandas to 1.5
🎨 Chage line_terminator to lineterminator in `summary.py`

* Fix biopython error

* Update bioython version
  • Loading branch information
Sidduppal authored Feb 20, 2024
1 parent acbf86d commit a4a7af7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
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
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

0 comments on commit a4a7af7

Please sign in to comment.