This is a test version of Biostars. For the public version, visit https://www.biostars.org.
errors in multiple sequencing alignment in r by use msa package!!

hi i am try to do multiple sequencing alignment in r by use msa package, so i download fasta file form NCBI and read it by read.fast, and put all my files in vector, but when i try to put my file in readDNAStringSet it give me this error Error in .normarg_input_filepath(filepath) : 'filepath' must be a character vector with no NAs

This is my code

library(seqinr)


fileOne <- read.fasta(file = 'p53 human .fasta', seqtype = "DNA",  as.string = T, forceDNAtolower= F )
fileTwo <- read.fasta(file = 'P53 mouse.fasta', seqtype =  "DNA", as.string = T,forceDNAtolower= F)

file3 <- c(fileOne, fileTwo)

library(msa)
library(Biostrings)
library(XVector)


 seq = readDNAStringSet( file3)
r alignment software error

you can do this way:

library(Biostrings)
fileOne <- readDNAStringSet("p53 human.fasta", format="fasta")
fileTwo <- readDNAStringSet("p53 mouse.fasta", format="fasta")
seq=c(fileOne,fileTwo)

This would concatenate two DNAstringset tobjects and create 'seq' DNAstringset object. But what do you want to do? In OP, two different fasta files are read and concatenated. Then you are trying to convert/read the concatenated file into a DNAstringset object.

1 answer

Your file3 variable now contains the concatenated contents of fileOne and fileTwo. The argument to readDNAStringSet() should be paths to files. Read the docs.

Log in to answer this question.