vs_search_global: Search for a list of sequence in a fasta file against physeq...

View source: R/vsearch.R

vs_search_globalR Documentation

Search for a list of sequence in a fasta file against physeq reference sequences using vsearch

Description

lifecycle-maturing

Use of VSEARCH software.

Usage

vs_search_global(
  physeq,
  seq2search = NULL,
  path_to_fasta = NULL,
  vsearchpath = "vsearch",
  id = 0.8,
  iddef = 0,
  keep_temporary_files = FALSE
)

Arguments

physeq

(required): a phyloseq-class object obtained using the phyloseq package.

seq2search

(required if path_to_fasta is NULL) Either (i) a DNAstringSet object or (ii) a character vector that will be convert to DNAstringSet using Biostrings::DNAStringSet()

path_to_fasta

(required if seq2search is NULL) a path to fasta file if seq2search is est to NULL.

vsearchpath

(default: vsearch) path to vsearch

id

(default: 0.8) id for the option --usearch_global of the vsearch software

iddef

(default: 0) iddef for the option --usearch_global of the vsearch software

keep_temporary_files

(logical, default: FALSE) Do we keep temporary files

  • temp.fasta (refseq in fasta)

  • cluster.fasta (centroid)

  • temp.uc (clusters)

Details

This function is mainly a wrapper of the work of others. Please cite vsearch.

Value

A dataframe with uc results (invisible)

Author(s)

Adrien Taudière

Examples



if (requireNamespace("seqinr")) {
  file_dna <- tempfile("dna.fa")
  seqinr::write.fasta("GCCCATTAGTATTCTAGTGGGCATGCCTGTTCGAGCGTCATTTTCAACC",
    file = file_dna, names = "seq1"
  )

  res <- vs_search_global(data_fungi, path_to_fasta = file_dna)
  unlink(file_dna)

  res[res$identity != "*", ]

  clean_pq(subset_taxa(data_fungi, res$identity != "*"))
}



adrientaudiere/MiscMetabar documentation built on Oct. 13, 2024, 9:42 p.m.