metapr2_export_asv: Exports the metapr2 database

Description Usage Arguments Value Examples

View source: R/metapr2.R

Description

Exports a range of file and format.

Returns a list with 4 elements

NOTE: if all export_long_xls, export_wide_xls, export_phyloseq are false, abundances are not exported

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
metapr2_export_asv(
  taxo_level = kingdom,
  taxo_name = "Eukaryota",
  boot_level = class_boot,
  boot_min = 0,
  assigned_with = "dada2",
  reference_database = "pr2_4.14.0",
  directory = "C:/daniel.vaulot@gmail.com/Databases/_metaPR2/export/",
  dataset_id_selected = c(1:500),
  filter_samples = NULL,
  filter_metadata = NULL,
  export_long_xls = FALSE,
  export_wide_xls = FALSE,
  export_sample_xls = FALSE,
  export_phyloseq = FALSE,
  export_fasta = FALSE,
  taxonomy_full = TRUE,
  use_hash = FALSE,
  sum_reads_min = 0
)

Arguments

taxo_level

The taxonomic level for selection (do not quote), e.g. class or genus

taxo_name

The name of the taxonomic level selected, e.g. "Chlorophyta", can be a vector c("Chlorophyta", "Haptophyta")

boot_level

The taxonomic level for bootstrap filtering (do not quote), e.g. class_boot or genus_boot

boot_min

Minimum bootstrap value at the class level, 0 if you want to get all asvs

assigned_with

Program used for assignement - "dada2" or "decipher"

reference_database

Reference database used - "pr2_4.14.0" or "pr2_4.12.0"

directory

Directory where the files are saved (finish with /)

dataset_id_selected

Integer vector, e.g. 23 or c(21, 23) or 21:23

filter_samples

Character expression for filter, e.g. "DNA_RNA == 'DNA'" (use single quotes inside double quotes)

filter_metadata

Character expression for filter, e.g. "substrate == 'sediment trap material'" (use single quotes inside double quotes)

export_long_xls

If TRUE, an xlsx file is produced containing the final long data frame

export_wide_xls

If TRUE, an xlsx file is produced containing the final wide data frame

export_sample_xls

If TRUE, an xlsx file is produced containing the sample list

export_phyloseq

If TRUE, a phyloseq file is produced and a phyloseq object producted

export_fasta

If TRUE, a fasta is produced

taxonomy_full

If TRUE, the fasta file contains the full taxonomy (8 levels), if false only contains the species

use_hash

If TRUE, the asvs with identical has will be merged and called by their hash value (sequence_hash)

sum_reads_min

This is the minimum number of reads (summed over the datasets selected) for an asv to be included

Value

A list with 4 elements

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Export all the asv in a single fasta
  metapr2_export_asv()

# Export as specific data set as a phyloseq file
  metapr2_export_asv(dataset_id_selected = 23, export_phyloseq = TRUE)

# Export a specific genus as a fasta file and an excel file
  asv_set <- metapr2_export_asv(taxo_level = genus, taxo_name=c("Pseudohaptolina","Haptolina"),
                                export_fasta=TRUE, taxonomy_full= FALSE,
                                boot_level = genus_boot, boot_min = 100,
                                export_long_xls = TRUE)

vaulot/dvutils documentation built on Nov. 20, 2021, 11:01 a.m.