reorder_scaffolds: Reorder scaffolds based on assignment to chromosomes.

View source: R/reordering_functions.R

reorder_scaffoldsR Documentation

Reorder scaffolds based on assignment to chromosomes.

Description

This function will reorder the results of a genome-wide statistical analysis based on the contents of a file that assigns each scaffold to a reference genome assembly. The ordering information should be supplied as an AGP format file, typically output by RagTag.

The main difficulty is handling the variety of different species' chromosome level assemblies (i.e. the assemblies that your draft is assigned to). Some, like Melitaea cinxia and Papilio xuthus follow the convention of "chr1", etc. Others, however, like the Heliconius genomes, haven't specified complete chromosomes and have a unique naming system, typically e.g. Hmel201003o. These need to be handled differently. I can only guarantee that reordering information from the following genomes can currently be handled:

Heliconius melpomene v2.5 (hmel)
H. erato demophoon v1.0 (herd)
Bombyx mori chromosome (bmor)
Papilio xuthus chromosome (pxut)
Melitaea cinxia (mcin)

The appropriate abbreviation should be supplied to the "species" argument to the reordering function.

Usage

reorder_scaffolds(input, assignments, species)

Arguments

input

A tibble containing scaffold, ps, stat, and chr as the first three columns.

species

The abbreviation for the species assembly you ordered to.

agp

Name of the file containing the reordering information.

Value

Returns the input tibble with chr colun detailing which reference genome chromosomes the draft genome scaffolds map to. Only input rows that reside on mapped scaffolds are included.

Examples

a1 <- system.file("extdata", "test.gemma_gwas.txt.gz",
                  package = "gwplotting")

a2 <- system.file("extdata", "test.reordering.agp.gz",
                  package = "gwplotting")

b <- load_gemma_gwas( a1, pval = 'p_wald' )
b <- reorder_scaffolds( input = b, assignments = a2, species = 'pxut' )
b

nwvankuren/gwplotting documentation built on July 5, 2024, 4:24 p.m.