Giter VIP home page Giter VIP logo

speciesnetwork's People

Contributors

alexeid avatar genomescale avatar jordandouglas avatar walterxie avatar zhangchicool avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

speciesnetwork's Issues

In GeneTreeInSpeciesNetwork, use TreeInterface instead of EmbeddedTree

As @zhangchicool mentioned to me, SpeciesNetwork has problems with many different gene trees. One simple way around this might be to use a tree selector class, with inputs List<TreeInterface> trees and IntegerParameter index (1-dimensional) and behaving as if it was trees.get().get(index.getValue()) for TreeInterface purposes. Having one of these for each gene tree, and uniform integer operators to change their values of index, trivially implements a reversible jump method that groups genes into groups with identical gene trees. (This may have bad convergence, but I'd be happy to at least try it out.)

However, this tree selector class would not be a useful subclass of Tree, so it would not work as input for GeneTreeInSpeciesNetwork via EmbeddedTree. Given the possible issue #4 with embedding initialization and this use case, might it be prudent to drop EmbeddedTree and permit GeneTreeInSpeciesNetwork to accept a TreeInterface as its geneTree input and take over the responsibility to track the Embedding in its own methods?

Reload previously generated xml into BEAUti

The redundant blocks added look like this:

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

nextSpeciesBranchNumber < 0

After wondering why I get so many NullPointerExceptions,

	at speciesnetwork.GeneTreeInSpeciesNetwork.recurseCoalescentEvents(GeneTreeInSpeciesNetwork.java:158)
	at speciesnetwork.GeneTreeInSpeciesNetwork.recurseCoalescentEvents(GeneTreeInSpeciesNetwork.java:158)
	at speciesnetwork.GeneTreeInSpeciesNetwork.recurseCoalescentEvents(GeneTreeInSpeciesNetwork.java:158)
	at speciesnetwork.GeneTreeInSpeciesNetwork.recurseCoalescentEvents(GeneTreeInSpeciesNetwork.java:158)
	at speciesnetwork.GeneTreeInSpeciesNetwork.recurseCoalescentEvents(GeneTreeInSpeciesNetwork.java:158)
	at speciesnetwork.GeneTreeInSpeciesNetwork.recurseCoalescentEvents(GeneTreeInSpeciesNetwork.java:158)
	at speciesnetwork.GeneTreeInSpeciesNetwork.update(GeneTreeInSpeciesNetwork.java:117)
	at speciesnetwork.GeneTreeInSpeciesNetwork.computeCoalescentTimes(GeneTreeInSpeciesNetwork.java:96)
	at speciesnetwork.MultispeciesCoalescent.calculateLogP(MultispeciesCoalescent.java:90)
	at beast.core.util.CompoundDistribution.calculateLogP(CompoundDistribution.java:114)
	at beast.core.MCMC.propagateState(MCMC.java:496)
	at beast.core.MCMC.doLoop(MCMC.java:383)
	at beast.core.MCMC.run(MCMC.java:353)
	at beast.app.BeastMCMC.run(BeastMCMC.java:357)
	at beast.app.beastapp.BeastMain.<init>(BeastMain.java:113)
	at beast.app.beastapp.BeastMain.main(BeastMain.java:659)

I noticed the assertions in

assert (nextSpeciesBranchNumber >= 0);

and below and activated assertions in the JVM, which led to Exception in thread "main" java.lang.AssertionError at speciesnetwork.GeneTreeInSpeciesNetwork.recurseCoalescentEvents(GeneTreeInSpeciesNetwork.java:147).

I don't know how traversal numbers should behave and what the getDirection function is supposed to do,

        final int traversalNodeNumber = speciesNetworkNode.getTraversalNumber();
        final Integer nextSpeciesBranchNumber = geneTree.embedding.getDirection(geneTreeNodeNumber, traversalNodeNumber);

but the calls above that look reasonable.
@zhangchicool I sent you my XML files that produce this issue, in case that might help track down the problem because it's a user error.

Setting up starting trees

I'm trying to set some constraints in gene trees, but in order to get a non -Inf likelihood I have to also set compatible starting trees, as we would do in e.g. BEAST or StarBEAST. But I'm struggling to accomplish that. Basically what I did was follow a (working) xml file generated for BEAST and added a couple of <init> tags with spec="beast.util.TreeParser" inside <run>, just before the <distribution id="posterior"> tag. Everything seems to be ok, except that I'm getting this error:

Error 110 parsing the xml input file

validate and intialize error: class beast.util.TreeParser cannot be cast to class speciesnetwork.EmbeddedTree (beast.util.TreeParser and speciesnetwork.EmbeddedTree are in unnamed module of loader beast.util.BEASTClassLoader @7229724f)

Am I in the right path? Is there another class I should use for that? And how?

Thank you so much!

Do invariant sites affect the results?

Dear developers,

I am wondering whether invariant sites affect the results.
Although I read some suggestions that I should include invariant sites in the google group of "beast-users", I want to know whether that case is the same to SpeciesNetwork.

I randomly collected 100 successive SNPs in each chromosomes from VCF file.
Does it affect the final result in SpeciesNetwork?

Best regards.

Changing turnOverRate and netDiversification does not affect BirthHybridizationModel

As far as I can see, the code that sets ν and λ from the input parameters

if (birthRateInput.get() != null && hybridRateInput.get() != null) {
lambda = birthRateInput.get().getValue();
nu = hybridRateInput.get().getValue();
}
else if (netDiversification.get() != null && turnOverInput.get() != null) {
lambda = netDiversification.get().getValue() / (1 - turnOverInput.get().getValue());
nu = lambda * turnOverInput.get().getValue();
} else {
throw new RuntimeException("Either specify speciationRate and hybridizationRate " +
"OR specify netDiversification and turnOver.");
}
assert (lambda > 0.0 && nu > 0.0);

is exectuted only at initialization, which means that ν and λ are fixed througout an MCMC run. Setting priors on them would therefore not have any influence on the sampling.

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.