read_paf: Read a .paf file such as produced by minimap/minimap2.

Description Usage Arguments Value Examples

Description

This function is only slighly modified from https://raw.githubusercontent.com/thackl/thacklr/master/R/read.R By default, this function corrects the start values to take into account that the paf file is 0-based while R/bioconductor is generally 1-based

Usage

1
read_paf(file, max_tags = 20, fix0based = TRUE)

Arguments

file

Either a path to a file, a connection, or literal data (either a single string or a raw vector).

Files ending in .gz, .bz2, .xz, or .zip will be automatically uncompressed. Files starting with http://, https://, ftp://, or ftps:// will be automatically downloaded. Remote gz files can also be automatically downloaded and decompressed.

Literal data is most useful for examples and tests. It must contain at least one new line to be recognised as data (instead of a path) or be a vector of greater than length 1.

Using a value of clipboard() will read from the system clipboard.

max_tags

maximum number of optional fields to include

fix0based

Logical. Are the ranges in the paf file 0-based and should they be converted to 1-based (default is TRUE)?

Value

tibble

Examples

1
2
3
4
5
6
## Example data set:
   Path2paf <- system.file("extdata", "BAC02_mmap2Ecoli.paf", package = "NanoBAC")
## Import the data (ignore the warnings linked to the file parsing):
suppressWarnings(
   mypaf <- read_paf(Path2paf)
   )

pgpmartin/NanoBAC documentation built on Dec. 11, 2020, 9:51 a.m.