Skip to contents

Get a duplicate count matrix for each genome

Usage

duplicates2counts(duplicate_list, shape = "long")

Arguments

duplicate_list

A list of data frames with the duplicated genes or gene pairs and their modes of duplication as returned by classify_gene_pairs() or classify_genes().

shape

Character specifying the shape of the output data frame. One of "long" (data frame in the long shape, in the tidyverse sense), or "wide" (data frame in the wide shape, in the tidyverse sense). Default: "long".

Value

If shape = "wide", a count matrix containing the frequency of duplicated genes (or gene pairs) by mode for each species, with species in rows and duplication modes in columns. If shape = "long", a data frame in long format with the following variables:

type

Factor, type of duplication.

n

Numeric, number of duplicates.

species

Character, species name

Examples

data(fungi_kaks)

# Get unique duplicates
duplicate_list <- classify_genes(fungi_kaks)

# Get count table
counts <- duplicates2counts(duplicate_list)