Assign default UCSC track values to environment

assign_track_defaults(
  env = new.env(),
  defaults,
  singlet_only = TRUE,
  track_types = c("track", "superTrack", "parent"),
  type_mapping = c(description = c("longLabel")),
  ...
)

Arguments

env

environment in which the default values will be assigned. If the environment already has these values assigned, those values will be replaced with values in defaults.

defaults

list or data.frame of named values, whose names are used for assignment in the environment env.

singlet_only

logical indicating whether to perform assignment only when there is one unique value to assign. Useful when passing defaults as a data.frame, when singlet_only=TRUE it will only assign columns containing one unique value.

track_types

character vector containing regular expression patterns, used to recognize track name fields. The values for track name fields are passed to make_ucsc_trackname() which replaces invalid characters with underscore.

...

additional arguments are passed to base::assign().

Value

`environment`` is returned invisibly.

Details

This function assigns values by name, to the specified environment. The values can be supplied as a list, or data.frame.

When singlet_only=TRUE, each named value must have only one unique value, otherwise it is not assigned to the environment.

The track_types argument is used to help handle track names by removing invalid track characters, for example for "track", "superTrack", and "parent", these must be modified consistently for the track hierarchy to remain valid.

See also

Other jam ucsc browser functions: get_track_defaults(), make_ucsc_trackname(), parse_ucsc_gokey()