Skip to contents

This function takes a character string containing a set of xlims, positions to print for dna_segs. Multiple start and end positions can be provided for each dna_seg, forming subsegments to plot.

Usage

read_xlims(xlims)

Arguments

xlims

A character string with xlims to parse. See details.

Value

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

Details

The format of xlims corresponds to the output of the print_xlims argument of plot_gene_map. xlims must be a character string containing a set of xlims for each dna_seg. For each dna_seg, start and end positions must be provided for each subsegment, all separated by spaces. The dna_segs themselves are separated by commas, in plotting order. An example of the format is provided below.

Author

Mike Puijk

Examples

## Parse xlims for 2 dna_segs
## For dna_seg 1: 2 subsegments, 1st starts at 1 and ends at 10000
## while the 2nd subsegment starts at 155000 and ends at 154000
## For dna_seg 2: 1 subsegment, starting at 500 and ending at 10500
read_xlims("1 10000 155000 154000,500 10500")
#> [[1]]
#> [1]      1  10000 155000 154000
#> 
#> [[2]]
#> [1]   500 10500
#>