Creating a manifest file in R - StevenMamet/qiime2-P2IRC GitHub Wiki

Set the path to where your sequence files are stored

path <- "/Volumes/P2IRC13/Data/DNA_sequencing/Taxonomy_tables/qiime2_canola_2016_2017/ResequenceRun_Mar2019/Soil"

Create a dataframe of the file locations

manifest <- data.frame(list.files(path), stringsAsFactors = F)

Extract the sample names

sample_id <- sapply(strsplit(manifest$list.files.path., "_"), "[", 1)

Make the file paths

absolute_filepath <- paste("$PWD/primer_trimmed_fastqs/", manifest$list.files.path., sep = "")

Make the read directions

direction <- rep(c("forward","reverse"), 1337)

Make a new data frame including the required columns

manifest1 <- cbind.data.frame(sample_id, absolute_filepath, direction)

Rename the columns

names(manifest1) <- c("sample-id", "absolute-filepath", "direction")

Output the file as comma-separated text

write.table(manifest1, "~/Dropbox/CFREF Work/SteveM/Canola winnowing/Rcode/Rhizosphere/manifest.txt", quote = FALSE, append = FALSE, row.names = FALSE, col.names = TRUE, sep = ",")