statisticalbiotechnology / triqler

The triqler (TRansparent Identification-Quantification-linked Error Rates)'s source and example code
Apache License 2.0
19 stars 10 forks source link

running triqler installed from source and with pip errors with dia_example fails #21

Closed wolski closed 1 year ago

wolski commented 1 year ago

I did install "triqler" from the source with

git clone https://github.com/statisticalbiotechnology/triqler.git
cd triqler
pip install .

and no errors.

My Python version is: (triqler) wew-mac:dia_example witoldwolski$ python --version Python 3.11.2

When running the dia_example triqler errors with: TypeError: histogram() got an unexpected keyword argument 'normed'

(triqler) wew-mac:dia_example witoldwolski$ python -m triqler --missing_value_prior DIA --decoy_pattern DECOY LFQBench_PS.csv
Triqler version None
Copyright (c) 2018-2023 Matthew The, Patrick Truong. All rights reserved.
Written by:
- Matthew The (matthew.the@scilifelab.se)
- Patrick Truong (patrick.truong@scilifelab.se)
in the School of Engineering Sciences in Chemistry, Biotechnology and Health
at the Royal Institute of Technology in Stockholm.
Issued command: triqler.py --missing_value_prior DIA --decoy_pattern DECOY LFQBench_PS.csv
Parsing triqler input file
  Reading row 0
Calculating identification PEPs
  Identified 163061 PSMs at 1% FDR
Selecting best feature per run and spectrum
  featureGroupIdx: 0
Dividing intensities by 0.1 for increased readability
Calculating peptide-level identification PEPs
  Identified 28588 peptides at 1% FDR
Writing peptide quant rows to file: LFQBench_PS.csv.pqr.tsv
Calculating protein-level identification PEPs
  Identified 3308 proteins at 1% FDR
Fitting hyperparameters
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/witoldwolski/opt/anaconda3/envs/triqler/lib/python3.11/site-packages/triqler/__main__.py", line 8, in <module>
    main()
  File "/Users/witoldwolski/opt/anaconda3/envs/triqler/lib/python3.11/site-packages/triqler/triqler.py", line 39, in main
    runTriqler(params, args.in_file, args.out_file)
  File "/Users/witoldwolski/opt/anaconda3/envs/triqler/lib/python3.11/site-packages/triqler/triqler.py", line 136, in runTriqler
    diff_exp.doDiffExp(params, peptQuantRows, triqlerOutputFile, doPickedProteinQuantification, selectComparisonBayesTmp, qvalMethod = qvalMethod)
  File "/Users/witoldwolski/opt/anaconda3/envs/triqler/lib/python3.11/site-packages/triqler/diff_exp.py", line 16, in doDiffExp
    proteinOutputRows = proteinQuantificationMethod(peptQuantRows, params, proteinModifier, getEvalFeatures)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/witoldwolski/opt/anaconda3/envs/triqler/lib/python3.11/site-packages/triqler/triqler.py", line 350, in doPickedProteinQuantification
    hyperparameters.fitPriors(peptQuantRows, params)
  File "/Users/witoldwolski/opt/anaconda3/envs/triqler/lib/python3.11/site-packages/triqler/hyperparameters.py", line 85, in fitPriors
    fitLogitNormalDIA(observedXICValues, imputedValues, params, plot) # DIA fitLogitNormal - missing value prior
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/witoldwolski/opt/anaconda3/envs/triqler/lib/python3.11/site-packages/triqler/hyperparameters.py", line 156, in fitLogitNormalDIA
    vals, bins = np.histogram(observedValues, bins = np.arange(minBin, maxBin, 0.1), normed = True)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<__array_function__ internals>", line 198, in histogram
TypeError: histogram() got an unexpected keyword argument 'normed'
(triqler) wew-mac:dia_example witoldwolski$ 

In addition, I tried to install triqler with pip install triqler in a fresh virtual env. However, also here I am getting the error:

(triqler2) wew-mac:dia_example witoldwolski$ python -m triqler --missing_value_prior DIA --decoy_pattern DECOY LFQBench_PS.csv
Triqler version None
Copyright (c) 2018-2023 Matthew The, Patrick Truong. All rights reserved.
Written by:
- Matthew The (matthew.the@scilifelab.se)
- Patrick Truong (patrick.truong@scilifelab.se)
in the School of Engineering Sciences in Chemistry, Biotechnology and Health
at the Royal Institute of Technology in Stockholm.
Issued command: triqler.py --missing_value_prior DIA --decoy_pattern DECOY LFQBench_PS.csv
Parsing triqler input file
  Reading row 0
Calculating identification PEPs
  Identified 163061 PSMs at 1% FDR
Selecting best feature per run and spectrum
  featureGroupIdx: 0
Dividing intensities by 0.1 for increased readability
Calculating peptide-level identification PEPs
  Identified 28588 peptides at 1% FDR
Writing peptide quant rows to file: LFQBench_PS.csv.pqr.tsv
Calculating protein-level identification PEPs
  Identified 3308 proteins at 1% FDR
Fitting hyperparameters
Traceback (most recent call last):
  File "/Users/witoldwolski/opt/anaconda3/envs/triqler2/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/witoldwolski/opt/anaconda3/envs/triqler2/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/witoldwolski/opt/anaconda3/envs/triqler2/lib/python3.9/site-packages/triqler/__main__.py", line 8, in <module>
    main()
  File "/Users/witoldwolski/opt/anaconda3/envs/triqler2/lib/python3.9/site-packages/triqler/triqler.py", line 39, in main
    runTriqler(params, args.in_file, args.out_file)
  File "/Users/witoldwolski/opt/anaconda3/envs/triqler2/lib/python3.9/site-packages/triqler/triqler.py", line 136, in runTriqler
    diff_exp.doDiffExp(params, peptQuantRows, triqlerOutputFile, doPickedProteinQuantification, selectComparisonBayesTmp, qvalMethod = qvalMethod)
  File "/Users/witoldwolski/opt/anaconda3/envs/triqler2/lib/python3.9/site-packages/triqler/diff_exp.py", line 16, in doDiffExp
    proteinOutputRows = proteinQuantificationMethod(peptQuantRows, params, proteinModifier, getEvalFeatures)
  File "/Users/witoldwolski/opt/anaconda3/envs/triqler2/lib/python3.9/site-packages/triqler/triqler.py", line 350, in doPickedProteinQuantification
    hyperparameters.fitPriors(peptQuantRows, params)
  File "/Users/witoldwolski/opt/anaconda3/envs/triqler2/lib/python3.9/site-packages/triqler/hyperparameters.py", line 85, in fitPriors
    fitLogitNormalDIA(observedXICValues, imputedValues, params, plot) # DIA fitLogitNormal - missing value prior
  File "/Users/witoldwolski/opt/anaconda3/envs/triqler2/lib/python3.9/site-packages/triqler/hyperparameters.py", line 156, in fitLogitNormalDIA
    vals, bins = np.histogram(observedValues, bins = np.arange(minBin, maxBin, 0.1), normed = True)
  File "<__array_function__ internals>", line 198, in histogram
TypeError: histogram() got an unexpected keyword argument 'normed'
(triqler2) wew-mac:dia_example witoldwolski$ 
wolski commented 1 year ago

Install python poetry

cd  tiqler
poetry install
poetry shell