cropSmoothFit: Gene Smooth: Crop to particular pseudotimes

Description Usage Arguments Value Examples

View source: R/gene-smooth.R

Description

This crops a result from geneSmoothFit to a particular pseudotime range. Can be used to split a smoothed result into segments in order to label them separately or combine them for use with plotSmoothFitMultiCascade.

Usage

1
cropSmoothFit(smoothed.fit, pt.min = -Inf, pt.max = Inf)

Arguments

smoothed.fit

(List) Result from geneSmoothFit

pt.min

(Numeric) Minimum pseudotime to retain

pt.max

(Numeric) Maximum pseudotime to retain

Value

(List) Result from geneSmoothFit, but cropped to the range of pt.min and pt.max.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Identify the pseudotime of the branchpoint
pt.crop <- as.numeric(unlist(hydra.en.tree@tree$segment.pseudotime.limits)[1])
# Crop according to the pseudotime of the branchpoint
foot.only.spline <- cropSmoothFit(tentacle.spline, pt.max = pt.crop)
hypostome.only.spline <- cropSmoothFit(hypo.spline, pt.min = pt.crop)
tentacle.only.spline <- cropSmoothFit(tentacle.spline, pt.min = pt.crop)
# Combine into a list
# Names in the plots are determined by names of the smooth objects in the list
splines <- list(foot.only.spline, tentacle.only.spline, hypostome.only.spline)
names(splines) <- c("Foot/Body", "Tentacle", "Hypostome")
# Plot expression of genes on the curves
endoderm.genes.plot <- c("t14194aep|WNT3_MOUSE", "t20768aep|BRAC_CANLF", 
  "t25396aep|NKX26_HUMAN", "t18735aep|FOXA2_ORYLA")
plotSmoothFitMultiCascade(smoothed.fits = splines, 
  genes = endoderm.genes.plot, scaled = F, 
  colors = c(`Foot/Body` = "#FF8C00", Hypostome = "#1E90FF", 
    Tentacle = "#32CD32"
  )
)

farrellja/URD documentation built on June 17, 2020, 4:48 a.m.