Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Bug in mapdamagegeomparam script: AttributeError: 'DataFrame' object has no attribute 'ix' #1

Open
jfy133 opened this issue May 27, 2021 · 2 comments

Comments

@jfy133
Copy link

jfy133 commented May 27, 2021

Bug

I was trying out tapas and came across the following bug, when running the following I would get the error:

❯ $TAPAS/mapdamagegeomparam --fit-plots fig/fit.png input/mapdamage/misincorporation.txt
Traceback (most recent call last):
  File "/raven/u/jfellowsy/bin/tapas-1.2/scripts/src/mapdamage2geomparam.py", line 436, in <module>
    if __name__=="__main__": main()
  File "/raven/u/jfellowsy/bin/tapas-1.2/scripts/src/mapdamage2geomparam.py", line 68, in main
    A = A.ix[A.Total != 0,:]
  File "/u/jfellowsy/conda-envs/tapas/lib/python3.9/site-packages/pandas/core/generic.py", line 5465, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'ix'

This is derived from this line:

A = A.ix[A.Total != 0,:]

Where the ix column doesn't exist in the input mapDamage2 misincorporation file.

Workaround

Delete the referred to line in the above script, that refers to ix (assuming your misincorporation file doesn't have any 0s).

I was then successfully able to get the script ot run prpoerly.

@mlell
Copy link
Owner

mlell commented May 28, 2021

Hi,
on new versions of the pandas package DataFrame.ix seems to have been replaced by .loc. Thanks for this, I'll look into it
https://stackoverflow.com/questions/59991397/attributeerror-dataframe-object-has-no-attribute-ix

@jfy133
Copy link
Author

jfy133 commented May 28, 2021

Ah that could be the issue. I tried to install all the dependencies with exact versions via bioconda (for reproducibility) but unfortuanately I couldn't this to work due to conflicts or versions that are too old for bioconda.

I've therefore 'blindly' installed the latest versions of everything and somewhat hoping for the best.

conda create -n tapas -c bioconda python=3 r-essentials=4.0 r-base=4.0.3 bwa=0.7.17 bowtie2=2.4.2 minimap2=2.18 hisat2=2.2.1

Could be the pandas version I installed therefore wasn't compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants