# Guess the type of data inside a txt file by its header
#
# @param file File path to check.
# @param ... Additional arguments to read_exstra_db_known()
read_exstra_db_txt_guesser <- function(file, ...) {
# Scan the header
filefirst <- read.delim(file, nrows = 1, comment.char = "#")
if("locus" %in% names(filefirst)) {
# Using a known database format
read_exstra_db_known(file, ...)
} else {
# otherwise default to UCSC style
read_exstra_db_ucsc(file, ...)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.