rr1859 / R.4Cker

MIT License
16 stars 15 forks source link

nearbait error #49

Open DimitrisZisis opened 6 years ago

DimitrisZisis commented 6 years ago

Dear Ramya,

I am producing bedgraph files from bam by using your script ( i modified the chr and i add it at the end cause my mapping files had only 1,2 etc instead of chr1, chr2 ) . When i am trying to run 4Cker for mouse data i have an error sometimes . this is the R input I used and error message :

my_obj = createR4CkerObjectFromFiles(files = c( "bedGraph_files/ESC_pcdhb19_1_fragments_chr_new.bedGraph", "bedGraph_files/ESC_pcdhb19_2_fragments_chr_new.bedGraph", "bedGraph_files/ESC_pcdhb19_3_fragments_chr_new.bedGraph", "bedGraph_files/iPSC_Pcdhb19_1_fragments_chr_new.bedGraph", "bedGraph_files/iPSC_Pcdhb19_2_fragments_chr_new.bedGraph",
"bedGraph_files/iPSC_Pcdhb19_3_fragments_chr_new.bedGraph"), bait_chr="chr18", bait_coord= 37483203, bait_name = "Pcdhb19", primary_enz = "AAGCTT", samples = c("ESC_pcdhb19_1", "ESC_pcdhb19_2", "ESC_pcdhb19_3", "iPSC_Pcdhb19_1", "iPSC_Pcdhb19_2", "iPSC_Pcdhb19_3"), conditions = c("ESC","iPSC"), replicates = c(3,3), species = "mm", output_dir = "Mouse_4cker_Fragments_13_6_2018", enz_file=enz_file) nb_results=nearBaitAnalysis(my_obj,k=10) [1] "Building adaptive windows..." [1] "Normalizing counts..." [1] "Generating synthetic samples...." [1] "Parameter estimation....." Error in if (as.character(windows[i, 1]) == chr & windows[i, 2] <= end & : missing value where TRUE/FALSE needed

As because i have a 6bp cutter i use for nearbait k=10 and i have the error. If i change the k=5 it works . I have seen that this happened again but i dont get what is the solution . Could you please help me with that ?

Best

Dimitris Zisis

erinbrettmann commented 6 years ago

I am getting this error, as well, but for me changing the value of k didn't fix it. Oddly, I have run the same files previously without getting the error, so I have no idea what's causing it. Can anyone tell me what this error means, and how to fix it? Thanks, Erin Brettmann

rr1859 commented 6 years ago

Hi,

Sorry for the late reply. I think the issue is to do with merging the windows of the final output. I have modified the merge_windows.R file. Please try now and let me know if the problem is still there.

erinbrettmann commented 6 years ago

Thank you, that appears to have fixed it!