R/concatipede_prepare.R
concatipede_prepare.Rd
This function creates a template correspondence table that can also be saved in the working directory.
concatipede_prepare(fasta_files, out = "seqnames", excel = TRUE, exclude)
Optional, a vector of paths to the fasta files that should be merged. If this argument is missing, the function automatically detects and uses all the fasta files present in the working directory.
Optional, a filename for the correspondence table template to save (without extension). No file is saved if out
is not provided. In all cases, the function also returns a tibble with the correspondence table template (invisibly if out
is provided).
Boolean, should the correspondence table template be saved in excel format? If FALSE
, it is saved as a tab-separated text file instead. Default is TRUE
. The correct file extension is automatically appended to the out
argument. If out
is missing, this argument has no effect.
If no fasta_files
argument has been passed, fasta files matching the exclude
pattern will be ignored by the function when it automatically detects fasta files in the working directory.
A tibble with the correspondence table template (invisibly if an out
argument was provided to save the table to a file).
dir <- system.file("extdata", package = "concatipede")
fasta_files <- find_fasta(dir)
z <- concatipede_prepare(fasta_files)
z
#> # A tibble: 13 × 5
#> name COI_Macrobiotidae.f… ITS2_Macrobioti… LSU_Macrobiotid… SSU_Macrobiotid…
#> <dbl> <chr> <chr> <chr> <chr>
#> 1 0 KX129796_Mesobiotus… MF441490_Mesobi… MF441489_Mesobi… MH197146_Mesobi…
#> 2 0 MH195150_Mesobiotus… MH197150_Mesobi… MH197151_Mesobi… MH197158_Mesobi…
#> 3 0 MH195149_Mesobiotus… KX129795_Mesobi… MH197264_Mesobi… MF4414882_Mesob…
#> 4 0 MF441491_Mesobiotus… MH197154_Mesobi… KX129794_Mesobi… KX1297932_Mesob…
#> 5 0 MK737919_Macrobiotu… MH666090_Parama… MN888364_Sisubi… MK737073_Macrob…
#> 6 0 MK737920_Macrobiotu… MH666080_Parama… MH664950_Parama… MN888369_Macrob…
#> 7 0 MH676011_Paramacrob… MN888344_Sisubi… MH664948_Parama… MN435112_Macrob…
#> 8 0 MN888324_Sisubiotus… MK737067_Macrob… MK737071_Macrob… MH063922_Macrob…
#> 9 0 MK737922_Macrobiotu… MK737066_Macrob… MN888355_Macrob… MK737070_Macrob…
#> 10 0 MN888317_Macrobiotu… MH063923_Macrob… MN435116_Macrob… MK737069_Macrob…
#> 11 0 MH675998_Paramacrob… MN435120_Macrob… MH063924_Macrob… MN888372_Sisubi…
#> 12 0 MN482684_Macrobiotu… MK737072_Macrob… MK737064_Macrob… MH664931_Parama…
#> 13 0 MH057764_Macrobiotu… MN888338_Macrob… MK737063_Macrob… MH664941_Parama…