Read a fasta file into a list and assign to the environment
Source:R/read_fasta_list.R
read.fasta_to_list.Rd
This function reads a fasta file and creates a list with two columns: Header and Sequence. The list is then assigned to the environment with the name same as the fasta file name but without the .fasta extension.
Examples
sample_file_path <- system.file("extdata", "sample_fa.fasta", package = "baseq")
read.fasta_to_list(sample_file_path)
#> File C:/Users/BSL CTCRI/AppData/Local/Temp/RtmpYlDm86/temp_libpath49301e5117b7/baseq/extdata/sample_fa.fasta assigned as a list with name sample_fa
# Access a specific sequence by name
sample_fa[["sample_seq.1"]]
#> [1] "TGATTGAGGTGACAGTTTCTGAGTTAAACTGCAGATCGGAAGAGCACAC"