I'm trying to rerun code that I've successfully run previously but I keep getting the error message
Error in file(con, "r") : invalid 'description' argument
The loop I'm using is the following
# Null All Transcripts
setwd("/mnt/data/BMOHAMED/Total_RNAseq/salmon/MDM2/SCU_male/SCU_all/")
path = "/mnt/data/BMOHAMED/Total_RNAseq/salmon/MDM2/SCU_male/SCU/SCU_all/"
out.file <- ""
file.names <- dir(path, pattern ="Null_CDS_allTx.fasta")
table <- NULL
# calculate the codon frequency
for(i in 1:length(file.names)){
print(i)
file <- read.fasta(file.names[i],as.string=FALSE)
name <- file.names[i]
name <- gsub(".fasta","",name)
print(name)
UCO <- lapply(file, function(x) uco(x, frame = 0, index = "freq", as.data.frame = FALSE, NA.rscu = NA))
UCO1 <- do.call(rbind,UCO)
UCO1 <- as.data.frame(UCO1)
colnames(UCO1) <- aa$AA
head(UCO1)
}
Any ideas why this has gone wrong? I've tried looking at online answers but none of them suit what I'm trying to solve. Thanks in advance!