DyogenIBENS / Agora

Algorithm For Gene Order Reconstruction in Ancestors
Other
70 stars 15 forks source link

how to use ALL.reformatGeneFamilies.py #4

Closed ShuaiNIEgithub closed 2 years ago

ShuaiNIEgithub commented 2 years ago

Hi, there

I have successfully installed Agora. And I got an error while running first step of "agora-basic.py" with the example data. Could you please give me some advice for running it?

Bests.

This is my code:

src/ALL.reformatGeneFamilies.py \
example/data/Species.nwk \
example/data/orthologyGroups/orthologyGroups.%s.list \
-IN.genesFiles=example/data/genes/genes.%s.list \
-OUT.ancGenesFiles=example/results/ancGenes/all/ancGenes.%s.list.bz2 \
-OUT.genesFiles=example/results/genes/genes.%s.list.bz2 \
  > example/results/GeneTreeForests.withAncGenes.nhx.bz2 \
  2> example/results/ancGenes/ancGenes.log

The ERROR:

----------------------------------------------------------------------------
| Key               | Values                                               |
----------------------------------------------------------------------------
| speciesTree       | example/data/Species.nwk                             |
| orthologyGroups   | example/data/orthologyGroups/orthologyGroups.%s.list |
| IN.genesFiles     | example/data/genes/genes.%s.list                     |
| OUT.ancGenesFiles | example/results/ancGenes/all/ancGenes.%s.list.bz2    |
| OUT.genesFiles    | example/results/genes/genes.%s.list.bz2              |
----------------------------------------------------------------------------
Renaming the genes of M1 ... 21160 OK
Renaming the genes of M2 ... 22697 OK
Renaming the genes of M3 ... 19466 OK
Renaming the genes of M4 ... 16736 OK
Renaming the genes of M5 ... 17805 OK
Renaming the genes of A0 ... Traceback (most recent call last):
  File "/home/nieshuai/bin/Agora-master/src/ALL.reformatGeneFamilies.py", line 50, in <module>
    fi = utils.myFile.openFile(inputPath, "r")
  File "/home/nieshuai/bin/Agora-master/src/utils/myFile.py", line 175, in openFile
    f = open(nom, mode)
FileNotFoundError: [Errno 2] No such file or directory: 'example/data/genes/genes.A0.list'
muffato commented 2 years ago

Dear Shuai NIE,

Thank you for the report. I know what's going on. We've mostly used this script to test Agora against simulated data, where the ancestral genomes are known, and are used to tell whether the orthology groups have 'names' alongside the gene content. The script shouldn't expect the ancestral genes to be always present.

Could you please try the branch bugfix/4 ? On it, I can run this command, and it will just skip the files that are not present.

$ src/ALL.reformatGeneFamilies.py example/data/Species.nwk example/data/orthologyGroups/orthologyGroups.%s.list.bz2 -IN.genesFiles=example/data/genes/genes.%s.list.bz2 -OUT.ancGenesFiles=example/results/ancGenes/all/ancGenes.%s.list.bz2 -OUT.genesFiles=example/results/genes/genes.%s.list.bz2   > example/results/GeneTreeForests.withAncGenes.nhx.bz2
--------------------------------------------------------------------------------
| Key               | Values                                                   |
--------------------------------------------------------------------------------
| speciesTree       | example/data/Species.nwk                                 |
| orthologyGroups   | example/data/orthologyGroups/orthologyGroups.%s.list.bz2 |
| IN.genesFiles     | example/data/genes/genes.%s.list.bz2                     |
| OUT.ancGenesFiles | example/results/ancGenes/all/ancGenes.%s.list.bz2        |
| OUT.genesFiles    | example/results/genes/genes.%s.list.bz2                  |
--------------------------------------------------------------------------------
Renaming the genes of M1 ... 21160 OK
Renaming the genes of M2 ... 22697 OK
Renaming the genes of M3 ... 19466 OK
Renaming the genes of M4 ... 16736 OK
Renaming the genes of M5 ... 17805 OK
Renaming the genes of A0 ... SKIPPING
Renaming the genes of A1 ... SKIPPING
Renaming the genes of A2 ... SKIPPING
Renaming the genes of A3 ... SKIPPING
Updating the ancestral families of A0 ... adding names ... 16274 OK
Updating the ancestral families of A1 ... adding names ... 17339 OK
Updating the ancestral families of A2 ... adding names ... 15569 OK
Updating the ancestral families of A3 ... adding names ... 18119 OK

Once you confirm it works, I'll move the commit to the main branch.

Regards, Matthieu

ShuaiNIEgithub commented 2 years ago

Hi, Matthieu

Thank you for your prompt reply. I tested the new “ALL.reformatGeneFamilies.py”, and “agora-basic.py”, and they both worked successfully!

Once again, I would like to express my gratitude to you.

Bests, Shuai

muffato commented 2 years ago

Great, thank you for confirming. I've merged the changes to master

Have a great day, Matthieu