mmscanbins: Retrieve scaffold names from all genome bins in a folder

Description Usage Arguments Value Examples

View source: R/mmscanbins.R

Description

Reads all FASTA files (genome bins) in a folder and returns all unique scaffold names. This is useful to get an overview of which scaffolds are already extracted from the metagenome by for example highlighting them in plots.

Usage

1
mmscanbins(binfolder, namesOnly = TRUE)

Arguments

binfolder

(required) Path to the folder to scan.

namesOnly

Return only the scaffold names (TRUE) or a complete list with the DNA sequences of the scaffolds in each file (FALSE). (Default: TRUE)

Value

A character vector (if namesOnly = TRUE) or a list (if namesOnly = FALSE).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
# Use mmextract and mmexport to extract scaffolds from the assembly and
# write their sequences to a FASTA file per bin. Then the mmscanbins() function
# can be used to retrieve the names of all scaffolds already extracted, and
# then for example highlight them in a plot:

binned_scaffolds <- mmscanbins("path/to/folder", namesOnly = TRUE)
binned_scaffolds
mmplot(mmgenome2,
  min_length = 10000,
  x = "cov_C13.11.25",
  y = "cov_C14.01.09",
  color_by = "taxonomy",
  highlight_scaffolds = binned_scaffolds,
  highlight_color = "darkred",
  x_scale = "log10",
  y_scale = "log10"
)

## End(Not run)

KasperSkytte/mmgenome2 documentation built on Dec. 14, 2021, 12:11 a.m.