alyssafrazee / polyester

Bioconductor package "polyester", devel version. RNA-seq read simulator.
http://biorxiv.org/content/early/2014/12/12/006015
90 stars 51 forks source link

gcbias argument in simulate experiment #55

Open Aslic opened 6 years ago

Aslic commented 6 years ago

Hi Alyssa,

I am using polyester package to simulate counts with and without GC bias for 16 samples (8 per group). I am using integers that correspond to Loess models that come with the package. This is how I generated the array:

cg_model<-sample(0:7,16,replace = TRUE)

And then I simulate the experiment:

simulate_experiment('chr22_shuffled.fa', num_reps=c(8,8), reads_per_transcript=basereads, fold_changes=foldm[[1]], outdir='simulated_readswBias', paired = FALSE, gcbias = as.list(cg_model), seed=1234) And get this error

Error in simulate_experiment("chr22_shuffled.fa", num_reps = c(8, 8), : gc bias parameters must be integers 0 through 7 or loess objects

Parameters are definitely integers. I also tried to enter gcbias as an array to no avail. The code runs beautifully without the gcbias parameter. Any clue as to what is wrong?

Thank you. Any help is appreciated.

warrenmcg commented 6 years ago

Hi @Aslic, your call to simulate_experiment has this for gcbias: gcbias = as.list(cg_model). The function is expecting a numeric vector, but you are sending it a list. cg_model is already a numeric vector, so you can send it in directly like so: gcbias = cg_model. That should solve your problem, but if you are still getting an error, then come back and explain what you see.