Skip to contents

Creates a QTL_data object from a tibble or data-frame of QTL mapping results.

Usage

QTL_data(dat, keep_rownames_as = NULL)

Arguments

dat

Tibble, results from a QTL mapping analysis. See Details.

keep_rownames_as

Character, the name of the column in which to save the rownames of the input data-frame. Default value is NULL, i.e. rownames will be discarded.

Value

A QTL_data object, i.e. a tibble.

Details

The input data should have one row per QTL region, and at least the following columns:

  • chromosome: character column, chromosome on which the QTL region is located.

  • start and end: numeric, starting and end position of the QTL region (in bp). A column position will be constructed as the middle value (mean) between start and end.

  • score or padj: numeric, the QTL score or adjusted p-value of the QTL region. If column score column is missing, will be constructed as -log10(padj).

Examples

x <- get_example_data()

QTL_data(x[["QTL"]])
#> # A tibble: 7 × 7
#>   id    chromosome    start      end score name  position
#>   <chr> <chr>         <dbl>    <dbl> <dbl> <chr>    <dbl>
#> 1 qtl_1 ST4.03ch01  5600000 11300000   4.1 QTL 1  8450000
#> 2 qtl_2 ST4.03ch01  9500000 14000000   5.5 QTL 2 11750000
#> 3 qtl_3 ST4.03ch04 12700000 17600000   4.3 QTL 3 15150000
#> 4 qtl_4 ST4.03ch05 37600000 39900000   3.2 QTL 4 38750000
#> 5 qtl_5 ST4.03ch07 49900000 51700000   5.1 QTL 5 50800000
#> 6 qtl_6 ST4.03ch08 45000000 47000000   5.8 QTL 6 46000000
#> 7 qtl_7 ST4.03ch11 21400000 26700000   2.1 QTL 7 24050000