AssemblyStats: Assembly statistics.

Description Usage Arguments Details Value Author(s) Examples

Description

Calculate the N50, N90 values for a fasta or 2bit file.

Usage

1
2
N50(fn)
N90(fn)

Arguments

fn

character(1): The path of a fasta or 2bit file.

Details

This function calculates the N50, N90 values for an assembly. The N50 value is calculated by first ordering every contig/scaffold by length from longest to shortest. Next, starting from the longest contig/scaffold, the lengths of each contig are summed, until this running sum equals one-half of the total length of all contigs/scaffolds in the assembly. Then the length of shortest contig/scaffold in this list is the N50 value. Similar procedure is used for N90 but including 90% of the assembly.

Value

An integer value of N50 or N90 value.

Author(s)

Ge Tan

Examples

1
2
3
4
  twoBitFn <- file.path(system.file("extdata",
                                    package="BSgenome.Drerio.UCSC.danRer10"),
                        "single_sequences.2bit")
  N50(twoBitFn)

CNEr documentation built on Nov. 8, 2020, 5:36 p.m.