Learn R Programming

dynwrap: Representing and Inferring Single-Cell Trajectories

Tutorials Reference documentation

dynwrap contains the code for a common model of single-cell trajectories. The package can:

  • Wrap the input data of a trajectory inference method, such as expression and prior information
  • Run a trajectory inference method in R, in a docker container or a singularity container
  • Wrap the output of a trajectory inference method, such as the pseudotime, a clustering or a branch network, and convert it into a common trajectory model
  • Further postprocess and adapt the trajectory model, such as labelling the milestones and rooting the trajectory

Documentation and the API reference for dynwrap can be found at the dyvnerse documentation website: https://dynverse.org/ .

dynwrap was used to wrap 50+ trajectory inference method within docker containers in dynmethods.

The advantage of using a common model is that it allows:

  • Comparison between a prediction and a gold standard, eg. using dyneval
  • Comparing two predictions
  • Easily visualise the trajectory, eg. using dynplot
  • Extracting relevant features/genes, eg. using dynfeature

Latest changes

Check out news(package = "dynwrap") or NEWS.md for a full list of changes.

Recent changes in dynwrap 1.2.3

  • MINOR CHANGE: Fixes to metadata (documentation, citation entry, broken links).

Recent changes in dynwrap 1.2.2

  • MAJOR CHANGE convert_milestone_percentages_to_progressions(): Rewrite implementation to attain significant speedup.

  • MINOR CHANGE infer_trajectory(): Infer command (Rscript/python) from file extension if possible and avoid using shebang to execute script, because R CMD check for R 4.0 puts Rscript and R dummy executables on the path before R CMD check. This means #!/usr/bin/env Rscript does not work anymore.

  • MINOR CHANGE add_feature_importance(): Add a function for adding feature importance scores to a trajectory.

  • BUG FIX project_waypoints(): Rename milestone waypoints such that the names are unique.

  • BUG FIX infer_trajectory(): Fix error message printing.

  • BUG FIX: dyndimred is used conditionally.

  • BUG FIX: wrap_expression() and add_expression(): Do not override feature_info when it already exists in dataset.

Dynverse dependencies

Copy Link

Version

Install

install.packages('dynwrap')

Monthly Downloads

510

Version

1.2.4

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Last Published

July 19th, 2023

Functions in dynwrap (1.2.4)

add_grouping

Add a cell grouping to a dataset
calculate_pseudotime

Add or calculate pseudotime as distance from the root
add_timings

Add timings to a trajectory
add_root

Root the trajectory
add_regulatory_network

Add a GRN to a dynwrap object
convert_definition

Convert a definition loaded in from a yaml
calculate_geodesic_distances

Calculate geodesic distances between cells in a trajectory
calculate_average_by_group

Calculate average values of a matrix
common_param

Common param
add_linear_trajectory

Constructs a linear trajectory using pseudotime values
add_feature_importance

Add a feature importance to a dataset
add_trajectory

Construct a trajectory given its milestone network and milestone percentages or progressions
add_prior_information

Add or compute prior information for a trajectory
calculate_attraction

Calculate the attraction of cells to other cells using velocity
allowed_outputs

All allowed outputs for a TI method
def_method

Define meta information on the TI method.
create_ti_method_container

Create a TI method from a docker / singularity container
create_ti_method_definition

Create a TI method from a local method definition file
def_wrapper

Meta information on the wrapper
classify_milestone_network

Classify a milestone network
calculate_trajectory_dimred

Layout the trajectory and its cells in 2 dimensions using a graph layout
def_package

Meta information on the package in which the TI function resides
def_parameters

Meta information on the parameters of the TI method
generate_parameter_documentation

Generate the parameter documentation of a method, use with @eval
group_from_trajectory

Create a grouping from a trajectory
add_tde_overall

Add information on overall differentially expressed features
gather_cells_at_milestones

Gather cells to their closest milestones
allowed_inputs

All allowed inputs for a TI method
def_container

Meta information on the container in which the wrapper resides
select_waypoints

Add or create waypoints to a trajectory
def_manuscript

Meta information on the manuscript
example_trajectory

Example trajectory
infer_trajectories

Infer one or more trajectories from a single-cell dataset
project_waypoints

Project waypoints of a trajectory (e.g. milestones) into a space defined by cells (e.g. expression or a dimensionality reduction)
convert_progressions_to_milestone_percentages

Conversion between milestone percentages and progressions
convert_milestone_percentages_to_progressions

Conversion between milestone percentages and progressions
random_seed

Generate a random seed
flip_edges

Flip a set of edges of the milestone network
trajectory_types

Metadata on the trajectory types
prior_usages

Metadata on prior usages
label_milestones

Label milestones either manually (label_milestones) or using marker genes (label_milestones_markers)
wrap_data

A data wrapper for datasets and trajectories
create_ti_method_r

Create a TI method from an R function wrapper
trajectory_type_dag

A DAG connecting different trajectory types
simplify_trajectory

Simplify a trajectory by removing transient milestones
wrap_expression

Create a wrapper object with expression and counts
dynwrap

Inferring and adapting single-cell trajectories
example_dataset

Example dataset
def_author

Meta information on an author
simplify_igraph_network

Simplify an igraph network such that consecutive linear edges are removed
reexports

Objects exported from other packages
project_trajectory

Project a trajectory onto a dimensionality reduction
priors

Metadata on priors
definition

Create a definition
.method_process_definition

Method process definition
get_default_parameters

Get the default parameters of a method
get_ti_methods

Return all TI that are installed in one or more packages
wrapper_types

Metadata on wrapper types
add_cyclic_trajectory

Constructs a circular trajectory using the pseudotime values of each cell.
add_attraction

Add attraction of cells using RNA velocity
add_end_state_probabilities

Constructs a multifurcating trajectory using end state probabilities
add_dimred_projection

Constructs a trajectory by projecting cells within a dimensionality reduction
add_cluster_graph

Constructs a trajectory using a cell grouping and a network between groups. Will use an existing grouping if it is present in the dataset.
add_cell_waypoints

Add or select waypoint cells of a trajectory
add_expression

Add count and normalised expression values to a dataset
add_dimred

Add or create a dimensionality reduction
add_branch_trajectory

Construct a trajectory given its branch network and the pseudotime of the cells on one of the branches.
add_cell_graph

Constructs a trajectory using a graph between cells, by mapping cells onto a set of backbone cells.