convertAlign: Convert any format of DNA alignment into another format

View source: R/convertAlign.R

convertAlignR Documentation

Convert any format of DNA alignment into another format

Description

Convert one or multiple DNA alignments in FASTA, NEXUS or PHYLIP format into each other.

Usage

convertAlign(filepath = NULL,
          format = NULL,
          rmfiles = FALSE,
          dir = NULL)

Arguments

filepath

Path to the directory where the DNA alignments are stored.

format

Define either "NEXUS", "FASTA" or "PHYLIP" format for writing the resulting newly converted files.

rmfiles

Logical, if TRUE, the original input file(s) are removed from the directory and only the newly converted files are kept.

dir

The path to the directory where the newly converted files should be saved. If no directory is given, then the files will saved in a subfolder named after the current date under the folder named RESULTS_convertAlign.

Author(s)

Domingos Cardoso

Examples

## Not run: 
library(catGenes)

data(GenBank_accessions)

todaydate <- format(Sys.time(), "%d%b%Y")
folder_mined_seqs <- paste0("RESULTS_mineSeq/", todaydate)
folder_aligned_seqs <- paste0("RESULTS_alignSeqs/", todaydate)

mineSeq(inputdf = GenBank_accessions,
        gb.colnames = c("ITS", "matK"),
        as.character = FALSE,
        verbose = TRUE,
        save = TRUE,
        dir = "RESULTS_mineSeq",
        filename = "GenBanK_seqs")
        
alignSeqs(filepath = folder_mined_seqs,
          method = "ClustalW",
          gapOpening = "default",
          format = "NEXUS",
          verbose = TRUE,
          dir = "RESULTS_alignSeqs")       

convertAlign(filepath = folder_aligned_seqs,
          format = "PHILIP",
          rmfiles = FALSE)

## End(Not run)


domingoscardoso/catGenes documentation built on Feb. 6, 2025, 9:01 p.m.