sbslee / pypgx

A Python package for pharmacogenomics (PGx) research
https://pypgx.readthedocs.io
MIT License
65 stars 12 forks source link

UserWarning: Trying to unpickle estimator SVC from version 0.24.2 when using version 0.24.1 #57

Closed Pharmacogenetecist closed 2 years ago

Pharmacogenetecist commented 2 years ago

I was just going through the tutorial I got the following "error messages"- is this something I should be worried about?

$ pypgx run-ngs-pipeline CYP2D6 grch37-CYP2D6-pipeline --variants "/home/ec2-user/PYPX/getrm-wgs-tutorial/grch37-variants.vcf.gz                                                                                                                             " --depth-of-coverage "/home/ec2-user/PYPX/getrm-wgs-tutorial/grch37-depth-of-coverage.zip" --control-statistics "/home/ec2-user/PYPX/getrm-wgs-tutorial/grch37-control-                                                                                                                             statistics-VDR.zip"
Saved VcfFrame[Imported] to: grch37-CYP2D6-pipeline/imported-variants.zip
Saved VcfFrame[Phased] to: grch37-CYP2D6-pipeline/phased-variants.zip
Saved VcfFrame[Consolidated] to: grch37-CYP2D6-pipeline/consolidated-variants.zip
Saved SampleTable[Alleles] to: grch37-CYP2D6-pipeline/alleles.zip
Saved CovFrame[ReadDepth] to: grch37-CYP2D6-pipeline/read-depth.zip
Saved CovFrame[CopyNumber] to: grch37-CYP2D6-pipeline/copy-number.zip
_/home/ec2-user/anaconda3/lib/python3.8/site-packages/sklearn/base.py:310: UserWarning: Trying to unpickle estimator SVC from version 0.24.2 when using version 0.24.1. T                                                                                                                             his might lead to breaking code or invalid results. Use at your own risk.
  warnings.warn(
/home/ec2-user/anaconda3/lib/python3.8/site-packages/sklearn/base.py:310: UserWarning: Trying to unpickle estimator LabelBinarizer from version 0.24.2 when using versio                                                                                                                             n 0.24.1. This might lead to breaking code or invalid results. Use at your own risk.
  warnings.warn(
/home/ec2-user/anaconda3/lib/python3.8/site-packages/sklearn/base.py:310: UserWarning: Trying to unpickle estimator OneVsRestClassifier from version 0.24.2 when using v                                                                                                                             ersion 0.24.1. This might lead to breaking code or invalid results. Use at your own risk.
  warnings.warn(_
Saved SampleTable[CNVCalls] to: grch37-CYP2D6-pipeline/cnv-calls.zip
Saved SampleTable[Genotypes] to: grch37-CYP2D6-pipeline/genotypes.zip
Saved SampleTable[Phenotypes] to: grch37-CYP2D6-pipeline/phenotypes.zip
Saved SampleTable[Results] to: grch37-CYP2D6-pipeline/results.zip
sbslee commented 2 years ago

@Pharmacogenetecist,

Great question! No, you don't need to worry about them -- they are just warning from scikit-learn indicating that you are using a classifier trained in a different package version than the one that's currently installed in your environment. As far as I know, this can have meaningful impact in certain cases, but the SVM-based classifier used in PyPGx is stable enough so you don't need to worry. You can also check this by comparing the CYP2D6 results with validation data (keep following the tutorial):

$ wget https://raw.githubusercontent.com/sbslee/pypgx-data/main/getrm-wgs-tutorial/grch37-CYP2D6-results.zip
$ pypgx compare-genotypes grch37-CYP2D6-pipeline/results.zip grch37-CYP2D6-results.zip
# Genotype
Total: 70
Compared: 70
Concordance: 1.000 (70/70)
# CNV
Total: 70
Compared: 70
Concordance: 1.000 (70/70)