This is a very beginner question, so thanks in advance.
I was given an R script to align from fastq files to a genome. All I need to do is sent this R script to my uni's cluster, but I want to make sure the script is running fine on my own computer before I send it into the void. I am trying to understand why my function won't run. It starts by loading a library, then the rest of the actions are included in one function. When I cmd+enter the function it only returns the text in blue in the console, but doesn't actually run anything. Therefore, I assume if sent to the cluster it would also do nothing. But...why?
For example, if I want the first part called "buildindex" to run I need to manually activate it. But if it is called solely through the function nothing happens. Please help me understand what I need to fix. This code was given to me by a postdoc who is too busy to help me with these problems.
library(Rsubread)
analyzeRNASeq <- function(){
buildindex(basename="/Users/iRebecca/Box/BEC_FILES/GENOMES/GC_", reference="/Users/iRebecca/Box/BEC_FILES/GENOMES/GCF_000006845.1_ASM684v1_genomic.fna.gz")
filePath <- "/Users/iRebecca/Box/BEC_FILES/GENOMES/file_list.csv"
fileNames <- read.table(filePath, header=TRUE, sep=",", quote="", stringsAsFactors=FALSE, comment="")
for(n in (1:nrow(fileNames))){
align(index="/Users/iRebecca/Box/BEC_FILES/GENOMES/GC_",
readfile1=fileNames[n,1],
readfile2=fileNames[n,2],
output_file=fileNames[n,3])
outputData <- featureCounts(files=fileNames[n,3],annot.ext="/Users/iRebecca/Box/BEC_FILES/GENOMES/GCF_000006845.1_ASM684v1_genomic.gff.gz",
isGTFAnnotationFile=TRUE,GTF.featureType="CDS",GTF.attrType="locus_tag")
outputFilePath <- fileNames[n,4]
write.table(outputData[1], file=outputFilePath, quote=FALSE, sep=",")
}
}
This is what I see on the console when I cmd+enter "analyzeRNAseq" function. What does the + on each line mean??
> analyzeRNASeq <- function(){
+
+ buildindex(basename="/Users/iRebecca/Box/BEC_FILES/GENOMES/GC_", reference="/Users/iRebecca/Box/BEC_FILES/GENOMES/GCF_000006845.1_ASM684v1_genomic.fna.gz")
+
+ filePath <- "/Users/iRebecca/Box/BEC_FILES/GENOMES/file_list.csv"
+ fileNames <- read.table(filePath, header=TRUE, sep=",", quote="", stringsAsFactors=FALSE, comment="")
+ for(n in (1:nrow(fileNames))){
+
+ align(index="/Users/iRebecca/Box/BEC_FILES/GENOMES/GC_",
+ readfile1=fileNames[n,1],
+ readfile2=fileNames[n,2],
+ output_file=fileNames[n,3])
+
+ outputData <- featureCounts(files=fileNames[n,3],annot.ext="/Users/iRebecca/Box/BEC_FILES/GENOMES/GCF_000006845.1_ASM684v1_genomic.gff.gz",
+ isGTFAnnotationFile=TRUE,GTF.featureType="CDS",GTF.attrType="locus_tag")
+ outputFilePath <- fileNames[n,4]
+ write.table(outputData[1], file=outputFilePath, quote=FALSE, sep=",")
+ }
+ }
In my mind, once I enter this function it should start running on my laptop but it isn't. Please help.