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

NullPointerException during initialization for UCRelaxedCladeClockModel #2

Open
J-Moravec opened this issue May 22, 2019 · 7 comments

Comments

@J-Moravec
Copy link

J-Moravec commented May 22, 2019

java.lang.NullPointerException
	at mf.beast.evolution.branchratemodel.UCRelaxedCladeClockModel.setUpMap(Unknown Source)
	at mf.beast.evolution.branchratemodel.UCRelaxedCladeClockModel.initAndValidate(Unknown Source)
	at beast.util.XMLParser.initBEASTObjects(Unknown Source)
	at beast.util.XMLParser.parse(Unknown Source)
	at beast.util.XMLParser.parseFile(Unknown Source)
	at beast.app.BeastMCMC.parseArgs(Unknown Source)
	at beast.app.beastapp.BeastMain.main(Unknown Source)

Error 110 parsing the xml input file

validate and intialize error: null

Error detected about here:
  <beast>
      <run id='mcmc' spec='MCMC'>
          <distribution id='posterior' spec='util.CompoundDistribution'>
              <distribution id='likelihood' spec='util.CompoundDistribution'>
                  <distribution id='treeLikelihood.methylations' spec='TreeLikelihood'>
                      <branchRateModel id='branchRates' spec='mf.beast.evolution.branchratemodel.FlexibleLocalClockModel'>
                          <cladeClockModel id='rate.clade' spec='mf.beast.evolution.branchratemodel.UCRelaxedCladeClockModel'>

The difference (from what I understand) seems to be in setUpMap between UCRelaxedCladeClockModel and UCRelaxedMultiCladeClockModel.

In Clade model, the SetUpMap first goes into the leaf nodes and then increments BranchCladeCount. In MultiClade model, it does this in opposite way, which while it makes a little less sense to me, it works.

Well, kind of. With MultiCladeModel I get:

AbstractUCRelaxedClockModel: rate.clade using 0 rate categories to approximate rate distribution across branches.
Failed to load BEAGLE library: no hmsbeagle-jni in java.library.path
TreeLikelihood(treeLikelihood.methylations) uses BeerLikelihoodCore
  FilteredAlignment(bin.methylations): [taxa, patterns, sites] = [22, 643, 18705]
WARNING: the dimension of the parameter is 1 at the start of the run.
         The operator FixMeanMutationRatesOperator has no effect (if this does not change).
java.lang.IllegalArgumentException: howMany it too large: must be less than half the dimension of the parameter
	at beast.evolution.operators.SwapOperator.initAndValidate(Unknown Source)
	at beast.util.XMLParser.initBEASTObjects(Unknown Source)
	at beast.util.XMLParser.parse(Unknown Source)
	at beast.util.XMLParser.parseFile(Unknown Source)
	at beast.app.BeastMCMC.parseArgs(Unknown Source)
	at beast.app.beastapp.BeastMain.main(Unknown Source)

Error 110 parsing the xml input file

validate and intialize error: howMany it too large: must be less than half the dimension of the parameter

Error detected about here:
  <beast>
      <run id='mcmc' spec='MCMC'>
          <operator id='CategoriesSwapOperator.clade' spec='SwapOperator'>

Strangely, code runs when the created monophyletic taxon includes taxa in the same order as they are included in the alignment, starting from first taxa. Which might point to something, however the example file runs fine and doesn't have this pattern.

Did I misspecified something?

@4ment
Copy link
Owner

4ment commented May 24, 2019

Can you send me your xml files so I can debug it?

@J-Moravec
Copy link
Author

Ah, sorry, I thought that I added it to the github post, but it does not accept XML files.

Here:
https://www.dropbox.com/s/t0tucvinwcmaklv/FlexibleLocalClock.xml?dl=0

I went through example XML and those old example XMLs that are downloaded with BEAST, but are no longer on github, but couldn't find why it isn't working. Clock, priors, operators and logs are all set up as in example files.

@4ment
Copy link
Owner

4ment commented Jun 11, 2019

Sorry for the delay. I just had a look and it works for me with BEAST2.5. What is your BEAST version?

@J-Moravec
Copy link
Author

2.5.2.
So my file works on your computer, but not mine? But examples are working on your and mine? I hate these mysteries.

Thanks, I would like to leave this open for a while until I figure out why it doesn't work or someone else can chip in with a similar problem.

@4ment
Copy link
Owner

4ment commented Jun 11, 2019

Strange, what's the version of FLC in the package manager?

@J-Moravec
Copy link
Author

1.1.0, what appears to be latest.

@4ment
Copy link
Owner

4ment commented Jun 11, 2019

OK, I didn't realize that the XML you sent me actually worked because of the order of the taxa as you mentioned at the end of your first comment. If I select another set of taxa I get the same errors you described. The problem comes from SimpleRandomTree, it appears to be initialized differently from RandomTree.

As a quick fix you can replace this line
<init id="RandomTree.t:tree" spec="beast.evolution.tree.SimpleRandomTree" estimate="false" initial="@Tree.t:tree" taxa="@methylations"/>
with

<init id="RandomTree.t:tree" spec="beast.evolution.tree.RandomTree" estimate="false" initial="@Tree.t:tree" taxa="@methylations">
        <populationModel id="ConstantPopulation0.t:fluA" spec="ConstantPopulation">
            <parameter id="randomPopSize.t:fluA" name="popSize">1.0</parameter>
        </populationModel>
</init>

@4ment 4ment closed this as completed Jun 11, 2019
@4ment 4ment reopened this Jun 11, 2019
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