View source: R/scanTabix_to_dt.R
scanTabix_to_dt | R Documentation |
Convert the output of scanTabix into a data.table. Can handle tabix files that are missing column names, and query results that only have a single row.
scanTabix_to_dt(
header,
queries,
add_query_names = TRUE,
remove_duplicates = TRUE,
sep = "\t",
verbose = TRUE
)
header |
Header, from the output of headerTabix. |
queries |
A named list of query results, from the output of scanTabix. |
add_query_names |
Add the names of each query to a new column named 'query'. |
remove_duplicates |
Remove any duplicated rows.
Set |
sep |
The separator between columns. Defaults to the character in the set |
verbose |
Print messages. |
fl <- system.file("extdata", "example.gtf.gz", package="Rsamtools",
mustWork=TRUE)
tbx <- Rsamtools::TabixFile(fl)
param <- GenomicRanges::GRanges(
c("chr1", "chr2"),
IRanges::IRanges(c(1, 1), width=100000))
queries <- Rsamtools::scanTabix(tbx, param=param)
header <- Rsamtools::headerTabix(fl)
#### Convert ####
query_dt <- echotabix::scanTabix_to_dt(header = header,
queries = queries)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.