cistrome / MIRA

Python package for analysis of multiomic single cell RNA-seq and ATAC-seq.
56 stars 8 forks source link

Exception: Error while scanning for motifs: /bin/sh: 1: moods-dna.py: not found #4

Closed shaistamadad closed 2 years ago

shaistamadad commented 2 years ago

Hi, I am running the following lines of code on a multiome dateset to get motif hits for the accessibility topics.

mira.tl.get_motif_hits_in_peaks(atac_data, genome_fasta='hg38.fa', 
                                pvalue_threshold=0.00001) # default is p<1e-5
#motif_scores = atac_model.get_motif_scores(atac_data)

However, I receive the following error:

Exception: Error while scanning for motifs: /bin/sh: 1: moods-dna.py: not found

I am following your tutorial: https://colab.research.google.com/drive/1m3PUc_X4IaddPyHfGhwakNXFPtKEEbgp?usp=sharing#scrollTo=-B-SQTtkovF4

And I created an environment following your README file to avoid package version conflicts. I used the command pip list to check for the Mira version I am using. I am using mira-multiome 0.1.3 and MOODS-python 1.9.4.1.

The python version in my environment is 3.7.12.

Thanks so much for this great resource and for your help!

AllenWLynch commented 2 years ago

Hi,

It seems that moods3 was not compiled correctly. You can test by trying to run that “moods-dna.py” command.

So to understand, the pip or Conda install caused version conflicts so you are working to assemble the packages yourself? If so, that may prove tricky and I would recommend installing MIRA first, then adding other packages that may be more flexible. If this is not possible, the issue may stem from using a mixture of pip and conda.

You may also try using the “environment.yaml” file from the git repo.

AL

On Feb 7, 2022, at 5:33 PM, shaistamadad @.***> wrote:



Hi, I am running the following lines of code on a multiome dateset to get motif hits for the accessibility topics.

mira.tl.get_motif_hits_in_peaks(atac_data, genome_fasta='hg38.fa', pvalue_threshold=0.00001) # default is p<1e-5

motif_scores = atac_model.get_motif_scores(atac_data)

However, I receive the following error:

Exception: Error while scanning for motifs: /bin/sh: 1: moods-dna.py: not found

I am following your tutorial: https://colab.research.google.com/drive/1m3PUc_X4IaddPyHfGhwakNXFPtKEEbgp?usp=sharing#scrollTo=-B-SQTtkovF4https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcolab.research.google.com%2Fdrive%2F1m3PUc_X4IaddPyHfGhwakNXFPtKEEbgp%3Fusp%3Dsharing%23scrollTo%3D-B-SQTtkovF4&data=04%7C01%7C%7C8d02fd311e1b42d6be7f08d9ea89e9a5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637798700319119143%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=x26zTConcIa3cJ34kjSltSDVzU169VmoHqZmKqh%2BzFw%3D&reserved=0

And I created an environment following your README file to avoid package version conflicts. I used the command pip list to check for the Mira version I am using. I am using mira-multiome 0.1.3 and MOODS-python 1.9.4.1.

The python version in my environment is 3.7.12.

Thanks so much for this great resource and for your help!

— Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcistrome%2FMIRA%2Fissues%2F4&data=04%7C01%7C%7C8d02fd311e1b42d6be7f08d9ea89e9a5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637798700319119143%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=PgR9xxVEqquAOeYMplaU2rVvncM2Lv593bQCMqvkFUg%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAE43JPB72HD4EPGIKRXSTN3U2BCE3ANCNFSM5NYYHYDQ&data=04%7C01%7C%7C8d02fd311e1b42d6be7f08d9ea89e9a5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637798700319119143%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=1Y1Z4HJqyaBLCMLEDJSCGXZsjqIqXZmvfx7%2FCYLI9Qs%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7C%7C8d02fd311e1b42d6be7f08d9ea89e9a5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637798700319119143%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=TwTQ4xVBwtpaOSpE8BAi68DgaUbpHqyNpMU4e%2FYOsX0%3D&reserved=0 or Androidhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7C%7C8d02fd311e1b42d6be7f08d9ea89e9a5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637798700319119143%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=R9Gk%2BzKc9kwKV8YpjHKVZbv5HCl%2FUZ8TAP5XLLrEAkY%3D&reserved=0. You are receiving this because you are subscribed to this thread.Message ID: @.***>

shaistamadad commented 2 years ago

My apologies my question wasn't clear. No I didn't try to install moods from the source package. I created the Mira environment using the following code:

conda create --name mira-env -c conda-forge -c liulab-dfci -c bioconda mira-multiome scanpy jupyter leidenalg
conda activate mira-env
python -m ipykernel install --user --name mira-env

and I am using the Mira-env kernel in my Jupyter notebook. And from what I understand the moods package is already installed in this environment. I checked to see if it has compiled correctly

Screenshot 2022-02-08 at 13 26 26
AllenWLynch commented 2 years ago

Hi,

So you don't actually need to run "pip install mira-multiome" in this case because you are also using conda to install the package. These installers don't typically work well together, especially, with compiled dependencies, so I would suggest starting with a fresh environment and just running one. Later, we can see the error message of

$ moods-dna.py

is different. This time, instead of command not found, it says "no matrix files given". This means that MOODS3 was compiled correctly this time and your original problem may be fixed!

Let me know if this is the case, AL


From: shaistamadad @.> Sent: Tuesday, February 8, 2022 7:30 AM To: cistrome/MIRA @.> Cc: AllenWLynch @.>; Comment @.> Subject: Re: [cistrome/MIRA] Exception: Error while scanning for motifs: /bin/sh: 1: moods-dna.py: not found (Issue #4)

My apologies my question wasn't clear. No I didn't try to install moods from the source package. I created the Mira environment using the following code:

pip install mira-multiome conda create --name mira-env -c conda-forge -c liulab-dfci -c bioconda mira-multiome scanpy jupyter leidenalg conda activate mira-env python -m ipykernel install --user --name mira-env

and I am using the Mira-env kernel in my Jupyter notebook. And from what I understand the moods package is already installed in this environment. I checked to see if it has compiled correctly

[Screenshot 2022-02-08 at 13 26 26]https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F58788471%2F152996633-0e73d3e8-57a6-4de0-a5e9-75f874c638c4.png&data=04%7C01%7C%7C9a6369bd37ee4799f33808d9eb072b0f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799238287704628%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Bw6xD8N5cmQFj1XyqFfbtTPOXmW%2Fr7injmh1RlayJMs%3D&reserved=0

— Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcistrome%2FMIRA%2Fissues%2F4%23issuecomment-1032611300&data=04%7C01%7C%7C9a6369bd37ee4799f33808d9eb072b0f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799238287704628%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=cO5csQlU5EsxOpaXXJlsPh0FIBuK68x77C1DS0LuVqM%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAE43JPARPISI6VXAVH44IMTU2ELHFANCNFSM5NYYHYDQ&data=04%7C01%7C%7C9a6369bd37ee4799f33808d9eb072b0f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799238287704628%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=QbkFJi8Pi06aYreKxyw0eqRGyewzDAVn%2F2vjsPP0wo8%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7C%7C9a6369bd37ee4799f33808d9eb072b0f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799238287704628%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=OJdsQesO0gWk7UJ98FRdMRioFDOY9nwiKkxMIMs%2Fv2o%3D&reserved=0 or Androidhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7C%7C9a6369bd37ee4799f33808d9eb072b0f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799238287860862%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=2hgGL37scHWtzn%2B1kArcVCdMYtX3Rhv2Lrslhnc95f4%3D&reserved=0. You are receiving this because you commented.Message ID: @.***>

shaistamadad commented 2 years ago

thanks very much for your reply. yes I get your point. which is why I went back and deleted the existing environment, and reinstalled mira using conda and still get the same error. If moods is compiling, I am not sure why I still get this error...

AllenWLynch commented 2 years ago

Okay so on a fresh install, you still see:

Exception: Error while scanning for motifs: /bin/sh: 1: moods-dna.py: not found,

even when running $ moods-dna.py from the command line?

AL


From: shaistamadad @.> Sent: Tuesday, February 8, 2022 1:41 PM To: cistrome/MIRA @.> Cc: AllenWLynch @.>; Comment @.> Subject: Re: [cistrome/MIRA] Exception: Error while scanning for motifs: /bin/sh: 1: moods-dna.py: not found (Issue #4)

thanks very much for your reply. yes I get your point. which is why I went back and deleted the existing environment, and reinstalled mira using conda and still get the same error. If moods is compiling, I am not sure why I still get this error...

— Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcistrome%2FMIRA%2Fissues%2F4%23issuecomment-1032991943&data=04%7C01%7C%7C58a6ce352bd946342ef708d9eb3af9af%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799460803812127%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=appshkusYo%2BdYzNpmxdfpKnHZByZ%2BbyndqGLWEW%2Bo6o%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAE43JPDTHKB5GDA5EFTSFC3U2FWV3ANCNFSM5NYYHYDQ&data=04%7C01%7C%7C58a6ce352bd946342ef708d9eb3af9af%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799460803812127%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=7L0kSLDQ1DMy9%2FPUx8xKRVEyoVzslnRSbZmeimufRKk%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7C%7C58a6ce352bd946342ef708d9eb3af9af%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799460803812127%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=u4GNAtBYhMax1vj%2FXFpkGzUzWFqz%2BEiDMudPlPRlJIQ%3D&reserved=0 or Androidhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7C%7C58a6ce352bd946342ef708d9eb3af9af%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799460803812127%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=hd9YsjGTG8zC%2Fsff4uOIi7qljx7UQVsvROpdNt0y1is%3D&reserved=0. You are receiving this because you commented.Message ID: @.***>

shaistamadad commented 2 years ago

That’s right. I ran moods-dna.py on commandline after fresh installation of Mira-env environment to see whether moods has compiled correctly. However I am doing the analysis on jupyter notebook with the Mira-env kernel: mira.tl.get_motif_hits_in_peaks(atac_data, genome_fasta='hg38.fa', pvalue_threshold=0.00001)

AllenWLynch commented 2 years ago

Oh, if the command runs in the command line but not from the Jupyter kernel, this is probably an issue with the ipython path. If you check the path to MOODS using:

$ which moods-dna.py

On the cmd line, And then check the notebook path with

sys.path

In the Notebook, you can confirm if the moods script is not in your notebooks path. This occurs very rarely and I’m sorry you’ve encountered this issue.

It may come down to restarting your notebook server or making sure the notebook server is initiated inside the Mira-env environment.

Let me know if this is the case. I am interested to see what conditions cause this installation error because I am unable to reproduce it.

Thanks, AL

On Feb 8, 2022, at 4:17 PM, shaistamadad @.***> wrote:



That’s right. I ran moods-dna.py on commandline after fresh installation of Mira-env environment to see whether moods has compiled correctly. However I am doing the analysis on jupyter notebook with the Mira-env kernel: mira.tl.get_motif_hits_in_peaks(atac_data, genome_fasta='hg38.fa', pvalue_threshold=0.00001)

— Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcistrome%2FMIRA%2Fissues%2F4%23issuecomment-1033070295&data=04%7C01%7C%7Cfb21abc64daf4d1e6c0c08d9eb486943%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799518497987246%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=qIaEZA07c5VpT9YS2ARb8u72f9ouW9fyPtFLbub1m18%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAE43JPH3IRSPXEEDCAK4CJLU2GB6PANCNFSM5NYYHYDQ&data=04%7C01%7C%7Cfb21abc64daf4d1e6c0c08d9eb486943%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799518497987246%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=nmtI3xFWboB7Yv1vBuCMFURx7bCFmodTMaFlvx7PZ2U%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7C%7Cfb21abc64daf4d1e6c0c08d9eb486943%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799518497987246%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=TJUY5LujFkJRai6xJuai9Gn2ASJSpntuGYR4Cm3jjcY%3D&reserved=0 or Androidhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7C%7Cfb21abc64daf4d1e6c0c08d9eb486943%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799518497987246%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=7yich2Ksx%2FdNn%2FjkbpcHS9ywPI0kEnYnN0%2Fgg6827BU%3D&reserved=0. You are receiving this because you commented.Message ID: @.***>

shaistamadad commented 2 years ago

yes the issue appears to be related to my ipython path although I am still not sure how to resolve that. But I managed to work around this problem by running the motif search from command line. Thanks so much for your help and prompt response. I really appreciate it.