experiment-class {ORFik} | R Documentation

## experiment class definition

### Description

Act as a way of extension of `SummarizedExperiment` by allowing more ease to find not only counts, but rather information about libraries, and annotation, so that more tasks are possible. Like coverage per position in some transcript etc.
It is an object to massivly simplify your coding, by having a table of all libraries of an experiment. That contains filepaths and info for each library in the experiment. It also tries to guess grouping / types / pairs by the file names.

### Details

## Constructor:

Simplest way to make is to call: create.experiment(dir)

On some folder with libraries and see what you get. Some of the fields might be needed to fill in manually. Each resulting row must be unique (excluding filepath), that means if it has replicates then that must be said explicit. And all filepaths must be unique and have files with size > 0. Syntax (columns):
libtype (library type): rna-seq, ribo-seq, CAGE etc.
rep (replicate): 1,2,3 etc
condition: WT (wild-type), control, target, mzdicer, starved etc.
fraction: 18, 19 (fractinations), or other ways to split library.
filepath: Full filepath to file

Special rules:
Supported:
Single end bam, bed, wig + compressions of these
Paired forward / reverse wig files, must have same name except _forward / _reverse etc

Not supported yet:
Paired end bam files not supported yet!

### See Also

Other ORFik_experiment: `bamVarName()`, `create.experiment()`, `libraryTypes()`, `outputLibs()`, `read.experiment()`, `save.experiment()`, `validateExperiments()`

### Examples

    ## Not run:
    library(ORFik)

    # 1. Update path to experiment data  directory (bam, bed, wig files etc)
    exp_dir = "/data/processed_data/RNA-seq/Lee_zebrafish_2013/aligned/"

    # 2. Set a 5 character name for experiment, (Lee 2013 -> Lee13, etc)
    exper_name = "Lee13"

    # 3. Create a template experiment
    temp <- create.experiment(exp_dir, exper_name,
     txdb = "/data/references/Zv9_zebrafish/Danio_rerio.Zv9.79.gtf",
     fa = "/data/references/Zv9_zebrafish/Danio_rerio.Zv9.fa")

    # 4. Make sure each row(sample) is unique and correct
    # You will get a view open now, check the data.frame that it is correct:
    # library type (RNA-seq, Ribo-seq), stage, rep, condition, fraction.
    # Let say it did not figure out it is RNA-seq, then we do:"

    temp[5:6, 1] <- "RNA" # [row 5 and 6, col 1] are library types

    # You can also do this in your spread sheet program (excel, libre..)
    # Now save new version, if you did not use spread sheet.
    saveName <- paste0("/data/processed_data/experiment_tables_for_R/",
     exper_name,".csv")
    save.experiment(temp, saveName)

    # 5. Load experiment, this will validate that you actually made it correct
    df <- read.experiment(saveName)

    # Set experiment name not to be assigned in R variable names
    df@expInVarName <- FALSE
    df

    ## End(Not run)

[Package ORFik version 1.6.9 Index]