View source: R/reordering_functions.R
get_cumulative_positions | R Documentation |
This function will add a new column to your tibble, bp_cum with the cumulative sum of positions in the ps column. This makes it so that the stat in each row in the tibble can be plotted sequentially.
get_cumulative_positions(
input,
scaffold_lengths,
buffer = 0,
after = "scaffolds"
)
input |
A tibble with the columns scaf (scaffold), ps (position), and stat (statistic) at the minimum. This function operates on the ps column. |
scaffold_lengths |
Path to the two-column tab-delimited file containing scaffold name and length. |
buffer |
Extra amount to add between consecutive scaffolds or chromosomes. |
after |
Where to add buffer, either after scaffolds or chromosomes. |
The original tibble, containing a new column, bp_cum, with cumulative positions.
a1 <- system.file("extdata", "test.gemma_gwas.txt.gz",
package = "gwplotting" )
a2 <- system.file("extdata", "test.chromSizes.txt.gz",
package = "gwplotting" )
b <- load_gemma_gwas( a1, pval = 'p_wald' )
b <- get_cumulative_positions( input = b, scaffold_lengths = a2,
buffer=1000, after = 'scaffolds' )
b
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.