a-slide / pycoQC

pycoQC computes metrics and generates Interactive QC plots from the sequencing summary report generated by Oxford Nanopore technologies basecaller (Albacore/Guppy)
https://a-slide.github.io/pycoQC/
GNU General Public License v3.0
257 stars 41 forks source link

AttributeError: 'Series' object has no attribute 'ptp' #131

Open dan-ward-bio opened 3 years ago

dan-ward-bio commented 3 years ago

pycoQC -f sequencing_summary.txt -o test.htm

PARSE CONFIGURATION FILE PARSE DATA FILES Import raw data from sequencing summary files 320,000 reads found in initial file Verify fields and discard unused columns 1D Run type Drop lines containing NA values 0 reads discarded Sort run IDs by decreasing throughput Traceback (most recent call last): File "/mnt/storageG1/dan/miniconda3/envs/pycoQC/bin/pycoQC", line 12, in sys.exit(main_pycoQC()) File "/mnt/storageG1/dan/miniconda3/envs/pycoQC/lib/python3.6/site-packages/pycoQC/cli.py", line 169, in main_pycoQC title=args.title) File "/mnt/storageG1/dan/miniconda3/envs/pycoQC/lib/python3.6/site-packages/pycoQC/cli.py", line 196, in generate_report filter_calibration=filter_calibration) File "/mnt/storageG1/dan/miniconda3/envs/pycoQC/lib/python3.6/site-packages/pycoQC/pycoQC.py", line 166, in init d[run_id] = len(sdf)/sdf["start_time"].ptp() File "/mnt/storageG1/dan/miniconda3/envs/pycoQC/lib/python3.6/site-packages/pandas/core/generic.py", line 5141, in getattr return object.getattribute(self, name) AttributeError: 'Series' object has no attribute 'ptp'

a-slide commented 3 years ago

Could you try to downgrade your pandas installation ?

dan-ward-bio commented 3 years ago

Worked perfectly. Thanks for your help!

conda install pandas=0.25

a-slide commented 3 years ago

Let's keep it open. I have to fix that at some point.

Hedi65 commented 2 years ago

hi

i have the same issue

(base) RK@Predator:~$ pycoQC -f /home/RK/Documents/Basecalled/sequencing_summary.txt -o /home/RK/Documents/Basecalled/TINE_B1.html PARSE CONFIGURATION FILE PARSE DATA FILES Import raw data from sequencing summary files 2,464,626 reads found in initial file Verify fields and discard unused columns 1D Run type Drop lines containing NA values 0 reads discarded Sort run IDs by decreasing throughput Traceback (most recent call last): File "/home/RK/anaconda3/bin/pycoQC", line 12, in sys.exit(main_pycoQC()) File "/home/RK/anaconda3/lib/python3.8/site-packages/pycoQC/cli.py", line 160, in main_pycoQC generate_report( File "/home/RK/anaconda3/lib/python3.8/site-packages/pycoQC/cli.py", line 191, in generate_report p = pycoQC ( File "/home/RK/anaconda3/lib/python3.8/site-packages/pycoQC/pycoQC.py", line 166, in init d[run_id] = len(sdf)/sdf["start_time"].ptp() File "/home/RK/.local/lib/python3.8/site-packages/pandas/core/generic.py", line 5487, in getattr return object.getattribute(self, name) AttributeError: 'Series' object has no attribute 'ptp'

dan-ward-bio commented 2 years ago

@Hedi65

Have you tried the conda install pandas=0.25 fix?

if you don't use conda, you can try pip:

pip install pandas==0.25

Hedi65 commented 2 years ago

Thank you, I had the last version of Pandas and i uninstalled it. i tried both your provided commands. but i got very long errors. then i tried to install pandas 0.25 via bioconda. it says the package already exist but pip show says no package exists !

(base) RK@Predator:~$ pip3 show pandas WARNING: Package(s) not found: pandas

(base) RK@Predator:~$ conda install -c prometeia pandas Collecting package metadata (current_repodata.json): done Solving environment: done

All requested packages already installed.

(base) RK@Predator:~$ conda install -c mirror-test pandas Collecting package metadata (current_repodata.json): done Solving environment: done

All requested packages already installed.

(base) RK@Predator:~$ pip3 show pandas WARNING: Package(s) not found: pandas

dan-ward-bio commented 2 years ago

Okay. it might be a good idea to make a conda environment to install these packages seperate from your base.

Try executing these commands in this order:

conda create --name pycoqc conda activate pycoqc conda install -c bioconda pycoqc conda install pandas=0.25

Each time you want to run pycoqc, you should run the conda activate pycoqc and conda deactivate when you are done.

Hedi65 commented 2 years ago

thank you for your advice, it worked for me. i had almost the same problem with NanoPlot, which has been solved using this method as well (had to downgrade another package).

Best

nick-youngblut commented 2 years ago

It appears that the pycoQC bioconda recipe does not actually force pandas=0.25.1, since I installed the pycoQC via mamba in an existing environment, and the pandas version was not downgraded from 1.3.4.