fasta2df: Convert a FASTA of Spacers to a Dataframe

View source: R/fasta2df.R

fasta2dfR Documentation

Convert a FASTA of Spacers to a Dataframe

Description

This function allows you to convert a FASTA containing CRISPR array spacers to a dataframe compatible with the rest of the package.

Usage

fasta2df(
  fastaFile,
  arrayNumbers,
  arrayLengths,
  arrayOrientations,
  arrayRepeats,
  spacerDataFrameName
)

Arguments

fastaFile

The location of the FASTA file containing the CRISPR array. Spacers will be numbered in the order that they appear in the FASTA file.

arrayNumbers

A vector of the numbers to denote which CRISPR array the spacers came from.

arrayLengths

A vector of the number of spacers in each CRISPR array.

arrayOrientations

A vector indicating the direction of each CRISPR array. Can input either "Forward" or "Reverse".

arrayRepeats

A vector indicating the repeat sequence for each CRISPR array.

spacerDataFrameName

The name of the dataframe output.

Examples

Given a set of 3 CRISPR arrays of lengths 20, 45, and 100 spacers, all in the forward orientation with the sequence repeat "ATCGATCGATCGATCG", you would enter:
df2fasta(fastaFile = "yourFileLocation", arrayNumbers = c(1,2,3), arrayLengths = c(20,45,100), arrayOrientations = c("Forward", "Forward", "Forward"), arrayRepeats = c("ATCGATCGATCGATCG","ATCGATCGATCGATCG","ATCGATCGATCGATCG"), spacerDataFrameName = "yourDataframeName")

grybnicky/Spacer2PAM documentation built on Jan. 30, 2023, 2:55 a.m.