Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parameter estimation issues #29

Open
daler opened this issue Apr 6, 2017 · 5 comments
Open

parameter estimation issues #29

daler opened this issue Apr 6, 2017 · 5 comments

Comments

@daler
Copy link

daler commented Apr 6, 2017

Hi @rr1859 -

For a 4-bp cutter experiment with 3 replicates, using the recommend k=3 or k=5 in a near-bait analysis causes lots of warnings ("Warning: only 1 iteration. Using starting parameters") followed by the error Error in 2:nrow(windows) : argument of length 0. Interestingly this does not happen with k=4.

This appears to be from repeated calls to parameterEstimationCis, which is returning parameters identical to the starting parameters. When this happens enough times, the value of lower is finally small enough to exit out of the while-loop in nearBaitAnalysis. At that point, the par_est_results$mod_fit is still the same as the starting parameters.

So that explains the "Using starting parameters" errors, but not the "Error in 2:nrow(windows)" error.

Tracking this down further, it appears that the error is from viterbi3State, in this line:

write.table(merge_windows(final_intersect_trim_hi),paste(output_dir,bait_name, "_", region, "_highinter.bed", sep =""),
. The problem is that in the table_intersect dataframe, there are no regions that are called as high-interacting in all replicates, and so final_intersect_trim_hi is NULL and merge_windows raises the error.

I tried changing set.seed(7) to set.seed(NULL) but this did not solve the issue.

Can you provide some insight into why this error is occurring on k=3 and k=5 but not k=4? I'd be happy to provide bedGraphs. Thanks.

@rr1859
Copy link
Owner

rr1859 commented Apr 28, 2017

Hi - sorry for the late reply but I was traveling this month. I would be interested in seeing the bedgraphs and also the stats file. Not sure why it only works for k=4.

@daler
Copy link
Author

daler commented May 4, 2017

Thanks. I'm actually unable to consistently reproduce, and still trying to get a minimally working example. However, would it be possible to add some error checking in merge_windows to avoid such issues? It seems that finding less than 2 interacting regions in a replicate will cause a crash.

@daler
Copy link
Author

daler commented May 5, 2017

@rr1859 is there an email I could send you some problematic bedgraphs?

@rr1859
Copy link
Owner

rr1859 commented May 5, 2017

rraviram@ucsd.edu

@sameet
Copy link

sameet commented Oct 12, 2017

This error still seems to happen randomly. Admittedly the data did not pass QC. But the nearbait analysis failed at k=5, and k=4, but worked with k=3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants