calc_new_pos: Calculate new x-position of each point

View source: R/utils.R

calc_new_posR Documentation

Calculate new x-position of each point

Description

Calculate the actual x-positions of each point used for the manhattan plot. MPdata object contains the unscaled positions that has not been positioned according to the relative position and width of each chromosome.

Usage

calc_new_pos(mpdata)

Arguments

mpdata

an MPdata object.

Details

This is used calculate the actual positions used for the inside manhattan_plot function. It was designed this way should the scaling and relative positioning of each chromosome be changed (e.g. gap between the )

Value

a numeric vector containing the scaled x-positions.

Examples


gwasdat <- data.frame(
  "chromosome" = rep(1:5, each = 30),
  "position" = c(replicate(5, sample(1:300, 30))),
  "pvalue" = rbeta(150, 1, 1)^5
)

mpdata <- manhattan_data_preprocess(
  gwasdat, pval.colname = "pvalue", chr.colname = "chromosome", pos.colname = "position",
  chr.order = as.character(1:5)
)

calc_new_pos(mpdata)


leejs-abv/ggmanh documentation built on Sept. 19, 2024, 10:13 p.m.