This is a test version of Biostars. For the public version, visit https://www.biostars.org.
line 1: syntax error near unexpected token `Rsubread

Hi, I have problem with my featurecounts script. here is my script. I dont know what is wrong with it. I tried it before it was working without any error but now its giving this error. I check it for syntax but it's seems right to me.

line 1: syntax error near unexpected token `Rsubread'

Any help will me great and useful. Thank you to everyone.

library(Rsubread)
library(BiocParallel) 
library(limma) 
library(edgeR) 
library(stringr


 #feature_counts####

         bams <- c("SRR20740644.bam",
                   "SRR20740645.bam",
                   "SRR20740660.bam",
                   "SRR20740661.bam")
    ###counts
    counts <- featureCounts(files = bams,
                                annot.ext = "gencode.v41.primary_assembly.annotation.gtf",
                                isGTFAnnotationFile= TRUE,
                                GTF.featureType= c("exon"),
                                GTF.attrType="gene_id",
                                useMetaFeatures=T,
                                countMultiMappingReads=T,
                                isPairedEnd=FALSE,
                                nthreads=24)

    counts_df <- as.data.frame(counts$counts)
    write.table(counts$counts, "/archive/alotaibih/sehribanb/New_rna/d1/Counts/counts.csv", quote = F, col.names = T, sep = "\t")
      #calculate fpkm values
      z <- DGEList(counts=counts$counts, genes=counts$annotation[,c("GeneID","Length")])
      z<- calcNormFactors(z)
      RPKM <-rpkm(z)
      write.table(RPKM, "/archive/alotaibih/sehribanb/New_rna/d1/Counts/fpkm_values.csv", quote = F, col.names = T, sep = "\t")

    done
featurecounts rna-seq linux

1 answer

how do you invoke this script ?

my goodness right, ı was used bash script.R but it should be R CMD BATCH script.R

Thank you so much

Please accept the answer so the question is marked solved on the website. To do that, click on the green check mark on the left side of the answer.

Or Rscript script.R

Log in to answer this question.