distinct_seqnames <- paste("\"", unique(seqnames), "\"", sep="")
distinct_seqnames <- paste(distinct_seqnames, collapse=", ")
stop(length(distinct_seqnames), " distinct seqnames found in this file: ", distinct_seqnames)
.newEmptyMask <- function(seqname, mask.width, mask.name, mask.desc, nofound_what="information")
msg <- paste("No ", nofound_what, " found for sequence \"",
"  'mask.width' argument to specify the width of the empty mask to\n",
"  return (i.e. the length of the sequence this mask will be put on).")
stop("unable to guess the column names in \"gap\" file '", file, "', sorry")
stop("read.Mask internal error: please report")
COL2CLASS[!(names(COL2CLASS) %in% COLS)] <- "NULL"
.read.agpORgapMask <- function(agp_or_gap, file, seqname, mask.width,
stop("'seqname' must be a single string")
stop("'mask.width' must be a single integer or 'NA'")
stop("'gap.types' must be 'NULL' or a character vector ",
stop("'use.gap.types' must be TRUE or FALSE")
warning("gap file contains gaps with a part_type that is not N")
if (length(gap.types) == 1 && gap.types == "?") {
found_types <- paste("\"", unique(data$gap_type), "\"", sep="")
found_types <- paste(found_types, collapse=", ")
stop("gap types found in this file for sequence \"", seqname, "\": ", found_types)
data <- data[data$gap_type %in% gap.types, ]
mask.desc <- paste(mask.desc, " [type=", paste(gap.types, collapse="|"), "]", sep="")
return(.newEmptyMask(seqname, mask.width, mask.name, mask.desc, mask.desc))
stop("broken \"", agp_or_gap, "\" file: contains inconsistent ",
"for assembly gaps in sequence \"", seqname, "\"")
stop("cannot use the gap types when some gaps are adjacent or overlap")
read.agpMask <- function(file, seqname="?", mask.width=NA, gap.types=NULL, use.gap.types=FALSE)
.read.agpORgapMask("agp", file, seqname, mask.width, gap.types, use.gap.types)
read.gapMask <- function(file, seqname="?", mask.width=NA, gap.types=NULL, use.gap.types=FALSE)
.read.agpORgapMask("gap", file, seqname, mask.width, gap.types, use.gap.types)
`xxxx`="NULL",  # not sure how to call this
read.liftMask <- function(file, seqname="?", mask.width=NA)
return(.newEmptyMask(seqname, mask.width, "AGAPS", "assembly gaps"))
stop("broken \"lift\" file: contains different lengths ",
if (!is.na(mask.width) && mask.width != seqlen0)
stop("when supplied, 'mask.width' must match the length found ",
"in the file for sequence \"", seqname, "\"")
warning("some contigs are adjacent or overlapping")
contigs <- Mask(seqlen0, start=start(contigs1), width=width(contigs1))
COLS <- c("query_sequence", "begin_in_query", "end_in_query", "ID")
read.rmMask <- function(file, seqname="?", mask.width=NA, use.IDs=FALSE)
data <- data[data$query_sequence == seqname, ]
stop("cannot use the repeat IDs when some repeats are adjacent or overlap")
COLS <- c("chrom", "chromStart", "chromEnd")
read.trfMask <- function(file, seqname="?", mask.width=NA)
return(.newEmptyMask(seqname, mask.width, "TRF", "Tandem Repeats Finder"))
NAMES="TRF", desc="Tandem Repeats Finder", check=FALSE)