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

Template selection during model reconstruction #111

Open
ctseto opened this issue Mar 31, 2017 · 4 comments
Open

Template selection during model reconstruction #111

ctseto opened this issue Mar 31, 2017 · 4 comments

Comments

@ctseto
Copy link

ctseto commented Mar 31, 2017

Having problems with model template selection during reconstruction.

This involves the params['template_model']. Despite my attempt to pass a custom parameter, it consistently defaults to /chenry/public/modelsupport/templates/GramNegative.modeltemplate . Even attempts to pass a different /chenry/ modeltemplate defaults to GramNegative.

@samseaver
Copy link
Contributor

Do you still have this problem, I've used this successfully:

my $parameters = { genome => "/seaver/plantseed/Athaliana-TAIR10/genome",
                   templatemodel => "/plantseed/Data/plant.modeltemplate"}

@samseaver
Copy link
Contributor

Actually, looking at what you wrote, you're using a hyphen in the parameter name.

@ctseto
Copy link
Author

ctseto commented Apr 19, 2017

To clarify, I am using Mike Mundy's mackinac to reconstruct modelseed models. There, reconstruction is invoked by:

mackinac.reconstruct_modelseed_model('1679.26',template_reference='/mmundy/public/modelsupport/templates/MicrobialPositiveResolved.modeltemplate')

There's a few layers of abstraction between Mackinac and what gets sent to ModelSEED.

template_reference is specified in input, attached to a dict, which is then passed to ModelSEED.

    request_data = dict()
    request_data['method'] = self.name + '.' + method #where in our case, method is 'ModelReconstruction'
    request_data['params'] = params #in our case, params['template_model'] is a string corresponding to the location of the desired template
    request_data['version'] = '1.1'
    request_data['id'] = '1'

The server request is simply:
requests.post(self.url, data=json.dumps(request_data), headers=self.headers, timeout=timeout)

I was assuming that something broke in the chain between Mackinac and what is being passed to the server and back, but instead of failing verbosely it may just be defaulting, since template_reference being output is:

'template_ref': u'/chenry/public/modelsupport/templates/GramNegative.modeltemplate'

@samseaver
Copy link
Contributor

samseaver commented May 1, 2017

I just tested this, by passing a separate template with the template_model parameter, and it worked for me, here's a summary of my output before and after:

seaver@twig:~$ ws-cat /seaver/plantseed/Athaliana-TAIR10/model --shock | perl -MJSON -lne 'use JSON;print to_json(from_json($_),{pretty=>1})' | grep template_ref
   "template_ref" : "/chenry/public/modelsupport/templates/plant.modeltemplate||",
seaver@twig:~$ ws-cat /seaver/plantseed/Athaliana-TAIR10/model --shock | perl -MJSON -lne 'use JSON;print to_json(from_json($_),{pretty=>1})' | grep template_ref
   "template_ref" : "/seaver/plantseed/Templates/plant.modeltemplate||"

By output, I was assuming that you're saying that you checked inside the resulting model.

I ran ModelReconstruction directly using ProbModelSEEDHelper.pm, are you able to write a piece of code that calls this directly, and confirm that it works for you?

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

2 participants