Learn R Programming

LifemapR

An R package to visualise data on a Lifemap base (https://lifemap-ncbi.univ-lyon1.fr/)

Installation

To install the development version of LifemapR from GitHub :

remotes::install_github("damiendevienne/LifemapR")

Once installed, load the package with :

require("LifemapR")

Usage

Here is a brief introduction on how to use LifemapR.

  1. With the build_Lifemap function transform your already existing data into a format usable by LifemapR functions
data(eukaryotes_1000)

# Construction of a LifemapR usable dataframe
LM_obj <- LifemapR::build_Lifemap(eukaryotes_1000)

After the build_Lifemap function the result is a LifemapR format containing a dataframe :

full_df <- LM_obj$df
  1. Then you can display a map with wanted informations by calling one ore more LifemapR functions. Note that with the LifemapR functions, a shiny application will be launched
# Initialise a visualisation for LM_obj
lifemap(LM_obj) +
    # adding a subtree with colored branches
    LifemapR::lm_branches(var_col = "Protein", FUN = mean, col = "PiYG")+
    # adding a set of points
    LifemapR::lm_markers(radius = "GC.", var_fillColor = "Genes", FUN = mean)

Development

To do list :

  • New protocole to fetch data with improved databases (parquet format)

  • Improve create_matrix() to use less CPU (merge before joining all lists)

  • Improve make_newick() to make it recursive

  • Improve the shiny application version

  • Redo pass_info function to only infer unknown values and only from the value of direct ancestors

  • Implement popups and labels for markers

  • Implement popups and labels for polylines

  • Black background on leaflet

  • Repair the size legend

  • Option to thicker the line depending on a variable

  • Improve create_matrix function to pass check

How to use during development

Go to the package's folder

require(devtools)
devtools::load_all()

then you can simply use the package's functions

Copy Link

Version

Install

install.packages('LifemapR')

Monthly Downloads

190

Version

1.1.5

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Aurélie Siberchicot

Last Published

March 6th, 2025

Functions in LifemapR (1.1.5)

gen_res

Genomic results
eukaryotes_1000

NCBI information for 1000 eukaryotes
kraken_res

Kraken results
is.lm_piecharts

Reports whether x is a lm_branches object.
lm_piecharts

Add a "piecharts" layer to a lifemap_obj object.
lm_markers

add a "markers" layer to a lifemap_obj object.
pass_infos

Infer numerical values to nodes.
is.lifemap_obj

Reports whether x is a lifemap_obj object.
make_newick

Create a newick for the given dataset.
eukaryotes_80

NCBI information for 80 eukaryotes
print.lifemap_obj

Method to print lifemap_obj objects.
+.lifemap_obj

Add a graphical element to a tree visualisation.
pass_infos_discret

Infer discret values to nodes for lm_piecharts function.
create_value_range

Compute a new scale for a value
add_lm_markers

Compute the aesthetics for markers visualisation.
display_map

Create a Lifemap base.
LM_eukaryotes

Transformation in a LifemapR format of NCBI information for 1000 eukaryotes
add_lm_branches

Compute the aesthetics for a subtree visualisation.
display_option

Compute the different display options.
build_Lifemap

A function to construct a LifemapR object, usable by the other functions of the package.
create_matrix

Create a dataframe for the ancestry.
draw_Lifemap

Represent data on a Lifemap basemap.
add_lm_piecharts

Compute the aesthetics for discret values visualisation.
lifemap

Initialise a new Lifemap visualisation.
lm_branches

Add a "branches" layer to a lifemap_obj object.
is.lm_branches

Reports whether x is a lm_branches object.
is.lm_markers

Reports whether x is a lm_markers object.