pirovc / ganon

ganon2 classifies genomic sequences against large sets of references efficiently, with integrated download and update of databases (refseq/genbank), taxonomic profiling (ncbi/gtdb), binning and hierarchical classification, customized reporting and more
https://pirovc.github.io/ganon/
MIT License
87 stars 13 forks source link

Pandas error df.concat depreciated during `ganon build` #210

Closed nealplatt closed 2 years ago

nealplatt commented 2 years ago

Hi @pirovc

I am using the bioconda version of ganon and am getting some strange results and am trying to trouble shoot through them. I have noticed that when I use ganon build I get the following error.

/master/nplatt/anaconda3/envs/ganon/lib/python3.9/site-packages/ganon/seqinfo.py:32: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead. self.seqinfo = self.seqinfo.append(df, ignore_index=True, sort=False)

and it repeats several thousand times....

This seems like an easy fix and shouldn't be causing any major problems but wanted to make note of it for you. I tried messing around with the code and changing it to the new pd.concat() but crashed things every time I tried.

Relevant portions of my env are:

name: ganon
channels:
  - conda-forge
  - bioconda
  - defaults
dependencies:
  - ganon=1.1.2=py39h65541a6_1
  - pandas=1.4.2=py39h1832856_2
  - python=3.9.13=h2660328_0_cpython
...

Thanks

pirovc commented 2 years ago

Hi @nealplatt, thanks for reporting. Newer versions of pandas are throwing this warning and it's indeed annoying. It already got fixed in the new release (1.2.0) which is going to be released soon. For now, one can suppress such warning if it's causing any trouble: https://stackoverflow.com/questions/15777951/how-to-suppress-pandas-future-warning