FoxoTech / methylcheck

Python-based Illumina methylation array quality control software.
MIT License
10 stars 7 forks source link

Pandas ~2 removed `DataFrame.append()` #82

Open xinaesthete opened 6 months ago

xinaesthete commented 6 months ago

It seems that the library is using the pandas append() method that has now been removed - I'm not sure in what version.

I encountered this in a couple of places in infer_channel_switch.py and locally patched to use concat instead:

"AttributeError: 'DataFrame' object has no attribute 'append'. Did you mean: '_append'?"

    # oobG_IG = oobG.append(green_in_band).sort_index()
    # oobR_IR = oobR.append(red_in_band).sort_index()
    oobG_IG = pd.concat([oobG, green_in_band]).sort_index()
    oobR_IR = pd.concat([oobR, red_in_band]).sort_index()
...
    # lookup = lookupIG.append(lookupIR).sort_index()
    lookup = pd.concat([lookupIG, lookupIR]).sort_index()

This appears to be running ok on some data that I'm processing locally (I have yet to see any output that I can verify), but it may be that you should either specify an upper bound on which version of pandas is required, or if you have time, audit the code a bit more thoroughly and update to use the newer method.

Actually, while I was typing this, it reached a later point in the pipeline and hit another place at the end of sample_sheets.py - patching that was enough to get it to process my data without setting up a new environment with a different version of Pandas etc.

I notice in this issue it was mentioned that you specify using pandas v1.2x-v1.3x, but it appears now you just specify >=1.3.0.