line 1: syntax error near unexpected token `Rsubread
1
0
Entering edit mode
12 weeks ago

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 • 353 views
ADD COMMENT
4
Entering edit mode
12 weeks ago

how do you invoke this script ?

ADD COMMENT
2
Entering edit mode

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

Thank you so much

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

Or Rscript script.R

ADD REPLY

Login before adding your answer.

Traffic: 2093 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6