dereneaton / ipyrad

Interactive assembly and analysis of RAD-seq data sets
http://ipyrad.readthedocs.io
GNU General Public License v3.0
70 stars 39 forks source link

ipyrad 0.9.88: treeslider / BPP: both give AttributeError: 'str' object has no attribute 'decode'. #503

Closed imaa9 closed 1 year ago

imaa9 commented 1 year ago

Hi Isaac,

I'm writing to submit similar issues for treeslider and for BPP through ipyrad.

treeslider:

running in python within my ipyrad conda env on the cluster terminal, with a seqs.hdf5 I generated from a run of ipyrad (data for 7 species +outgroup sample), I've shortened the input file names here for brevity but in the run script I have full paths:

(ipyrad) [imaayan@holylogin04 all_L80_outfiles]$ python Python 3.10.5 | packaged by conda-forge | (main, Jun 14 2022, 07:04:59) [GCC 10.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import ipyrad.analysis as ipa import toytree data = "all_L80.seqs.hdf5" data 'all_L80.seqs.hdf5' ipa.treeslider(data).scaffold_table.head() Traceback (most recent call last): File "", line 1, in File "/n/home00/imaayan/.conda/envs/ipyrad/lib/python3.10/site-packages/ipyrad/analysis/treeslider.py", line 145, i n init self._init_scaffold_table() File "/n/home00/imaayan/.conda/envs/ipyrad/lib/python3.10/site-packages/ipyrad/analysis/treeslider.py", line 269, i n _init_scaffold_table self._pnames = np.array([ File "/n/home00/imaayan/.conda/envs/ipyrad/lib/python3.10/site-packages/ipyrad/analysis/treeslider.py", line 270, i n i.decode() for i in io5["phymap"].attrs["phynames"] AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?

Do you have a suggestion for fixing this (please let me know if any additional documentation would be helpful).


BPP:

Encountered a similar issue with BPP, here are my inputs (with file names and other long things abbreviated again): source activate ipyrad

python -c '

import ipyrad.analysis as ipa # ipyrad analysis tools import pandas as pd # DataFrames import numpy as np # data generation import toytree # tree plotting import toyplot # data plotting import toyplot.pdf import toyplot.svg

set the location of input file data = "all_L60.seqs.hdf5"

imap = {
"grh_jm": ["grh_14742", ... "grh_2760"], ..... "sagrei_out": ["sagrei_9961"], }

minmap = { "grh_jm" :28, ... "sagrei_out" :1, }

guidetree = "(newick guidetree);"

b = ipa.bpp( name="all_L60", data=data, imap=imap, minmap=minmap, guidetree=guidetree, infer_sptree=1, )

b.kwargs["burnin"] = 2000 b.kwargs["nsample"] = 20000 b.kwargs["sampfreq"] = 2 b.kwargs["seed"] = 33333 b.kwargs["tauprior"] = (2, 200, 1)

b.kwargs

run

b.run(auto=True) '

b.run(auto=True) Parallel connection | holylogin04.rc.fas.harvard.edu: 16 cores

Encountered an Error. Message: 'str' object has no attribute 'decode' Parallel connection closed. Traceback (most recent call last): File "/n/home00/imaayan/.conda/envs/ipyrad/lib/python3.10/site-packages/ipyrad/core/Parallel.py", line 314, in wrap_run self.tool._run(ipyclient=self.ipyclient, **self.rkwargs) File "/n/home00/imaayan/.conda/envs/ipyrad/lib/python3.10/site-packages/ipyrad/analysis/bpp.py", line 433, in _run self.lex = LocusExtracter( File "/n/home00/imaayan/.conda/envs/ipyrad/lib/python3.10/site-packages/ipyrad/analysis/locus_extracter.py", line 157, in init self._parse_scaffolds_meta() File "/n/home00/imaayan/.conda/envs/ipyrad/lib/python3.10/site-packages/ipyrad/analysis/locus_extracter.py", line 487, in _parse_scaffolds_meta self.pnames = np.array([ File "/n/home00/imaayan/.conda/envs/ipyrad/lib/python3.10/site-packages/ipyrad/analysis/locus_extracter.py", line 488, in i.decode() for i in io5["phymap"].attrs["phynames"] AttributeError: 'str' object has no attribute 'decode'

Happy to provide any additional documentation as needed.

isaacovercast commented 1 year ago

Ok, this is fixed. There was a change in how h5py was handling attribute strings recently. I had to test for this and handle it. Pushing a new version to the bioconda repo, should be up in ~24hrs (4/5/2023).

Commit: 525eadd1

imaa9 commented 1 year ago

Thanks a million Isaac!!

Inbar Maayan PhD Candidate | she/her Department of Organismic and Evolutionary Biology Harvard University @.*** www.inbarmaayan.com

On Mon, Apr 3, 2023 at 4:15 PM Isaac Overcast @.***> wrote:

Closed #503 https://github.com/dereneaton/ipyrad/issues/503 as completed.

— Reply to this email directly, view it on GitHub https://github.com/dereneaton/ipyrad/issues/503#event-8917040165, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHZCEZ25GAQO6T6XARJ4QBDW7MVXZANCNFSM6AAAAAAWRQEMYE . You are receiving this because you authored the thread.Message ID: @.***>