Giter VIP home page Giter VIP logo

Comments (7)

gavinmdouglas avatar gavinmdouglas commented on July 21, 2024 1

Thanks for reporting this bug as well. There was a typo in how the temp directory name was being passed to the wrapper for MinPath. It's fixed now in the latest push. You could also specify the name of the tmp directory to use yourself with the --tmp_dir option and it should work.

from picrust2.

jjmmii avatar jjmmii commented on July 21, 2024

An update: I converted MinPath1.4.py from Python 2 code to Python 3 using 2to3, and got it to run. Now I'm encountering this error: lpx_add_cols: ncs = 0; invalid number of columns. The preceding stdout lines tell me that W0-PIS10005_minpath_out.txt is empty (where W0-PIS10005 is one sample's name):

now write mps file..
original ortholog=73 found-in-the-fam-list=0 found-in-the-fam-mapped-to-pathway=0
End of PrintMPS
now run command = /home/ubuntu/MinPath//glpk-4.6/examples/glpsol minpath_tmp_x4hxwnuy/W0-PIS10005_minpath.mps -o minpath_tmp_x4hxwnuy/W0-PIS10005_minpath.mps.LPout
load_mps: reading LP data from `minpath_tmp_x4hxwnuy/W0-PIS10005_minpath.mps'...
load_mps: name `PATH'
load_mps: 1 rows
load_mps: 0 columns
load_mps: 0 non-zeros
load_mps: 0 right-hand side vector(s)
load_mps: 0 range vector(s)
load_mps: 0 bound vector(s)
load_mps: 7 cards were read

I checked the input file W0-PIS10005_minpath_in.txt is not empty.
Do you have any ideas about this? Looking forward to discussing with you.

Best,
Jamie

from picrust2.

gavinmdouglas avatar gavinmdouglas commented on July 21, 2024

Hi Jamie,

Sorry for the confusion about the MinPath version - I originally was thinking of using v1.4 and then switched back to v1.2. I made a few updates to the run_minpath.py workflow today (see here: #8). In particular, the MinPath12hmp.py script is now part of the repository so you don't need to install MinPath yourself. Also, note that I have made some custom mapping files which are listed in that pull request. After updating your local version to the latest version do you still have this problem?

Edit:
Also - I'm not sure what caused that bug after using 2to3 on that script, but I noticed a number of formatting issues after using that command myself previously... so I think it's likely due to spacing issues after converting to Python 3.

from picrust2.

jjmmii avatar jjmmii commented on July 21, 2024

Thank you for your quick response Gavin. After cloning the latest version, I use your custom mapping files, and this is the command:
$ run_minpath.py -i OUT_PREFIX.genefamilies.biom -m ~/downloads/picrust2/MinPath/ec2metacyc_picrust_prokaryotic.txt -o Pathway_abundances.tsv --keep_tmp
And then error:

Traceback (most recent call last):
  File "/home/ubuntu/miniconda2/envs/picrust2-dev/bin/run_minpath.py", line 6, in <module>
(...truncated)
  File "/home/ubuntu/downloads/picrust2/picrust2/run_minpath.py", line 72, in minpath_wrapper
    minpath_in = str(tmp_dir + "/" + sample_id + "_minpath_in.txt")
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

This is another Python2 to 3 issue I believe: https://stackoverflow.com/questions/15036594/python-3-3-typeerror-unsupported-operand-types-for-nonetype-and-str
I located the line minpath_in = str(tmp_dir + "/" + sample_id + "_minpath_in.txt" in ~/downloads/picrust2/picrust2/run_minpath.py but not sure how to fix it. Please look into this issue. Thank you so much.

Update: With help of my colleague I am able to attach pdb and found that tmpdir is empty value:

> /home/ubuntu/downloads/picrust2/picrust2/run_minpath.py(73)minpath_wrapper()
-> minpath_in = str(tmp_dir + "/" + sample_id + "_minpath_in.txt")
(Pdb) tmp_dir
(Pdb) sample_id
'W0-PIS10005'
(Pdb)

Something wrong when setting tmp_dir?

from picrust2.

jjmmii avatar jjmmii commented on July 21, 2024

Thank you Gavin! The above error is gone. And I am getting the next error, haha XD :

Error when running glpsol from MinPath.

Error running this command:
/home/ubuntu/downloads/picrust2/MinPath/MinPath12hmp.py -any minpath_tmp_vhn_p7b2/W0-PIS10005_minpath_in.txt -map /home/ubuntu/downloads/picrust2/MinPath/ec2metacyc_picrust_prokaryotic.txt -report minpath_tmp_vhn_p7b2/W0-PIS10005_minpath_report.txt -details minpath_tmp_vhn_p7b2/W0-PIS10005_minpath_details.txt -mps minpath_tmp_vhn_p7b2/W0-PIS10005_minpath.mps

I tried running just the subcommand from the above snippet's last line but couldn't get any verbose output about glpsol either:

(...truncated)
>>>pathway-1007[1008; PWY0-781] fam=25 unique-fam=0
pathway-1008[1009; SULFATE-CYS-PWY] fam=9
>>>pathway-1008[1009; SULFATE-CYS-PWY] fam=9 unique-fam=0
now write mps file..
original ortholog=712 found-in-the-fam-list=440 found-in-the-fam-mapped-to-pathway=440
End of PrintMPS
Error when running glpsol from MinPath.

I seem to be stuck at around the same point as my first comment above #7 (comment) .
I found a related thread in HUMANn Google group: https://groups.google.com/forum/#!msg/humann-users/MSVmXC7DSW0/10SnjM3HCQAJ which says the solution is to update glpsol. I wonder if glpsol is part of your repository? Also, which glpsol returned no results when picrust2-dev environment is activated or not. find "*glpsol*" under ~/miniconda2/envs/picrust2-dev also returned no results.

Thanks a lot for following up on these bugs.
-Jamie

from picrust2.

gavinmdouglas avatar gavinmdouglas commented on July 21, 2024

from picrust2.

jjmmii avatar jjmmii commented on July 21, 2024

Oh I see, I just found the respective libraries to install glpk on Ubuntu here. Anyway it's good that you put it into the environment.
After solving this, I successfully ran PICRUSt2 through all 4 steps! 😃 Thank you very much!! 😄

from picrust2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.