Saturday, December 17, 2011

Comment on update to plotSimmap()

I just wanted to make a quick comment on my recent update to the phytools function plotSimmap() which now allows it to plot both "phylo" and "multiPhylo" SIMMAP style trees. As a preliminary, an object of class "multiPhylo" is just a list of "phylo" objects with class(...)<-"multiPhylo". To see that this is true, just make a list of "phylo" objects, set the class to "multiPhylo", and then apply any function that accepts "multiPhylo" objects to this list.

For instance, if we want to simulate 100 pure-birth trees we might want to use the geiger function birthdeath.tree. The only problem is it only simulates one tree at a time. To generate a set of (say) 100 pure-birth trees with 100 taxa, we can just do the following:

> require(geiger)
> trees<-replicate(100,birthdeath.tree(b=1,d=0,taxa.stop=100),simplify=F)
> "multiPhylo"->class(trees)
> plot.multiPhylo(trees) # we can also use the generic plot(...) here


Now, the way that plot.multiPhylo is simply by looping over each element in the "multiPhylo" object and calling the function plot.phylo(), after first setting the graphical parameter par(ask=TRUE) which will force R to ask the user for input (click or ENTER) before drawing each new tree. We can easily replicate this in plotSimmap() as follows:

plotSimmap<-function(tree,...){
   if(class(tree)=="multiPhylo"){
      par(ask=TRUE)
      for(i in 1:length(tree)) plotSimmap(tree[[i]],...)
   } else { ...


If we do this, it works great! So for instance (after getting the new version of phytools here):

> require(geiger); require (phytools)
> tree<-rescaleTree(birthdeath.tree(b=1,d=0,taxa.stop=100),1)
> mtree<-sim.history(tree,Q=matrix(c(-1,1,1,-1),2,2))
> mtrees<-make.simmap(tree,mtree$states,nsim=10)
> plotSimmap(mtrees)
Waiting to confirm page change...


Very cool.

26 comments:

  1. hello to all of you. it is my first time that I have a comment on your post but I really wanted to say how great you are working. I am so happy for this post from your website.
    Seo Service Provider In India

    ReplyDelete
  2. Nutra Trials defines personal characteristics of different health products including skincare, weight loss, muscle and male enhancement. The study presented here is briefly described for reader convenience and to deliver them assurance with health standards. The best possible answers are given here regarding the selection of an ideal supplement or cream or serum that possibly remains to be safe for health and do not cause any side effects.

    ReplyDelete
  3. Fantastic article to go through, I would appreciate the writer's mind ( fmovies.in.net ) and the skills he has presented this great article to get its look in better style. Fmovies

    ReplyDelete
  4. Hi, I am Pallavi thank you for this informative post.Fantastic article to go through,I would appreciate the writer's
    123movies

    ReplyDelete
  5. We are Get health tips to lead healthy life everyday.health information and medical updates on healthy life ideas. latest health news, articles and studies on all health. NutraT line

    ReplyDelete
  6. Whereas, when you choose to cure your sexual health problems by all natural means it said to have no side effects of it. Also, Alpha Rise Male Enhancement is clinically proven and recommended by the doctors. The customers that have used this natural male enhancement supplement before are quite happy with its results and now have a better sexual life. https://www.smore.com/mqpr0-alpha-rise-male-enhancement

    ReplyDelete
  7. Alpha Rise Male Enhancement is a 100% natural remedy to your problem and it will boost your sex life through the roof. To inform and educate you more about this product here is an in-depth review of this natural male enhancement supplement. Alpha Rise Male Enhancement

    ReplyDelete
  8. Top Wellness Guru is a health-related website, with continuous use of this you will find important tips to make your health even better, we have created this site with the help of some other helpers, all those helpful and especially faithful. We are able to share the solution of the health problems with the help of them, which is faced by you on daily basis; this site is completely honestly created. And the articles shared by us are also written in the correct manner, no errors have been found in these articles from us, and every knowledge shared with you have been prepared our special health experts. http://topwellnessguru.com

    ReplyDelete
  9. Supplement Doctor - Search/Buy Health & Wellness Products! Your post is so informative and i got everything from it. Thanks again! https://supplement-doctor.com/

    ReplyDelete
  10. Supplement Doctor - Search/Buy Health & Wellness Products! Your post is so informative and i got everything from it. Thanks again! https://supplement-doctor.com/

    ReplyDelete



  11. True Light Keto ia an extremely innovative weight loss supplement that’s formulated with high-quality ketone ingredients.
    When you have this supplement, your system raises digestion speed, the metabolism rate, burns off fat in the pace that is rapid.
    True Light Keto

    ReplyDelete
  12. Hello, I am Prithvika malhotra thank you for this informative post. That is a great job. Wish you more success.Thank you so much and for you all the best. Takes Down
    123movies

    ReplyDelete
  13. TimesForHealth is Online Health & Wellness Program! I came on the your post and i got so information here. Thanks for the valuable post. https://www.timesforhealth.com/

    ReplyDelete
  14. TecSmash is your ultimate source of Technology news and Make Money Online product reviews. We research and review all Tech, MMO, Biz Opp and IM products.TecSmash

    ReplyDelete

  15. Healrun is a health news blog we provide the latest news about health, Drugs and latest Diseases and conditions. We update our users with health tips and health products reviews. If you want to know any information about health or health product (Side Effects & Benefits) Feel Free To ask HealRun Support Team.

    ReplyDelete
  16. We are here to give you a complete review on the Parallel Profit project by Steve Clayton and Aidan Booth. If you are someone from the field you would already be familiar with these two names, for those of who are new. Parallel Profits Bonuses

    ReplyDelete

  17. Pilpedia is supplying 100 percent original and accurate information at each moment of time around our site and merchandise, and the intent is to improve the usage of good and pure health supplement. For More Info please visit Pilpedia online store.

    ReplyDelete
  18. This comment has been removed by the author.

    ReplyDelete
  19. Tevida helping to improve blood flow to the erectile tissue of the penis. During excitation, the arteries in the penis relax and expand, allowing more blood to flow to the erectile tissues. These arteries then expand
    https://www.supplementsforfitness.com/tevida/

    ReplyDelete
  20. Best softwares for Internet Marketers and legitimate make money online opportunities cxyrc

    ReplyDelete

  21. TEVIDA's™ dual action formula not only gives you an instant surge in sexual power & performance - but also treats the

    root cause of sexual dysfunctions, ensuring that you are able to satisfy your partner, consistently! Made with herbal

    extracts and active botanicals, TEVIDA™ is completely safe to use and is free from any harmful side effects.Triple

    IntenSity Male Enhancement For maximum ResultsThe pro-sexual nutrient matrix in TEVIDA™ helps boost the 3S's of Sex -

    Size, Stamina & Satisfaction, helping you peak perform and pleasure your partner just like you did in your 20's!

    TEVIDA™ is proudly made in the United States of America at a certified manufacturing facility to meet statutory

    industry standards.

    https://aboutprosolution.com/male-enlargement-pill/
    https://www.youtube.com/watch?v=uf7LCDxKCtU

    ReplyDelete

  22. Retro vigor reviews Our product backed with a 100% Satisfaction Guarantee!THE NUMBER ONE MALE ENHANCEMENT PILL IN THE CANADAOrder Retro Vigor Today! Experience Sexual Power, Pleasure & Performance Powerful Ingredients For Bigger ResultsL-ArginineStimulates nitric oxide production to boost blood circulation to the penis helping achieve biggers and stronger erections.Ginko Biloba ExtarctAn aphrodisiac, it helps boost male sexual drive and libido. It also supports healthy testosterone levels.Muira Puama ExtractCalled the ""Viagra of Amazon"", this herbal extract replenishes sexual energy stores for improved strength and stamina.Asian Red Ginger ExtractsPositively influences mood patterns to reduce stress and promote relaxation, enabling men to perform at their peak.Saw Palmetto BerryHelps increase staying power ensuring you and your partner enjoy longer sessions with intense orgasms.
    retro vigor testo
    retro vigor testo buy
    retro vigor scam
    retro vigor where to buy

    ReplyDelete
  23. My name is JOHN ROBET am from SA I want to share a testimony of how Dr.Olu herbal mixture cream saves me from shame and disgrace, my penis was a big problem to me as the size was really so embarrassing,and i was also having weak erection problem. I can't make love to my wife and my penis was just too small a full grown man like me having 4 inches penis and to worsen it i don't last in sex i cant even last two minutes it was really a thing of shame to me. My wife was really tired of me because my sex life was very poor,she never enjoyed sex,i was always thinking and searching for solutions everywhere until when i saw a testimony of how Dr.Olu herbal mixture cream have been helping people regarding their sex life, so i decided to give him a try and to my greatest surprise in less than one week of taking the herbs my penis grow to 8 inches i couldn't believe my eyes and as i speak now my penis is now 8 inches and i do not have week erection again. I can make love to my wife longer in bed. And my marriage is now stable,my wife now enjoy me very well in bed. can contact him drolusoltionhome@gmail.com {) or call or what-apps him through +2348140654426 and also his you-tube page https://youtu.be/VMTo3gqbO08 . .he also specialize on the following things

    BREAST ENLARGEMENT
    BREAST LIFT & REDUCTION
    PENILE/PENIS ENLARGEMENT
    GENERAL BODY SLIMMING
    HIPS & THIGH REDUCTION
    REGAIN VIRGINITY BACK
    Thanks for the Enlarging my penis sir, you indeed save my marriage...I am really grateful sir,

    ReplyDelete
  24. Can any anyone explain why even regardless of hard exercise sessions in the wellness focus, you can't secure the fantasy body while another person can get it by practicing for half of the time that you do? It is conceivable this is because of the inadequacy of the essential male hormone in your body. This hormone is called testosterone and isn't something anybody knows. Testosterone confers the man characters to a man.

    https://supplementmegastore.net/

    ReplyDelete