outputLibs {ORFik} | R Documentation

## Output bam/bed/bedo/bedoc/ofst/wig files to R as variables

### Description

Variable names defined by df (ORFik experiment DataFrame) Uses multiple cores to load, defined by multicoreParam

### Usage

    outputLibs(
      df,
      chrStyle = NULL,
      type = "default",
      param = NULL,
      strandMode = 0,
      envir = .GlobalEnv,
      BPPARAM = bpparam()
    )

### Arguments

`df` | an ORFik `experiment`
`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"
`type` | a character(default: "default"), load files in experiment or some precomputed variant, either "ofst", "bedo", "bedoc" or "pshifted". These are made with ORFik:::convertLibs() or shiftFootprintsByExperiment(). Can also be custom user made folders inside the experiments bam folder.
`param` | `NULL` or a ScanBamParam object. Like for `scanBam`, this influences what fields and which records are imported. However, note that the fields specified thru this ScanBamParam object will be loaded in addition to any field required for generating the returned object (GAlignments, GAlignmentPairs, or GappedReads object), but only the fields requested by the user will actually be kept as metadata columns of the object. By default (i.e. `param=NULL` or `param=ScanBamParam()`), no additional field is loaded. The flag used is `scanBamFlag(isUnmappedQuery=FALSE)` for `readGAlignments`, `readGAlignmentsList`, and `readGappedReads`. (i.e. only records corresponding to mapped reads are loaded), and `scanBamFlag(isUnmappedQuery=FALSE, isPaired=TRUE, hasUnmappedMate=FALSE)` for `readGAlignmentPairs` (i.e. only records corresponding to paired-end reads with both ends mapped are loaded).
`strandMode` | numeric, default 0. Only used for paired end bam files. One of (0: strand = *, 1: first read of pair is +, 2: first read of pair is -). See ?strandMode. Note: Sets default to 0 instead of 1, as readGAlignmentPairs uses 1. This is to guarantee hits, but will also make mismatches of overlapping transcripts in opposite directions.
`envir` | environment to save to, default (.GlobalEnv)
`BPPARAM` | how many cores/threads to use? default: bpparam(). To see number of threads used, do `bpparam()$workers`

### Value

NULL (libraries set by envir assignment)

### See Also

Other ORFik_experiment: `ORFik.template.experiment()`, `bamVarName()`, `create.experiment()`, `experiment-class`, `filepath()`, `libraryTypes()`, `organism.df()`, `read.experiment()`, `save.experiment()`, `validateExperiments()`

### Examples

    ## Load a template ORFik experiment
    df <- ORFik.template.experiment()
    ## Default library type load, usually bam files
    # outputLibs(df, type = "default")
    ## .ofst file load, if ofst files does not exists
    ## it will load default
    # outputLibs(df, type = "ofst")
    ## .wig file load, if wiggle files does not exists
    ## it will load default
    # outputLibs(df, type = "wig")

[Package ORFik version 1.10.13 Index]