mquinodo / OFF-PEAK

CNV detection tool for WES data
6 stars 0 forks source link

Failing at step 1, because my target bed has only 3 columns #1

Closed pauline-ng closed 5 months ago

pauline-ng commented 6 months ago

Hi,

I'm excited to try OFF-PEAK! I'm getting an error :

 -> No use of --paddingOfftarget option, value set as default: 300
Step 1: extracting exons from gene file and selected the targeted ones
Error in Ops.factor(b[, 1], a[i, 1]) : 
  level sets of factors are different
Calls: [ -> [.data.frame -> which -> Ops.factor
Execution halted
Error: The requested file (/home/pauline/OFF-PEAK/data/hg19_ncbiRefSeq.test.exons.sort.merge.offtar.bed) could not be opened. Error message: (No such file or directory). Exiting!
Step 2: extend on-targets smaller than --minOntarget
awk: fatal: cannot open file `/home/pauline/OFF-PEAK/data/hg19_ncbiRefSeq.test.exons.sort.merge.ontar.bed' for reading (No such file or directory)

*****
***** ERROR: Requested column 4, but database file /home/pauline/OFF-PEAK/data/hg19_ncbiRefSeq.test.exons.sort.merge.ontar.ext.bed only has fields 1 - 0.

I dug deeper and it's failing at:

Rscript $here/subscripts/annotate-targets.R $file.$name.exons.sort.merge.bed $targets.$name.merged.bed $file.$name.exons.sort.merge.ontar.bed $file.$name.exons.sort.merge.offtar.bed

My target_bed has only 3 columns (chrom, start, end). Any clue what's going wrong?

(Edited because I realized I was looking at the wrong R script)

Thanks

pauline-ng commented 6 months ago

I was able to get the Rscripts running by assigning the dataframes the same levels. Code like below was added to

subscripts/annotate-off-targets.R
subscripts/annotate-targets.R
levelsa = levels (a[[4]])
levelsb  = levels (b[[1]])
union_levels <- union (levelsa, levelsb)
a[,4] <- factor (a[,4], levels=union_levels)
b[,1] <- factor (b[,1], levels=union_levels)
mquinodo commented 5 months ago

Hi Pauline,

Thank you very much for reporting the error and trying OFF-PEAK. I realised the errors can simply be corrected by adding "stringsAsFactors = FALSE" in all scripts. It was forced in the environment where we tested OFF-PEAK. I have update all scirpts accordingly.

Please, do not hesitate to report any other issues.

Best, Mathieu