Skip to contents

This function takes a character string and separates it to parse offset values for plotting in plot_gene_map. The offset values determine the amount of space before each subsegment of each plotted dna_seg.

Usage

read_offsets(offsets)

Arguments

offsets

A character string with offset values to parse. See details.

Value

A list of offset values that can be passed directly to the offsets argument of plot_gene_map. Each element of the list is a numeric vector that corresponds to the offset values of one dna_seg.

Details

The format of offsets corresponds to the output of the print_offsets argument of plot_gene_map. offsets must be a character string containing 1 or more offset values for each dna_seg. dna_segs are separated by commas, in plotting order, with their subsegments separated by spaces. For each dna_seg, if a single value is provided, then that value will become the offset for its first subsegment. If more values are provided for a dna_seg, then there must be as many values as there are subsegments for that dna_seg.',

Author

Mike Puijk

Examples

## Parse offset values for 2 dna_segs
## dna_seg 1: its 2 subsegments will be offset by 150 and 1300, respectively
## dna_seg 2: only its first subsegment  will be offset by 300
read_offsets("150 1300,300")
#> [[1]]
#> [1]  150 1300
#> 
#> [[2]]
#> [1] 300
#>