Data_Preparation: Query and Reference Sequence Data Preparation

View source: R/Sero_Placement_Functions.R

Data_PreparationR Documentation

Query and Reference Sequence Data Preparation

Description

Takes a pre-aligned set of query sequences from the user and formats the query and reference sequence file into the appropriate formats for EPA-NG. This function executes the initial step of optimizing the order of the 7 16S reference sequences into the best possible orientation matching the user's query. The best orientation for each reference is calculated and then the reference sequences are re-sorted into the optimal orders. After this, the reference sequences are all concatenated and returned in a format ready for EPA-NG. In addition, the user's input query sequences are also concatenated and returned as a single FASTA line for input into EPA-NG. Note: It is required that the input query sequences are pre-aligned to the main reference file using MAFFT. Non-aligned sequences with varying sequence lengths will cause errors in downstream analysis steps. The mafft wrapper and epa-ng are adapted from wrapper functions from the "ips" package written by Cristoph Heibl. We would like to thank the authors for their work on this previously written code.

Usage

Data_Preparation(Aligned_Queries, Reference)

Arguments

Aligned_Queries

A data frame containing the pre-aligned query sequences. Important: This file should contain a set of 7 ASVs in a data frame file which have been aligned to the reference sequence database using MAFFT. The data frame should be structured as 7 rows x 2 columns, with the first column containing sequence names and the second column containing nucleotide sequences.

Reference

An organism name (currently accepts "Salmonella" or "E.coli") which lets the function know which reference file to select. The reference sequence files are provided as part of the package.

Value

A list with 2 elements containing the user's formatted sequences. List element 1 contains the concatenated query sequences. List element 2 contains the re-sorted and concatenated reference sequence file. Both of these will be used as inputs for the EPA-NG wrapper function.

Examples

Sequence_Outputs<-Data_Preparation(PathToAlignedQuery = "/path/to/your/file.fasta",Aligned_ReferenceFile = Full_16s_Data_Aligned)

Dogrinev/Seroplacer documentation built on Jan. 28, 2024, 11:26 p.m.