Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about CuiFinder.pm #1

Closed
HodaMemar opened this issue Dec 29, 2021 · 7 comments
Closed

Question about CuiFinder.pm #1

HodaMemar opened this issue Dec 29, 2021 · 7 comments

Comments

@HodaMemar
Copy link

HodaMemar commented Dec 29, 2021

Hello

Thank you for publishing this library.
I am not familiar with Perl
at this time I download UMLS and load scripts into MySQL.
after this command (cpanm UMLS::Interface --force) I get the error :
image

I guess this error is related to the user and password of MySQL.
But I can not find the CuiFinder.pm for adding a fixed username and password in Line 721.
would you please help me with this issue?

Thank you very much

@dhchenx
Copy link
Owner

dhchenx commented Dec 29, 2021

Hello

Thank you for publishing this library. I am not familiar with Perl at this time I download UMLS and load scripts into MySQL. after this command (cpanm UMLS::Interface --force) I get the error : image

I guess this error is related to the user and password of MySQL. But I can not find the CuiFinder.pm for adding a fixed username and password in Line 721. would you please help me with this issue?

Thank you very much

Hi,

 Thanks for interesting in this project. According to your figure of read time-out error, it seems that you failed to download the UMLS::Interface perl library from the Internet at the very beginning, thus causing failure of its installation. Maybe you should check your internet connection first. Then, if the above issue is solved, then you can try again to use cpanm UMLS::Interface --force to install the library in Windows Command program. 

I will describe my process of solving this issue in the following:
Initially I used cpanm UMLS::Interface to install it but failed with error mysql conecting issue. Based on my analysis, the library will try to use default MySQL user info to access the database (e.g. username=root, pasword=[EMPTY], db=umls) in its test scripts during the installation but failed when the user has different MySQL passwords and db names.
Then, I used cpanm UMLS::Interface --force and though errors remain, it can be installed. So you can find the source code of UMLS::Interface in the directory of C:\Strawberry\perl\site\lib\UMLS\Interface (suppossing you install Perl into the directory C:\Strawberry\perl). So in this directory, you can find CuiFinder.pm in above folder. The reason you can't find it is that you may not install it successfully due to failure of obtaining installation files online.
However, I did find it is not necessary to change th source codes of CuiFinder.pm when you force install the UMLS::Interface.
I am also not a Perl expert. So next step you should make sure cpanm UMLS::Interface --force should install (though errors still popup), and the directory C:\Strawberry\perl\site\lib\UMLS\Interface can be found even you don't change its perl source code. That still works.

Thanks.

@HodaMemar
Copy link
Author

Thank you very much for the details.
I finally downloaded umls::interface successfully. And install the umls-similarity too.
The python code executes without any error.
(I change the password in CuiFinder.pm too)
but did not return any result. I chose and tested many pairs of cui from the mrconso table. But I can not see the result. Only one empty array returned.
I will be very grateful if you tell me the problem In your opinion?
image

@dhchenx
Copy link
Owner

dhchenx commented Dec 30, 2021

Thank you very much for the details. I finally downloaded umls::interface successfully. And install the umls-similarity too. The python code executes without any error. (I change the password in CuiFinder.pm too) but did not return any result. I chose and tested many pairs of cui from the mrconso table. But I can not see the result. Only one empty array returned. I will be very grateful if you tell me the problem In your opinion? image

Hi,

After you sucessfully installed the two Perl libaries, you should not change the source code of the CuiFinder.pl file in the folder of C:\Strawberry\perl\site\lib\UMLS\Interface. Then, please try again. Below is the figure that shows the result. Since you have installed them, the next step you should try:

  1. run cpanm --uninstall UMLS::Interface and cpanm --uninstall UMLS::Similarity to remove any installation.
  2. re-install the two libraries: run cpanm UMLS::Interface --force and cpanm UMLS::Similarity --force (must include --force flag)
  3. now the example code should work. (By the way, please check if there are actual UMLS data in your MySQL database before.)

Thanks.

Results are below:
image
cuis_umls_sim.txt

@HodaMemar
Copy link
Author

HodaMemar commented Jan 5, 2022

Hello
Please forgive me for these questions.
I repeated all the steps from the beginning, I work by 2017AA version of UMLS.
The error I see is shown in the figure below
image

I search for SRDEF table
in this link :
Semantic Network File Format MySQL Load Script
after execute instructions I get a new error:
image

SAB[MSH] ?!
Would you please tell me your opinion in this issue?

@dhchenx
Copy link
Owner

dhchenx commented Jan 6, 2022

Hello Please forgive me for these questions. I repeated all the steps from the beginning, I work by 2017AA version of UMLS. The error I see is shown in the figure below image

I search for SRDEF table in this link : Semantic Network File Format MySQL Load Script after execute instructions I get a new error: image

SAB[MSH] ?! Would you please tell me your opinion in this issue?

Hi,

The UMLS database must contain six tables: 1. MRREL 2. MRCONSO 3. MRSAB 4. MRDOC 5. MRDEF 6. MRSTY 7. SRDEF

All other tables in the databases will be ignored, and any of these tables missing would raise an error.

So I guess your MySQL database does not have MRSAB table.

Please refer to this link: https://metacpan.org/pod/UMLS::Interface#INSTALL

@HodaMemar
Copy link
Author

Thank you for your patient.
I get the result!!!:))))
image

I reinstall the meta again. I think MSH is related to Mesh. and the problem is related to the resource list. in the first step of configuration, in this trial, I select "Exclude all level 0 except SNOMED", therefore MESH install too.

thank you again.

@victormurcia
Copy link

Thank you very much for the details. I finally downloaded umls::interface successfully. And install the umls-similarity too. The python code executes without any error. (I change the password in CuiFinder.pm too) but did not return any result. I chose and tested many pairs of cui from the mrconso table. But I can not see the result. Only one empty array returned. I will be very grateful if you tell me the problem In your opinion? image

Hi,

After you sucessfully installed the two Perl libaries, you should not change the source code of the CuiFinder.pl file in the folder of C:\Strawberry\perl\site\lib\UMLS\Interface. Then, please try again. Below is the figure that shows the result. Since you have installed them, the next step you should try:

1. run `cpanm --uninstall UMLS::Interface` and `cpanm --uninstall UMLS::Similarity` to remove any installation.

2. re-install the two libraries: run `cpanm UMLS::Interface --force` and `cpanm UMLS::Similarity --force` (must include `--force` flag)

3. now the  example code should work. (By the way, please check if there are actual UMLS data in your MySQL database before.)

Thanks.

Results are below: image cuis_umls_sim.txt

Hi there,

I'm having a nearly identical issue. When I run the sample script an empty array is returned.

I have installed both Perl modules concerning the UMLS library and I also have a local instance of the UMLS that includes both the tables concerning the Metathesaurus and the Semantic Network. I also have the DBD:mysql and DI Perl modules installed in my system.

I can connect to the UMLS MySQL database just fine with my own code independently from the package. However, I'm not sure if the Perl package is setting up the connection properly. Do you have any recommendations?

In case it helps, I'm running the program in VSCode, with Python 3.11.4, MySQL 8.1, and the full UMLS 2023AA distribution.

I've tried different CUI pairs, different metrics, reinstalling Strawberry Perl, reinstalling the Perl modules, and reinstalling the umls-similarity package.

I've attached screenshots showing that I can connect to the database and showing the described behavior.
umls sim test
umls conn

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants