find all mapped region in a .sam data.frame

Arguments

sam

data.frame. see read_sam()

Value

a tibble of 4 variables, chrom, strand, start, end

Examples

sam_file <- system.file('extdata', 'Neat1_1.Aligend_trunc.sam', package = 'paristools') sam_file %>% read_sam() %>% sam_to_loc_df()
#> # A tibble: 5,859 x 4 #> chrom strand start end #> <chr> <chr> <int> <int> #> 1 neat1 + 170 200 #> 2 neat1 + 774 807 #> 3 neat1 + 294 325 #> 4 neat1 + 311 343 #> 5 neat1 + 1032 1063 #> 6 neat1 + 3158 3177 #> 7 neat1 + 2326 2356 #> 8 neat1 - 2493 2529 #> 9 neat1 - 658 685 #> 10 neat1 - 658 683 #> # … with 5,849 more rows