# Error in if (is.na(sra_accrun[i])) { : argument is of length zero I am trying to write a code for importing sra files as fastq files in Rstudio (for obtaining and aligning RNA-seq reads from public repositories). I keep getting "Error in if (is.na(sra_accrun[i])) { : argument is of length zero" right after I run this code. Any suggestions on what might be going wrong? My code is as follows:

library(SRAdb)
Error in if (is.na(sra_acc$run[i])) { : argument is of length zero  • Have you confirmed whether file.exists('SRAmetadb.sqlite') is TRUE or FALSE? Or generally, what the value of any of your variables is? I am not familiar with this library but having sqlfile be a string that is overwritten by the return value of getSRAdbFile() (don't know what that is) seems like it might cause an issue. Also, are you intending to use the superassignment operator (<<-)? I believe that you are using it in a non-standard way: stat.ethz.ch/pipermail/r-help/2011-April/275905.html Jan 29 at 20:34 ## 1 Answer After checking with file.exists(), I would suggest you try the same command with another SRA run. It may happen that some runs are not accessible for reasons I do not know. I always have problems in accessing sra formatted files and use a workaround to download fastq. Here is my not official workaround: runlist<-sraConvert("SRP045534",sra_con=sra_con) runlist[1:2,] study submission sample experiment run 1 SRP045534 SRA179382 SRS685546 SRX681992 SRR1552451 2 SRP045534 SRA179382 SRS685544 SRX681990 SRR1552449 for (dloadrun in runlist$run)