-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add --clip
argument to bedgraphtobigwig
#58
base: master
Are you sure you want to change the base?
Conversation
Hi @nleroy917, nice to see a PR :) Of your three options, 1 definitely does seem like not the right option. 2 and 3 are similar, in that you're modifying One important note: in the I have a couple other thoughts: First, the naive thing to do would be just "pretend" everything is fine to Second, it's not a big deal, but so far Thoughts? |
Wow has it been a month? @jackh726 apologies for how long it took to get back to this! I promise I haven't forgotten! I've read through, and I really like the idea of making the Stay tuned I am going to keep going on this. |
No wories, let me know if you get stuck and need some thoughts! |
Hey @jackh726!
As mentioned in #56, this PR adds a new option to the
bedgraphtobigwig
binary that will "skip" any chromosomes in the.bedGraph
file that are not represented in the givenchrom.sizes
file. This functionality is inspired by the kent utils-clip
option inwigToBigWig
.I appreciate you letting me take a stab at this. Currently... it's unfinished. It is not working properly, but I thought I'd open it and get your immediate feedback. I think I'm getting stuck in an infinite loop and will continue working.
Anyways, after getting my bearings, I was able to quickly add
--clip
toBBIWriteOptions
. I had some troubles deciding how to implement the skip logic, however.I believe that I was able to find the source of the error... The
do_read
that gets passed as thestart_processing
argument inprocess_to_bbi
will return theProcessDataError::InvalidChromosome
error if the chromosome is not found inchrom.sizes
. I had three ideas to go forward:clip
to theprocess_to_bbi
function in theBBIDataSource
trait. Then, insidematch
the error and skip ifclip
is true. I didn't like this since it felt too specific for the trait.ProcessDataError::ClippedChromosome
. Ifclip
is true, return this instead of the currentProcessDataError::ClippedChromosome
. Likewise, this can be matched insideprocess_to_bbi
and enable a "skip"-like feature. This felt weird since its not really an error.ProcessDataError::InvalidChromosome
. Again,match
on this error and that field being true, skip the chromosome.I went with option three since it seemed the least hacky and most idiomatic/rusty way. I'm curious to your thoughts on this and it seems the real trick is just getting those
BBIWriteOptions
intoprocess_to_bbi
.Will continue working on the infinite loop, so stay tuned. Thank you!