Roleren / ORFik

MIT License
32 stars 9 forks source link

Error in shiftFootprintsByExperiment #156

Closed Arek86 closed 9 months ago

Arek86 commented 9 months ago

Hi Roleren! I'm assuming I have a similar problem to #123 that I can't seem to figure out how to deal with. I run the RIBO-Seq pipeline according to the manual. I work with A.thaliana data and bam files generated with STAR.

I already updated ORFik to 1.23.6.

I run successfully first commands:

#for windows users
BiocParallel::register(BiocParallel::SerialParam(), default = TRUE)
  1. Create an experiment from bam files, with fasta and gtf files. In the same folder is present index file for fasta. With the same name, with fai extension.

    create.experiment(dir = dir_to_bam,
                  exper = "RIBO-SeqE",
                  saveDir = results_dir,
                  fa = fasta_dir,
                  txdb = gtf_dir,
                  organism = organism,
                  assembly = "TAIR10.1",
                  rep = c(1,2,3,1,2,3),
                  condition = rep(c("C", "E"), each = 3),
                  viewTemplate = T,
                  types = "bam",
                  libtype = "RFP"
                  )
  2. General QC

df.rfp <- read.experiment("RIBO-SeqE.csv")
ORFikQC(df.rfp)

QC was done with no warnings and errors.

  1. P-shifting of Ribo-seq reads
shiftFootprintsByExperiment(df.rfp, verbose = T)

and I get this error:

Error: BiocParallel errors 1 remote errors, element index: 1 5 unevaluated and other errors first remote error: Error in covRleFromGR(x, weight = weight, ignore.strand = ignore.strand): Seqlengths of x contains NA values!

I tried the default and custom settings of the shiftFootprintsByExperiment command.

I will be glad for your help. Thanks!

Roleren commented 9 months ago

df <- read.experiment("RIBO-SeqE")
txdb <- loadTxdb(df)
ribo <- fimport(filepaths(df[1,])) #load first library in ofst format
detectRibosomeShifts(txdb, ribo)```

What error do you get ?
Arek86 commented 9 months ago

Hi! thank you for your quick response. from these commands, I get:

txdb <- loadTxdb(df.rfp)
ribo <- fimport(filepath(df.rfp[1,], type = "ofst")) #load first library in ofst format 
detectRibosomeShifts(txdb, ribo)

Error in loadTxdb(txdb) : txdb must be path or TxDb

However, before create.experiment() I run this:

annotation <- getGenomeAndAnnotation(
organism = organism, 
output.dir = output_dir, 
GTF = gtf_dir, 
genome = fasta_dir
)

and than I run create.experiment() like this:

create.experiment(dir = dir_to_bam,
                  exper = "RIBO-SeqE",
                  saveDir = results_dir,
                  fa = annotation["genome"],
                  txdb = paste0(annotation["gtf"], ".db"),
                  organism = organism,
                  assembly = "TAIR10.1",
                  rep = c(1,2,3,1,2,3),
                  condition = rep(c("C", "E"), each = 3),
                  viewTemplate = T,
                  types = "bam",
                  libtype = "RFP"
                  )

After that shiftFootprintsByExperiment() works correctly, with no errors. I don't know how the rest of the commands from the pipeline, but right now to this point it works fine :) I will let you know when I run whole pipeline.

Best

Roleren commented 9 months ago

How did it go?

Any help you need to understand output?

Else I will close this issue in 2 days :)