README.md

metabarcodeUtils

This simple package contains helper functions for the meta-barcoding workflow.

Installing the package

devtools::install_github("fishsciences/metabarcode_utils")

Using the package

Summarizing MitoFish Output

This package currently starts with a xlsx result file, renamed, from the MitoFish tool. For testing, an example file is included with the package.

f = system.file(package = "metabarcodeUtils",
                "sample_files",
                "BTWIT1-20200429B.xlsx")

This file can be parsed and converted into two CSV files (one for the hits and one for the no hits) using the mitofish_to_csv() function:

tt = mitofish_to_csv(f, outdir = out_dir)

By default, this will return a list with two data.frames, and will write the results to outdir. These results can then be further processed into Fasta files with csv_to_fasta():

csv_to_fasta(file.path(out_dir, ff[1]), outdir = out_dir)

Summarizing NCBI BLAST Output

To extract and summarize the tables from a NCBI output file,

ncbi_tabs = extract_ncbi_tabs("R69MU8R7016-Alignment.txt")

This returns all the values in the table. To subset these according to:

This is accomplished with

top_accessions = reduce_ncbi(ncbi_tabs, accession_keep = "top")

These tables can be written to a CSV file with,

d = create.dir("ncbi_output")
write_ncbi_tabs(top_accessions, "ncbi_output")


fishsciences/metabarcode_utils documentation built on Feb. 25, 2024, 11:31 a.m.