fimport {ORFik} | R Documentation

## Load any type of sequencing reads

### Description

Wraps around rtracklayer::import and tries to speed up loading with the use of data.table. Supports gzip, gz, bgz compression formats. Also safer chromosome naming with the argument chrStyle

### Usage

    fimport(path, chrStyle = NULL)

### Arguments

`path` | a character path to file (1 or 2 files), or data.table with 2 colums(forward&reverse) or a GRanges/Galignment/GAlignmentPairs object etc. If it is ranged object it will presume to be already loaded, so will return the object as it is, updating the seqlevelsStyle if given.
`chrStyle` | a GRanges object, TxDb, FaFile, or a `seqlevelsStyle` (Default: NULL) to get seqlevelsStyle from. Is chromosome 1 called chr1 or 1, is mitocondrial chromosome called MT or chrM etc. Will use 1st seqlevel-style if more are present. Like: c("NCBI", "UCSC") -> pick "NCBI"

### Details

NOTE: For wig you can send in 2 files, so that it automaticly merges forward and reverse stranded objects. You can also just send 1 wig file, it will then have "*" as strand.

### Value

a `GAlignments`/`GRanges` object, depending on input.

### See Also

Other utils: `bedToGR()`, `convertToOneBasedRanges()`, `export.bed12()`, `export.wiggle()`, `findFa()`, `fread.bed()`, `optimizeReads()`, `readBam()`, `readWig()`

### Examples

    bam_file <- system.file("extdata", "ribo-seq.bam", package = "ORFik")
    fimport(bam_file)
    # Certain chromosome naming
    fimport(bam_file, "NCBI")

[Package ORFik version 1.8.6 Index]