databio / pepatac

A modular, containerized pipeline for ATAC-seq data processing
http://pepatac.databio.org
BSD 2-Clause "Simplified" License
54 stars 14 forks source link

Getting a Python pipestat error: cannot import name 'get_file_for_project' #281

Closed ndrubins closed 4 months ago

ndrubins commented 4 months ago

Hi,

I'm following the step-by-step tutorial with my mouse ATAC-seq data. The only deviations I made from the step-by-step tutorial are:

  1. In step 2 ("Initialize refgenie and download assets") I specified mm10 instead of hg38.
  2. In step 3 ("Download tutorial read files") I placed my own fastq files in the pepatac/examples/data/ folder.
  3. In step 4 ("Configure project files") I edited the tutorial.csv file according to my sample names, which correspond to the fastq files I placed in the pepatac/examples/data/ folder.

I ran pip install --user --upgrade looper before running the looper run examples/tutorial/tutorial_refgenie.yaml command, which seemed fine as it gave:

(py3_9) rn@c2:/scratch/hsc/pepatac_tutorial/tools/pepatac$ pip install --user --upgrade looper
Requirement already satisfied: looper in /home/rn/.local/lib/python3.9/site-packages (1.7.0)
Requirement already satisfied: colorama>=0.3.9 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from looper) (0.4.6)
Requirement already satisfied: divvy>=0.5.0 in /home/rn/.local/lib/python3.9/site-packages (from looper) (0.6.0)
Requirement already satisfied: eido>=0.2.1 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from looper) (0.2.2)
Requirement already satisfied: jinja2 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from looper) (3.1.2)
Requirement already satisfied: logmuse>=0.2.0 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from looper) (0.2.8)
Requirement already satisfied: pandas>=2.0.2 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from looper) (2.2.2)
Requirement already satisfied: pephubclient>=0.1.2 in /home/rn/.local/lib/python3.9/site-packages (from looper) (0.4.2)
Requirement already satisfied: peppy>=0.40.0 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from looper) (0.40.1)
Requirement already satisfied: pipestat>=0.8.0 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from looper) (0.9.1)
Requirement already satisfied: pyyaml>=3.12 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from looper) (6.0.1)
Requirement already satisfied: rich>=9.10.0 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from looper) (13.5.2)
Requirement already satisfied: ubiquerg>=0.5.2 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from looper) (0.8.0)
Requirement already satisfied: yacman>=0.9.2 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from looper) (0.9.3)
Requirement already satisfied: attmap>=0.12.9 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from divvy>=0.5.0->looper) (0.13.2)
Requirement already satisfied: jsonschema>=3.0.1 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from eido>=0.2.1->looper) (4.19.0)
Requirement already satisfied: setuptools in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from logmuse>=0.2.0->looper) (69.5.1)
Requirement already satisfied: numpy>=1.22.4 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from pandas>=2.0.2->looper) (1.26.4)
Requirement already satisfied: python-dateutil>=2.8.2 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from pandas>=2.0.2->looper) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from pandas>=2.0.2->looper) (2024.1)
Requirement already satisfied: tzdata>=2022.7 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from pandas>=2.0.2->looper) (2024.1)
Requirement already satisfied: typer>=0.7.0 in /home/rn/.local/lib/python3.9/site-packages (from pephubclient>=0.1.2->looper) (0.12.3)
Requirement already satisfied: requests>=2.28.2 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from pephubclient>=0.1.2->looper) (2.31.0)
Requirement already satisfied: pydantic>2.5.0 in /home/rn/.local/lib/python3.9/site-packages (from pephubclient>=0.1.2->looper) (2.7.1)
Requirement already satisfied: coloredlogs>=15.0.1 in /home/rn/.local/lib/python3.9/site-packages (from pephubclient>=0.1.2->looper) (15.0.1)
Requirement already satisfied: markdown-it-py>=2.2.0 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from rich>=9.10.0->looper) (3.0.0)
Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from rich>=9.10.0->looper) (2.16.1)
Requirement already satisfied: oyaml in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from yacman>=0.9.2->looper) (1.0)
Requirement already satisfied: MarkupSafe>=2.0 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from jinja2->looper) (2.1.3)
Requirement already satisfied: humanfriendly>=9.1 in /home/rn/.local/lib/python3.9/site-packages (from coloredlogs>=15.0.1->pephubclient>=0.1.2->looper) (10.0)
Requirement already satisfied: attrs>=22.2.0 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from jsonschema>=3.0.1->eido>=0.2.1->looper) (23.1.0)
Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from jsonschema>=3.0.1->eido>=0.2.1->looper) (2023.7.1)
Requirement already satisfied: referencing>=0.28.4 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from jsonschema>=3.0.1->eido>=0.2.1->looper) (0.30.2)
Requirement already satisfied: rpds-py>=0.7.1 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from jsonschema>=3.0.1->eido>=0.2.1->looper) (0.10.2)
Requirement already satisfied: mdurl~=0.1 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from markdown-it-py>=2.2.0->rich>=9.10.0->looper) (0.1.2)
Requirement already satisfied: annotated-types>=0.4.0 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from pydantic>2.5.0->pephubclient>=0.1.2->looper) (0.5.0)
Requirement already satisfied: pydantic-core==2.18.2 in /home/rn/.local/lib/python3.9/site-packages (from pydantic>2.5.0->pephubclient>=0.1.2->looper) (2.18.2)
Requirement already satisfied: typing-extensions>=4.6.1 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from pydantic>2.5.0->pephubclient>=0.1.2->looper) (4.7.1)
Requirement already satisfied: six>=1.5 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from python-dateutil>=2.8.2->pandas>=2.0.2->looper) (1.16.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from requests>=2.28.2->pephubclient>=0.1.2->looper) (3.2.0)
Requirement already satisfied: idna<4,>=2.5 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from requests>=2.28.2->pephubclient>=0.1.2->looper) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from requests>=2.28.2->pephubclient>=0.1.2->looper) (2.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from requests>=2.28.2->pephubclient>=0.1.2->looper) (2023.7.22)
Requirement already satisfied: click>=8.0.0 in /home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages (from typer>=0.7.0->pephubclient>=0.1.2->looper) (8.1.7)
Requirement already satisfied: shellingham>=1.3.0 in /home/rn/.local/lib/python3.9/site-packages (from typer>=0.7.0->pephubclient>=0.1.2->looper) (1.5.4)

But when I ran the looper run examples/tutorial/tutorial_refgenie.yaml command I got this error:

(py3_9) rn@c2:/scratch/rn/hsc/pepatac_tutorial/tools/pepatac$ looper run examples/tutorial/tutorial_refgenie.yaml
/home/rn/.local/lib/python3.9/site-packages/pydantic/_migration.py:283: UserWarning: `pydantic.error_wrappers:ValidationError` has been moved to `pydantic:ValidationError`.
  warnings.warn(f'`{import_path}` has been moved to `{new_location}`.')
Traceback (most recent call last):
  File "/home/rn/.local/bin/looper", line 5, in <module>
    from looper.__main__ import main
  File "/home/rn/.local/lib/python3.9/site-packages/looper/__main__.py", line 3, in <module>
    from .cli_looper import main
  File "/home/rn/.local/lib/python3.9/site-packages/looper/cli_looper.py", line 16, in <module>
    from .looper import *
  File "/home/rn/.local/lib/python3.9/site-packages/looper/looper.py", line 48, in <module>
    from pipestat.reports import get_file_for_project
ImportError: cannot import name 'get_file_for_project' from 'pipestat.reports' (/home/rn/miniconda/envs/py3_9/lib/python3.9/site-packages/pipestat/reports.py)

I'd greatly appreciate your help.

nsheff commented 4 months ago

Sounds like a version mismatch. What version of pipestat do you have installed?

donaldcampbelljr commented 4 months ago

Hi @ndrubins, thanks for flagging this. It appears that this is due to Looper 1.7.0 and Pipestat 0.9.1.

Downgrading to Pipestat 0.8.0 should solve your issue. Looper 1.7.1 was released last week as a fix for this issue (pinning Pipestat < 0.9.0).

Related issue: https://github.com/pepkit/looper/issues/494

Related PR: https://github.com/pepkit/looper/pull/495

ndrubins commented 4 months ago

Thanks