Hello, everyone I use the package called Tximport for long time to generate the tables I use for RNA-Seq. The code is quite simple. Here it is:
gene_id_import <- read.delim("gene_id_import.txt") # This is the file with the transcripts version and their respective gene names.
library(tximport)
filepath = "C:/ad4gy/MM"
files<- sapply(list.dirs(path = filepath, recursive = FALSE)[grep("_quant2TRIMbias",list.dirs(path = filepath, recursive = FALSE))],function(x) paste0(x,"/quant.sf"))# This command picks the quant.sf files inside each folder
#Tximport with length scaled TPM values as output (scaled up to library size and average transcript length over samples)
txi<- tximport(files= files, type= "salmon", tx2gene = gene_id_import, countsFromAbundance = "lengthScaledTPM")# When I run this line, now it’s giving the error:
**reading in files with read_tsv
Error in parse_con(txt, bigint_as_char) :
lexical error: invalid bytes in UTF8 string.
"seqBias": [], "": "–gcBias", "auxDir": "aux_in
(right here) ------^**
#save your output file typing:
write.table(txi, file = "counts.txt", quote = TRUE, sep = "\t")
I have no idea about this error or how to correct it. Besides, it’s in the last line of the code. I noticed the mistake started after I upgrade to R4.0.3 Does anyone have any idea how to fix it. I appreciate all the help Regards,
Are you sure that
files
contains just thequant.sf
files? Have you checked the contents offiles
?Hi, I've checked the content of files. And yes, the quant.sf files are there