Friday, 20 January 2017

How to download an R package from github...

https://cran.r-project.org/web/packages/githubinstall/vignettes/githubinstall.html

Need dev tools first:

library(devtools)

then use the install_github() function
install_github("hadley/dplyr")

There is a difference between install.packages() and install_github() in the required argument. install.packages() takes package names, while install_github() needs repository names. It means that when you want to install a package on GitHub, you must remember its repository name correctly.


I want to work out how to load ggphylo....
https://github.com/gjuggler/ggphylo



Monday, 16 January 2017

Some R life expectancy resources...

I did a search and found the following interesting things:


  • https://www.r-bloggers.com/building-a-life-table/
  • https://www.r-bloggers.com/change-in-life-expectancy-animated-with-geo-charts/
  • https://www.r-bloggers.com/escalating-life-expectancy/
    • package: lifespan
  • http://stackoverflow.com/questions/28633849/life-expectancy-survival-package-r
  • https://www.r-bloggers.com/eu-life-quality-geo-report/


I can find papers that show hazard ratios and some which calculate changes in life expectancy. 

However, I'm not clear how to relate all this to an infographic. 

Inspiration from Spiegelhalter's blog: https://understandinguncertainty.org/davidsblog


Tuesday, 3 January 2017

More about trees but not finished yet....

More understanding about phylogenetic trees.

Learned how to rotate trees with

plot.phylo(ksTree, "u", 
           use.edge.length = FALSE,
           tip.color = tipcol,
           cex = 0.5,
           rotate.tree = -90)

Still need to do lots of things but making progress albeit it slowly!
# this rotate.tree is good.
# BUT some swapping of clades will have to be done too.
# some manual organisation of this will be done with the full version
# to find clade numbers for the full tree.
# then will colour and label.....

# then extract my 'favourites' and add them back.
# once basic tree is done and I'm happy with it then other things can be done...



# TO DO
# Draw full tree.
# add node numbers to identify the 8 key 'clades' and nodes for them...
# add colours for clade (somehow...)
# add clade labels
# add rotate clades to have correct for Science paper...

# need the TK at the top (rotate further) for Cell Signaling Diagram
# also need background and more sytlised lines - how???


MAYBE LOSING TRACK OF MY SCRIPT
SOME SIMPLIFYING NECESSARY!!!!



http://www.sthda.com/english/wiki/beautiful-dendrogram-visualizations-in-r-5-must-known-methods-unsupervised-machine-learning

http://127.0.0.1:15993/library/phytools/html/cladelabels.html

https://sites.google.com/site/phylogeneticworkshop2/labs/plotting-phylogenies

# this is good!!!
https://ecomorph.wordpress.com/2014/10/09/phylogenetic-trees-in-r-4/

https://holtlab.net/2015/10/03/plotting-trees-data/

http://127.0.0.1:15993/library/phytools/html/plotSimmap.html

http://blog.phytools.org/search?q=clade

http://stackoverflow.com/questions/34089242/phylogenetic-tree-tip-color

https://cran.r-project.org/web/views/Phylogenetics.html

https://www.biostars.org/p/81241/

http://127.0.0.1:15993/library/ape/html/nodelabels.html

http://127.0.0.1:15993/library/phytools/html/plotTree.html

http://www.phytools.org/eqg/Lecture_5.1/Revell.ancestral-state-reconstruction.pdf

https://www.r-phylo.org/wiki/HowTo/DataTreeManipulation

https://climateecology.wordpress.com/2012/07/22/r-for-ecologists-phylogenies-in-r/#comments




Lancet issue about physical activity - might have useful data for visualisation

http://www.thelancet.com/series/physical-activity-2016

Trees and the like...

So I am trying to figure out how to draw phylogenetic trees and add colour and other data to them.

This is a very rich area with lots of R packages and info....

Relevant packages:

APE
Phylo Tools



A key point is that there are various classes of trees:


The plotting techniques vary depending on the types of tree
  • http://www.sthda.com/english/wiki/beautiful-dendrogram-visualizations-in-r-5-must-known-methods-unsupervised-machine-learning
  • http://bioconductor.org/packages/release/bioc/manuals/ggtree/man/ggtree.pdf
  • http://stackoverflow.com/questions/18802519/label-and-color-leaf-dendrogram-in-r
  • https://rpubs.com/gaston/dendrograms

More about ggtree
  • http://onlinelibrary.wiley.com/doi/10.1111/2041-210X.12628/full
  • https://bioconductor.org/packages/devel/bioc/vignettes/ggtree/inst/doc/treeVisualization.html
  • http://bioconductor.org/packages/release/bioc/html/ggtree.html

More about ape:
  • http://ape-package.ird.fr/ape_screenshots.html
  • https://www.biostars.org/p/160461/

Pinintrest has lots of images of trees which are inspiring:
  • https://www.pinterest.com/davidwinter/tree-of-life/

To make the trees requires a multiple sequence alignment:
  • https://bioconductor.org/packages/devel/bioc/vignettes/msa/inst/doc/msa.pdf
  • and the package Biostrings: https://bioconductor.org/packages/release/bioc/html/Biostrings.html
  • Info here: http://manuals.bioinformatics.ucr.edu/home/ht-seq#TOC-Multiple-Sequence-Alignments-MSAs-

Kinase sequences & visualisation:
  • http://kinase.com/kinbase/FastaFiles/Human_kinase_domain.fasta
  • http://kinase.com/web/current/human/
  • http://science.sciencemag.org/content/298/5600/1912.full.pdf+html

Web interface, I think:
  • https://peerj.com/articles/126/
  • Kinome Render: a stand-alone and web-accessible tool to annotate the human protein kinome tree
Kinome google image search is interesting too....




Other packages:
  • phangorn - https://cran.r-project.org/web/packages/phangorn/vignettes/Trees.pdf