bcgsc / NanoSim

Nanopore sequence read simulator
Other
217 stars 51 forks source link

NanoSim installation failure #162

Open cjwoodruff50 opened 2 years ago

cjwoodruff50 commented 2 years ago

NanoSim_installation_problems_15April2022.txt

kmnip commented 2 years ago

Similar to #161: If you install from bioconda, it is less likely to have installation issues. For example:

conda create -n nanosim
conda activate nanosim
conda install -c bioconda nanosim

I think that requirements.txt is overly restrictive and it should be updated to something like so:

htseq
joblib
numpy>=1.21.5
pybedtools>=0.8.1
pysam>=0.15.3
scikit-learn>=0.22.1
scipy
six
genometools-genometools
last
minimap2
samtools
cjwoodruff50 commented 2 years ago

Ka Ming, Thanks for your prompt reply. I tried what you suggested (below) and NanoSim installed - apparently cleanly. However, when I try to run it I get the same error I was getting 2 weeks back that led to me to try various fixes. This relates to an apparent incompatibility that arises for some users of scikit-learn – the first example below is when I used your suggested approach, the second is where I simply used pip install –user to replace the version of scikit-learn following a Stack Overflow suggestion. The latter gives an apparent completed run – but no simulated reads are generated.

Trying to unpickle estimator KernelDensity from version 0.21.3 when using version 0.22.1.

Trying to unpickle estimator KernelDensity from version 0.21.3 when using version 0.22.2.post1

I attach the log files from the two runs as they may be more informative for you.

Chris Woodruff

From: Ka Ming Nip @.> Date: Friday, 15 April 2022 at 6:32 pm To: bcgsc/NanoSim @.> Cc: Chris Woodruff @.>, Author @.> Subject: Re: [bcgsc/NanoSim] NanoSim installation failure (Issue #162)

Similar to #161https://github.com/bcgsc/NanoSim/issues/161: If you install from bioconda, it is less likely to have installation issues. For example:

conda create -n nanosim

conda activate nanosim

conda install -c bioconda nanosim

I think that requirements.txthttps://github.com/bcgsc/NanoSim/blob/master/requirements.txt is overly restrictive and it should be updated to something like so:

htseq

joblib

numpy>=1.21.5

pybedtools>=0.8.1

pysam>=0.15.3

scikit-learn>=0.22.1

scipy

six

genometools-genometools

last

minimap2

samtools

— Reply to this email directly, view it on GitHubhttps://github.com/bcgsc/NanoSim/issues/162#issuecomment-1099963694, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE46HIDT5BM5MD63NB7HGYDVFESS3ANCNFSM5TOXYUQQ. You are receiving this because you authored the thread.Message ID: @.***>

kmnip commented 2 years ago

Hi Chris, Can you try installing version 0.21.3 of scikit-learn and re-run your simulation?

conda install scikit-learn=0.21.3

If the simulation doesn't work, then try upgrading scikit-learn to the latest version?

conda update scikit-learn

If that still doesn't work, then I think the pre-trained models need to be updated to work with newer version of scikit-learn. In the mean time, you can also train your own models using public datasets.

cjwoodruff50 commented 2 years ago

Ka Ming, Your first suggestion worked – but only after I noticed that a version of scikit-learn that I had installed into my user area was being accessed by NanoSim even though I was running in the nanosim environment. To (ignorant) me this suggests that some code within Nanosim is accessing python packages outside the nanosim environment created. I replaced the scikit-learn version that I had installed to my –user area by version 0.21.3 and that allowed NanoSim to (sort of) run.

            There is a still a major problem but it is not the one I raised on Github and that you appear to have resolved.

            Thanks for your help.

Chris

From: Ka Ming Nip @.> Date: Saturday, 16 April 2022 at 6:37 am To: bcgsc/NanoSim @.> Cc: Chris Woodruff @.>, Author @.> Subject: Re: [bcgsc/NanoSim] NanoSim installation failure (Issue #162)

Hi Chris, Can you try installing version 0.21.3 of scikit-learn and re-run your simulation?

conda install scikit-learn=0.21.3

If the simulation doesn't work, then try upgrading scikit-learn to the latest version?

conda update scikit-learn

If that still doesn't work, then I think the pre-trained models need to be updated to work with newer version of scikit-learn. In the mean time, you can also train your own models using public datasets.

— Reply to this email directly, view it on GitHubhttps://github.com/bcgsc/NanoSim/issues/162#issuecomment-1100383033, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE46HIHVBKTB6M6EWY44JTLVFHHSBANCNFSM5TOXYUQQ. You are receiving this because you authored the thread.Message ID: @.***>

SaberHQ commented 2 years ago

Hi Chris @cjwoodruff50

As @kmnip mentioned, the requirements.txt file is overly restrictive and that might be the reason for your package dependency issue. We will update it to make it easier to install packages using that file.

I am happy to hear that you were able to install NanoSim and make it run. I believe you said you still got a major problem running NanoSim. Please feel free to open another issue ticket and we will be more than happy to help you with that.

Finally, as for the scikit-learn package, version 0.22.1 works for me. You may see my comment (issue #131) on a similar problem here:

Please note that pull request #158 solves this issue by updating the scikit-learn version in requirements.txt

Previous sklearn.neighbors.kde has been renamed to sklearn.neighbors._kde in version 0.22.1. You have probably a version of scikit-learn older than that. Installing the latest release solves the problem:

pip install scikit-learn==0.22.1

For more information and help, please check this stackoverflow question/answer

I am closing this issue. If anyone finds a similar issue, please feel free to reopen it and we will be more than happy to help you. Thanks.

Originally posted by @SaberHQ in https://github.com/bcgsc/NanoSim/issues/131#issuecomment-1093527283

cjwoodruff50 commented 2 years ago

Thank you very much for your support. Before I raise a furter issue regarding nanoSim I want to ensure I’ve done my best to ensure that it is not a local problem causing my NanoSim problem.

Chris

From: Saber Hafezqorani @.> Date: Wednesday, 20 April 2022 at 6:27 am To: bcgsc/NanoSim @.> Cc: Chris Woodruff @.>, Mention @.> Subject: Re: [bcgsc/NanoSim] NanoSim installation failure (Issue #162)

Hi Chris @cjwoodruff50https://github.com/cjwoodruff50

As @kmniphttps://github.com/kmnip mentioned, the requirements.txt file is overly restrictive and that might be the reason for your package dependency issue. We will update it to make it easier to install packages using that file.

I am happy to hear that you were able to install NanoSim and make it run. I believe you said you still got a major problem running NanoSim. Please feel free to open another issue ticket and we will be more than happy to help you with that.

Finally, as for the scikit-learn package, version 0.22.1 works for me. You may see my comment (issue #131https://github.com/bcgsc/NanoSim/issues/131) on a similar problem here:

Please note that pull request #158https://github.com/bcgsc/NanoSim/pull/158 solves this issue by updating the scikit-learn version in requirements.txt

Previous sklearn.neighbors.kde has been renamed to sklearn.neighbors._kde in version 0.22.1https://github.com/scikit-learn/scikit-learn/commit/62aee0666e8803f20ecf0f6214621367e50f3961#diff-4ff1a647d9d4ef33358643ec58c914c7. You have probably a version of scikit-learn older than that. Installing the latest releasehttps://github.com/scikit-learn/scikit-learn/releases solves the problem:

pip install scikit-learn==0.22.1

For more information and help, please check this stackoverflow question/answerhttps://stackoverflow.com/questions/60145652/no-module-named-sklearn-neighbors-base

I am closing this issue. If anyone finds a similar issue, please feel free to reopen it and we will be more than happy to help you. Thanks.

Originally posted by @SaberHQhttps://github.com/SaberHQ in #131 (comment)https://github.com/bcgsc/NanoSim/issues/131#issuecomment-1093527283

— Reply to this email directly, view it on GitHubhttps://github.com/bcgsc/NanoSim/issues/162#issuecomment-1103107556, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE46HIHOJSNYNTS56V7PYWTVF4JIRANCNFSM5TOXYUQQ. You are receiving this because you were mentioned.Message ID: @.***>