Code Monkey home page Code Monkey logo

Comments (7)

edkerk avatar edkerk commented on August 16, 2024 1

@BenjaSanchez Looking in the history of getModelFromHomology it seems like that flag has been false since it's been introduced (0c280e5).

When removeGenes is called in getModelFromHomology, it's in a loop with n = number of template models. Changing the standardizeRules flag to true here would mean that if non-standard grRules would be encountered, it wouldn't necessarily be obvious for which of the models the grRules should be adjusted.

Instead, it might be better to run standardizeGrRules near the beginning of getModelFromHomology for all template models, like:

for i=1:length(models)
    fprintf('Standardizing grRules of template model with ID %s:\n',models{i}.id);
    [models{i}.grRules,models{i}.rxnGeneMat]=standardizeGrRules(models{i},false);
end

from raven.

BenjaSanchez avatar BenjaSanchez commented on August 16, 2024

@lucaz88 sounds like some grRule that the function canRxnCarryFlux is receiving might be non-compliant, as the line canIt = eval(geneRule); is failing. Have you tried as a first step in your pipeline running your old_model through standardizeGrRules.m to check if all rules are properly defined? The function should detect which rules are non-compliant and suggest you how to change them:

[grRules,rxnGeneMat,indexes2check] = standardizeGrRules(old_model);

If after changing those rules (if any) you still get the same error then please remove the final ; in line 103 of removeGenes and paste here which rule is creating the error. Let us know how it goes! :)

from raven.

lucaz88 avatar lucaz88 commented on August 16, 2024

Thanks a lot for the quick reply!!
So I ran the standardizeGrRules and it just throws me a warning for this rule:

grRule #4239: (311550) and (309435 or 311846) and (300949 or 307814) and (306012)

But it doesn't seem to be the problem. If I completely remove that rule and run the getModelFromHomology (without semicolon at line 103 of the removeGenes script) I got the following error:

....
geneRule =

'(false && true)'

geneRule =

'(false && true)'

geneRule =

'(AEZ63317)'

Error using eval
Undefined function or variable 'AEZ63317'.

Error in removeGenes>canRxnCarryFlux (line 104)
canIt = eval(geneRule);

Error in removeGenes (line 62)
canCarryFlux(j) = canRxnCarryFlux(reducedModel,grRule,genes{i});

Error in getModelFromHomology (line 312)
models{useOrderIndexes(i)}=removeGenes(models{useOrderIndexes(i)},~a,true,true,false);

So I looked into old_model.genes and I found this gene called 'AEZ63317'. There are also a bunch of other genes with non-numerical names (e.g. Phatr_10581, YP_874448.1,..) and they are of course included in the old_model.grRules so I cannot remove them. Do you think that if I change the gene IDs with new numeric-names I could bypass the issue?

from raven.

BenjaSanchez avatar BenjaSanchez commented on August 16, 2024

@lucaz88 no problem with having non-numerical gene IDs, I see the problem now. Your rule comes with extra parenthesis (AEZ63317), when it should be for proper parsing just AEZ63317. removeGenes requires for proper functioning that rules don't have those unnecessary parenthesis, and standardizeGrRules actually can take care of those. So I would then recommend:

  1. Either delete grRule #4239 or make it compliant: (311550 and 309435 and 300949 and 306012) or (311550 and 311846 and 300949 and 306012) or (311550 and 309435 and 307814 and 306012) or (311550 and 311846 and 307814 and 306012)
  2. Update the grRules in old_model to be compliant:
[grRules,rxnGeneMat,indexes2check] = standardizeGrRules(old_model);
old_model.grRules = grRules;
old_model.rxnGeneMat = rxnGeneMat;

And then run your pipeline. See how that goes :)

On a side note, @edkerk @simas232 @Hao-Chalmers I see that getModelFromHomology calls removeGenes with the flag standardizeRules = false. Is there a specific reason for that? If we would make it true then this problem would have been skipped and the function would have only errored at the conflicting grRule #4239

from raven.

lucaz88 avatar lucaz88 commented on August 16, 2024

@BenjaSanchez It worked! getModelFromHomology ran without problem, although the resulting draft model has no rxns or mets.
I saw in an old reply that you gave in gitter to @eileenhannas that gene IDs in the template model and in the related fasta file has to be identical. This means that the seq headers in the fasta have to match the template_model.genes field, right?

from raven.

edkerk avatar edkerk commented on August 16, 2024

@lucaz88 indeed, it is essential that the fasta seq headers match the template_model.genes identifiers. If you pull the latest devel version, getModelFromHomology will check whether the gene IDs match (but you already self identified that this was not the case for you).

from raven.

edkerk avatar edkerk commented on August 16, 2024

The code from #120 (comment) has now been implemented in devel PR #124.

from raven.

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.