read_fluorescence_matrices: Import fluorescence matrix

Description Usage Arguments Details Value Examples

View source: R/fluorescence_matrix.R

Description

Reads a set of individual o1, o2, or, and br fluorescence matrices and creates a single data frame from them, with rows corresponding to probes and columns corresponding to PBM conditions.

Usage

1
2
3
4
5
6
read_fluorescence_matrices(
  matrix_directory,
  matrix_base_name,
  pbm_conditions,
  run_tag = NA
)

Arguments

matrix_directory

The path to the directory containing the individual o1, o2, or, and br fluorescence matrices to import.

matrix_base_name

The base filename of the fluorescence matrices to import.

pbm_conditions

A character vector of the names of the PBM conditions. These will be used as column names.

run_tag

An optional (but recommended) tag specifying the particular experiment these fluorescence matrices are from. It will be incorporated into the column names along with the PBM conditions. This option is useful for differentiating replicates when merging two matrices downstream.

Details

This function takes as input the fluorescence matrices output by the PBM preprocessing pipeline. It expects the filenames to be of the form <matrix_base_name>_<probe_orientation>.dat, where <matrix_base_name> is the value passed to the matrix_base_name parameter and <probe_orientation> is "o1", "o2", "or", or "br" (all four files must be present). These files should contain 3 + n tab-delimited columns, where n is the number of PBM conditions supplied to the pbm_conditions parameter. The first column must contain the probe IDs, and the fourth through nth columns must contain the fluorescence values for the PBM conditions in the order listed. The second and third columns are removed. The files should not contain headers.

The output data frame contains 1 + (4 * n) columns, where n is again the number of PBM conditions supplied to the pbm_conditions parameter. The first column will be named "probeID" and will contain the probe IDs with their orientation tags (i.e., "_o1" or "_o2") removed. The remaining columns will contain the fluorescence values for each probe orientation and PBM condition and will be named based on the vector of PBM conditions supplied to pbm_conditions and the tag supplied to run_tag (if any). If a tag is provided, the column names will be of the form "<run_tag>_<probe_orientation>_<pbm_condition>". If no tag is provided, the column names will be of the form "<probe_orientation>_<pbm_condition>".

Value

A data frame containing the fluorescence values from the specified set of o1, o2, or, and br matrices.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
fluorescence_matrix <- read_fluorescence_matrices(
    matrix_directory = paste0(
        "/projectnb/siggers/data/hTF_array_project/data/data_matrices/",
        "v1_a11_run1"
    ),
    matrix_base_name = "hTF_v1_SUDHL4_14jan21",
    pbm_conditions = c(
        "UT_SUDHL4_SMARCA4MIX",
        "UT_SUDHL4_HDAC1MIX",
        "UT_SUDHL4_SUZ12",
        "UT_SUDHL4_PRMT5",
        "UT_SUDHL4_JMJD2A",
        "UT_SUDHL4_BMI1",
        "UT_SUDHL4_DNMT3A",
        "UT_SUDHL4_ASH2L"
    )
)

pamelaglopez/hTF_array documentation built on Feb. 23, 2022, 12:05 a.m.