HiCUP icon indicating copy to clipboard operation
HiCUP copied to clipboard

Improve hicup2juicer

Open lldelisle opened this issue 3 years ago • 2 comments
trafficstars

Dear HiCUP developers, I would like to add 2 options to the hicup2juicer converter:

  • --digest this would allow to retrieve the fragment id instead of the dummy values 0 and 1. This was written using the code from hic_filter.
  • --usemid this would allow to use as position in the output the middle of the fragment instead of the 5' end.

I don't know perl but I made some tests and it seems to work as expected:

$ Conversion/hicup2juicer tests/dataset1_2.hicup.bam
$ cp tests/dataset1_2.hicup.bam tests/dataset1_2.hicup_test2.bam
$ Conversion/hicup2juicer -digester tests/digester_file.txt tests/dataset1_2.hicup_test2.bam
$ cp tests/dataset1_2.hicup.bam tests/dataset1_2.hicup_test3.bam
$ Conversion/hicup2juicer -usemid -digest tests/digester_file.txt tests/dataset1_2.hicup_test3.bam
$ head tests/*er
==> tests/dataset1_2.hicup.bam.prejuicer <==
1       0       chr21   10012821        0       0       chr21   10045579        1       40      42
2       1       chr21   10054920        0       1       chr21   10338847        1       42      42
3       0       chr21   10355322        0       1       chr21   30747032        1       40      34
4       0       chr21   10497306        0       0       chr21   10507687        1       40      23
5       0       chr21   10508845        0       0       chr21   43190469        1       42      23
6       0       chr21   10592898        0       1       chr21   24334291        1       42      42
7       0       chr21   10595624        0       1       chr21   10651483        1       42      42
8       0       chr21   10595648        0       0       chr21   5258688 1       42      40
9       1       chr21   10691207        0       0       chr21   7926371 1       3       40
10      0       chr21   10709991        0       1       chr21   7918804 1       0       0

==> tests/dataset1_2.hicup_test2.bam.prejuicer <==
1       0       chr21   10012821        1013    0       chr21   10045579        1027    40      42
2       1       chr21   10054920        1029    1       chr21   10338847        1068    42      42
3       0       chr21   10355322        1073    1       chr21   30747032        7134    40      34
4       0       chr21   10497306        1118    0       chr21   10507687        1120    40      23
5       0       chr21   10508845        1121    0       chr21   43190469        10593   42      23
6       0       chr21   10592898        1148    1       chr21   24334291        5077    42      42
7       0       chr21   10595624        1148    1       chr21   10651483        1160    42      42
8       0       chr21   10595648        1148    0       chr21   5258688 52      42      40
9       1       chr21   10691207        1160    0       chr21   7926371 576     3       40
10      0       chr21   10709991        1160    1       chr21   7918804 576     0       0

==> tests/dataset1_2.hicup_test3.bam.prejuicer <==
1       0       chr21   10010683        1013    0       chr21   10042881        1027    40      42
2       1       chr21   10056032        1029    1       chr21   10339050        1068    42      42
3       0       chr21   10354653        1073    1       chr21   30741887        7134    40      34
4       0       chr21   10497019        1118    0       chr21   10502642        1120    40      23
5       0       chr21   10508400        1121    0       chr21   43190769        10593   42      23
6       0       chr21   10593347        1148    1       chr21   10696306        1160    42      42
7       0       chr21   10593347        1148    1       chr21   24327493        5077    42      42
8       0       chr21   10593347        1148    0       chr21   5257358 52      42      40
9       0       chr21   10696306        1160    1       chr21   7911559 576     0       0
10      1       chr21   10696306        1160    0       chr21   7911559 576     3       40

The inputs were taken from https://github.com/lldelisle/tools-lldelisle/tree/master/tools/fromHicupToJuicebox where I developped a python script more than 4 years ago when HiCUP was not on github and therefore it was more difficult to contribute. For me it make more sense to integrate it to HiCUP rather than developping my python script in parallel.

I hope you will appreciate my contribution.

lldelisle avatar Oct 24 '22 08:10 lldelisle

Hi,

Just seen your pull request. I'll take a look next week.

Many thanks!

StevenWingett avatar Oct 28 '22 15:10 StevenWingett

This is a great news. I look forward your review.

lldelisle avatar Oct 28 '22 15:10 lldelisle

Hi, Just a kind message to say that I am still interested in your review.

lldelisle avatar Nov 25 '22 14:11 lldelisle

Hi,

I'll definitely review it shortly - your contribution is very much appreciated! We are just finishing off a paper and then I'll sort this out (along with some other projects on-hold).

Many thanks once again.

Best, Steven

StevenWingett avatar Nov 28 '22 17:11 StevenWingett

Hi,

Sorry for the delay. This seems to be working! Thanks.

Could I just ask a small favour. Would you mind creating a pull request to the hicup/devel branch instead and I'll merge into there (I typically only have the latest release in the master branch - although documentation changes are allowed).

Thanks very much for contributing to HiCUP.

Best, Steven

StevenWingett avatar Dec 02 '22 16:12 StevenWingett

I merged devel into my branch but it looks like devel was behind master... Maybe you want to merge master in devel first so we better see the changes I propose.

lldelisle avatar Dec 02 '22 22:12 lldelisle

Hi,

I've forked a branch named devel2 from Master. Would you be able to merge into devel2 and then I can merge everything together for the next release.

Thanks very much!

Steven

StevenWingett avatar Dec 05 '22 13:12 StevenWingett

I think now it should be ok.

lldelisle avatar Dec 05 '22 14:12 lldelisle

Thanks for the contribution! That code will make its way into the next update.

StevenWingett avatar Dec 06 '22 09:12 StevenWingett

Hi @StevenWingett , Any idea when the update would be?

lldelisle avatar Feb 08 '23 14:02 lldelisle

Hi,

You are correct, I had expected to have made changes to HiCUP by now. I'll make a new update next week that incorporates just your patch.

Many Thanks! Steven

StevenWingett avatar Feb 12 '23 19:02 StevenWingett

Hi,

The new version has been released. Thanks for your help once again.

All the best, Steven

StevenWingett avatar Feb 14 '23 18:02 StevenWingett

Thanks for the release

lldelisle avatar Feb 14 '23 18:02 lldelisle