ay-lab / mustache

Multi-scale Detection of Chromatin Loops from Hi-C and Micro-C Maps using Scale-Space Representation
MIT License
64 stars 11 forks source link

mustache outputs on .cool file only chrX #22

Closed mblanche closed 3 years ago

mblanche commented 3 years ago

Hi, new bug to report, mustache only output chrX when run on a cool (or mcool) file with all chromosome, i think it rewrite over the output for every chromosome instead of appending results to the file. Should be an easy fix i think...

Problem: mustache only output chrX when processing .cool file

Expected behavior: All chromosomes loop are written to a single file

How to replicate:

Download test data and pull updated docker image:

wget https://dovetail-public.s3-us-west-2.amazonaws.com/publicData/mustacheEx/test_xlarge.cool
docker pull mblanche/mustache

Running only on chr1 reports loop on that chromosome:

docker run -i -v ${PWD}:/mnt mblanche/mustache mustache -p 24 -f /mnt/test_xlarge.cool -r 1000 -ch chr1 -o /mnt/test_chr1.tsv

Output produced

$ cat test_chr1.tsv 
chr1    27703000    27704000    chr1    27719000    27720000    0.058730870088279145    2.111212657236631
chr1    12123000    12124000    chr1    12209000    12210000    4.781826487842977e-05   2.111212657236631
chr1    7667000 7668000 chr1    7750000 7751000 3.352190756977791e-06   2.111212657236631
chr1    8027000 8028000 chr1    8313000 8314000 8.84808224321354e-05    2.599207668339954
chr1    9287000 9288000 chr1    9492000 9493000 0.000389912598719869    2.111212657236631
chr1    9290000 9291000 chr1    9457000 9458000 0.0001244653836892512   4.222425314473262
chr1    31461000    31462000    chr1    31548000    31549000    0.03206428934260979 4.222425314473262
chr1    40847000    40848000    chr1    40952000    40953000    0.054851710059485304    2.111212657236631
chr1    42913000    42914000    chr1    43073000    43074000    7.436971843910456e-06   3.2
chr1    46037000    46038000    chr1    46180000    46181000    0.02078321219285685 2.599207668339954
chr1    46038000    46039000    chr1    46171000    46172000    0.04800154402043615 3.2
chr1    46477000    46478000    chr1    46528000    46529000    0.04800154402043615 3.2
chr1    45358000    45359000    chr1    45491000    45492000    0.00904187572043084 2.599207668339954
chr1    48109000    48110000    chr1    48201000    48202000    0.0001698415416786503   2.111212657236631
chr1    48144000    48145000    chr1    48159000    48160000    0.18259572493930876 2.599207668339954
chr1    51897000    51898000    chr1    52002000    52003000    4.820291779283892e-06   2.111212657236631
chr1    53279000    53280000    chr1    53392000    53393000    0.00020036054520844448  2.111212657236631
chr1    54949000    54950000    chr1    54996000    54997000    0.12706120965450662 3.6758347359905126
chr1    55141000    55142000    chr1    55276000    55277000    0.0001074960142544712   2.599207668339954
chr1    60110000    60111000    chr1    60124000    60125000    0.19322931371207366 2.111212657236631
chr1    60446000    60447000    chr1    60459000    60460000    0.18772677728337867 2.599207668339954
chr1    62176000    62177000    chr1    62407000    62408000    1.645776177316982e-05   5.198415336679908
chr1    62180000    62181000    chr1    62407000    62408000    0.09162950944878309 2.111212657236631
chr1    59880000    59881000    chr1    59942000    59943000    0.019402142871441708    2.111212657236631
chr1    63616000    63617000    chr1    64245000    64246000    1.1532565734051481e-05  4.525483399593905
chr1    65959000    65960000    chr1    66243000    66244000    6.364387955537509e-07   5.571523605095194
chr1    66253000    66254000    chr1    66447000    66448000    2.2407036802674085e-05  3.6758347359905126
chr1    67532000    67533000    chr1    67761000    67762000    0.0004813658877778864   3.2
chr1    68117000    68118000    chr1    68332000    68333000    0.05540207118585941 2.599207668339954
chr1    68119000    68120000    chr1    68344000    68345000    2.3734640783201755e-05  5.571523605095194
chr1    68120000    68121000    chr1    68322000    68323000    0.003970168735433349    4.222425314473262
chr1    70132000    70133000    chr1    70510000    70511000    0.020736325968217128    3.2
chr1    84142000    84143000    chr1    84433000    84434000    6.501898864508249e-05   3.2
chr1    78131000    78132000    chr1    78615000    78616000    0.005649500976740371    2.111212657236631
chr1    89801000    89802000    chr1    89989000    89990000    0.0489313992913291  2.599207668339954
chr1    89804000    89805000    chr1    89984000    89985000    0.020683880990569985    3.2
chr1    92859000    92860000    chr1    92993000    92994000    4.20230147606393e-05    3.6758347359905126
chr1    94062000    94063000    chr1    94336000    94337000    0.025447951344766226    3.2
chr1    94532000    94533000    chr1    94803000    94804000    0.01121793676525708 2.111212657236631
chr1    94853000    94854000    chr1    95046000    95047000    0.06889366121647796 2.111212657236631
chr1    94857000    94858000    chr1    95040000    95041000    0.06410723481868681 2.111212657236631
chr1    91530000    91531000    chr1    91927000    91928000    0.0013394100846255328   2.599207668339954
chr1    110207000   110208000   chr1    110312000   110313000   0.000573967156147992    3.2
chr1    110214000   110215000   chr1    110311000   110312000   0.026663498059293307    2.111212657236631
chr1    110522000   110523000   chr1    110613000   110614000   0.08918673928601688 3.2
chr1    110631000   110632000   chr1    110763000   110764000   0.17129192353496844 2.111212657236631
chr1    100464000   100465000   chr1    100866000   100867000   1.1728536570831949e-06  6.4
chr1    101311000   101312000   chr1    101356000   101357000   0.07105042602875537 3.2
chr1    101662000   101663000   chr1    101678000   101679000   0.12616200620090073 2.599207668339954
chr1    107782000   107783000   chr1    108126000   108127000   1.6692939353024627e-06  3.2
chr1    109278000   109279000   chr1    109396000   109397000   0.0017137333362626796   3.6758347359905126
chr1    109777000   109778000   chr1    109983000   109984000   1.5112811002637727e-09  5.198415336679908
chr1    115140000   115141000   chr1    115465000   115466000   0.06180791321841151 2.111212657236631
chr1    112394000   112395000   chr1    112467000   112468000   0.016755969346429117    2.111212657236631
chr1    116080000   116081000   chr1    116094000   116095000   0.19923356135035813 2.111212657236631
chr1    116174000   116175000   chr1    116190000   116191000   0.19923356135035813 2.111212657236631
chr1    116383000   116384000   chr1    116398000   116399000   0.19923356135035813 2.111212657236631
chr1    116397000   116398000   chr1    116410000   116411000   0.19923356135035813 2.111212657236631
chr1    116453000   116454000   chr1    116468000   116469000   0.19923356135035813 3.2
chr1    116507000   116508000   chr1    116521000   116522000   0.19923356135035813 2.111212657236631
chr1    116697000   116698000   chr1    116709000   116710000   0.19937031255857887 2.111212657236631
chr1    116775000   116776000   chr1    116786000   116787000   0.19923356135035813 2.111212657236631
chr1    116792000   116793000   chr1    116809000   116810000   0.19923356135035813 3.2
chr1    116802000   116803000   chr1    116815000   116816000   0.19923356135035813 2.599207668339954
chr1    116847000   116848000   chr1    116860000   116861000   0.19923356135035813 2.111212657236631
chr1    116934000   116935000   chr1    116947000   116948000   0.19923356135035813 2.111212657236631
chr1    116942000   116943000   chr1    116956000   116957000   0.19923356135035813 2.111212657236631
chr1    117031000   117032000   chr1    117047000   117048000   0.19923356135035813 2.111212657236631
chr1    117062000   117063000   chr1    117073000   117074000   0.19923356135035813 2.111212657236631
chr1    117575000   117576000   chr1    117589000   117590000   0.19923356135035813 2.111212657236631
chr1    117677000   117678000   chr1    117691000   117692000   0.1962550806915287  2.111212657236631
chr1    117799000   117800000   chr1    117811000   117812000   0.19923356135035813 2.111212657236631
chr1    118024000   118025000   chr1    118035000   118036000   0.16941306547965643 2.111212657236631
chr1    118103000   118104000   chr1    118119000   118120000   0.16941306547965643 2.599207668339954
chr1    118173000   118174000   chr1    118185000   118186000   0.16941306547965643 2.111212657236631
chr1    118228000   118229000   chr1    118245000   118246000   0.16941306547965643 2.599207668339954
chr1    118429000   118430000   chr1    118443000   118444000   0.16941306547965643 2.111212657236631
chr1    118740000   118741000   chr1    118754000   118755000   0.19321452944499526 2.599207668339954
chr1    118753000   118754000   chr1    118768000   118769000   0.16941306547965643 2.111212657236631
chr1    118887000   118888000   chr1    118900000   118901000   0.16995479083299161 2.111212657236631
chr1    119287000   119288000   chr1    119368000   119369000   0.04793456568179239 2.599207668339954
chr1    119313000   119314000   chr1    119324000   119325000   0.19521665624843593 2.111212657236631
chr1    119415000   119416000   chr1    119433000   119434000   0.19096932254801227 2.111212657236631
chr1    119428000   119429000   chr1    119443000   119444000   0.1739600891041998  2.599207668339954
chr1    119638000   119639000   chr1    119650000   119651000   0.16941306547965643 2.111212657236631
chr1    119798000   119799000   chr1    119809000   119810000   0.17336543518345282 2.111212657236631
chr1    119925000   119926000   chr1    119938000   119939000   0.16941306547965643 2.111212657236631
chr1    145980000   145981000   chr1    146008000   146009000   0.1493799977290164  2.111212657236631
chr1    147173000   147174000   chr1    147242000   147243000   0.0014374088844748556   3.6758347359905126
chr1    147279000   147280000   chr1    147294000   147295000   0.16074546655054636 2.111212657236631
chr1    147749000   147750000   chr1    147762000   147763000   0.17706219066026252 2.111212657236631
chr1    150132000   150133000   chr1    150145000   150146000   0.17095137350687847 2.111212657236631
chr1    151773000   151774000   chr1    151787000   151788000   0.19215158024191575 2.111212657236631
chr1    155091000   155092000   chr1    155168000   155169000   0.159480897728622   3.6758347359905126
chr1    156147000   156148000   chr1    156225000   156226000   0.022761547603978145    2.111212657236631
chr1    156384000   156385000   chr1    156445000   156446000   0.0011295368832320851   3.2
chr1    157090000   157091000   chr1    157156000   157157000   3.066429862474962e-05   2.111212657236631
chr1    157372000   157373000   chr1    157489000   157490000   0.0010367252425936464   2.111212657236631
chr1    159936000   159937000   chr1    160006000   160007000   3.2301757546537857e-06  2.111212657236631
chr1    160834000   160835000   chr1    160950000   160951000   0.1638784122342846  3.6758347359905126
chr1    152094000   152095000   chr1    152107000   152108000   0.19899840408801758 2.111212657236631
chr1    152152000   152153000   chr1    152171000   152172000   0.19899840408801758 2.111212657236631
chr1    152155000   152156000   chr1    152176000   152177000   0.19899840408801758 3.6758347359905126
chr1    152190000   152191000   chr1    152226000   152227000   0.003975386275613224    3.6758347359905126
chr1    152204000   152205000   chr1    152222000   152223000   0.19899840408801758 2.599207668339954
chr1    152381000   152382000   chr1    152395000   152396000   0.19899840408801758 2.599207668339954
chr1    152407000   152408000   chr1    152421000   152422000   0.19899840408801758 2.111212657236631
chr1    152495000   152496000   chr1    152522000   152523000   0.19899840408801758 2.599207668339954
chr1    152622000   152623000   chr1    152635000   152636000   0.19899840408801758 2.111212657236631
chr1    152885000   152886000   chr1    152897000   152898000   0.19899840408801758 2.111212657236631
chr1    152976000   152977000   chr1    152989000   152990000   0.19899840408801758 2.599207668339954
chr1    153137000   153138000   chr1    153148000   153149000   0.19899840408801758 2.111212657236631
chr1    153193000   153194000   chr1    153208000   153209000   0.19899840408801758 2.111212657236631
chr1    153323000   153324000   chr1    153336000   153337000   0.19899840408801758 2.111212657236631
chr1    153368000   153369000   chr1    153392000   153393000   0.19899840408801758 2.111212657236631
chr1    153379000   153380000   chr1    153392000   153393000   0.19899840408801758 2.599207668339954
chr1    153422000   153423000   chr1    153432000   153433000   0.19899840408801758 2.111212657236631
chr1    153493000   153494000   chr1    153505000   153506000   0.19899840408801758 2.111212657236631
chr1    153547000   153548000   chr1    153557000   153558000   0.19899840408801758 2.111212657236631
chr1    153592000   153593000   chr1    153604000   153605000   0.19899840408801758 2.111212657236631
chr1    161791000   161792000   chr1    162036000   162037000   1.0885198708621147e-05  3.6758347359905126
chr1    162061000   162062000   chr1    162278000   162279000   0.15508693523878875 3.2
chr1    157960000   157961000   chr1    158123000   158124000   0.04737669503652403 2.111212657236631
chr1    159161000   159162000   chr1    159197000   159198000   0.010113988257080172    2.111212657236631
chr1    159800000   159801000   chr1    159889000   159890000   0.00881285199960709 3.2
chr1    165257000   165258000   chr1    165369000   165370000   8.81618996950162e-05    2.599207668339954
chr1    165393000   165394000   chr1    165592000   165593000   0.00031088958677380485  2.111212657236631
chr1    165405000   165406000   chr1    165593000   165594000   6.305914034276938e-07   4.222425314473262
chr1    165718000   165719000   chr1    165913000   165914000   0.003620934403087639    2.111212657236631
chr1    166910000   166911000   chr1    167058000   167059000   6.5118657133211855e-09  2.111212657236631
chr1    167599000   167600000   chr1    167687000   167688000   0.000209991103172702    3.6758347359905126
chr1    167750000   167751000   chr1    167762000   167763000   0.1868950141611309  2.111212657236631
chr1    167766000   167767000   chr1    167781000   167782000   0.19713697399408275 2.599207668339954
chr1    171801000   171802000   chr1    171983000   171984000   0.0002542333738390079   3.6758347359905126
chr1    172089000   172090000   chr1    172400000   172401000   0.0005344045801587427   2.111212657236631
chr1    174259000   174260000   chr1    174744000   174745000   2.4663086833243142e-05  3.6758347359905126
chr1    174260000   174261000   chr1    174729000   174730000   0.001507400028620598    3.6758347359905126
chr1    175148000   175149000   chr1    175318000   175319000   0.0019521859855946566   2.599207668339954
chr1    175153000   175154000   chr1    175318000   175319000   4.575040346566084e-09   3.6758347359905126
chr1    175160000   175161000   chr1    175319000   175320000   0.10002513427290345 2.111212657236631
chr1    176897000   176898000   chr1    176947000   176948000   0.18626177715466105 2.599207668339954
chr1    179251000   179252000   chr1    179368000   179369000   0.025714179576586393    2.111212657236631
chr1    179706000   179707000   chr1    179810000   179811000   0.002013988370637626    3.6758347359905126
chr1    179713000   179714000   chr1    179808000   179809000   0.12458831803921386 2.111212657236631
chr1    180520000   180521000   chr1    180863000   180864000   0.014601457922536008    1.8379173679952563
chr1    181190000   181191000   chr1    181424000   181425000   1.3643419727316086e-11  3.2
chr1    182084000   182085000   chr1    182395000   182396000   0.00010733820514275961  2.111212657236631
chr1    182600000   182601000   chr1    182785000   182786000   1.2857381825881475e-11  4.222425314473262
chr1    182603000   182604000   chr1    182777000   182778000   0.08392572736344449 3.2
chr1    184805000   184806000   chr1    184983000   184984000   8.433664298183412e-06   3.6758347359905126
chr1    184810000   184811000   chr1    184977000   184978000   0.008857891861481781    3.2
chr1    192805000   192806000   chr1    193019000   193020000   2.3579275532092936e-06  2.111212657236631
chr1    201999000   202000000   chr1    202119000   202120000   0.005113037648700969    3.2
chr1    202009000   202010000   chr1    202118000   202119000   6.503982801175923e-05   2.599207668339954
chr1    203274000   203275000   chr1    203337000   203338000   0.012061607774007943    3.2
chr1    203340000   203341000   chr1    203489000   203490000   0.003242391194976324    2.111212657236631
chr1    206490000   206491000   chr1    206586000   206587000   0.0070460226706296125   3.2
chr1    206634000   206635000   chr1    206664000   206665000   0.0206846870313096  3.2
chr1    207892000   207893000   chr1    207962000   207963000   0.13916041594010792 2.111212657236631
chr1    207898000   207899000   chr1    207961000   207962000   0.0038976396497772403   3.6758347359905126
chr1    203862000   203863000   chr1    204129000   204130000   0.0002882858020399337   2.599207668339954
chr1    203870000   203871000   chr1    204129000   204130000   0.002608785377341026    2.599207668339954
chr1    204445000   204446000   chr1    204493000   204494000   0.009430864309606022    2.111212657236631
chr1    205275000   205276000   chr1    205320000   205321000   0.00043075823283678094  3.2
chr1    205920000   205921000   chr1    205977000   205978000   0.0017241187746095802   3.2
chr1    200280000   200281000   chr1    200491000   200492000   0.07015248203348275 3.2
chr1    200972000   200973000   chr1    201112000   201113000   0.07015248203348275 2.111212657236631
chr1    201254000   201255000   chr1    201347000   201348000   0.18544232297948585 2.599207668339954
chr1    201254000   201255000   chr1    201361000   201362000   3.694537342724402e-09   2.111212657236631
chr1    201260000   201261000   chr1    201361000   201362000   0.1618378121038908  2.111212657236631
chr1    201710000   201711000   chr1    201793000   201794000   0.00010206870962106707  3.6758347359905126
chr1    201895000   201896000   chr1    201973000   201974000   0.13245335541422565 3.6758347359905126
chr1    209576000   209577000   chr1    209692000   209693000   0.01754647125738526 2.111212657236631
chr1    209861000   209862000   chr1    209989000   209990000   0.002801819785666071    3.6758347359905126
chr1    212068000   212069000   chr1    212288000   212289000   0.00440795717013448 3.6758347359905126
chr1    210143000   210144000   chr1    210311000   210312000   0.006009394886068442    2.599207668339954
chr1    211578000   211579000   chr1    211652000   211653000   0.027186325463972226    2.111212657236631
chr1    214214000   214215000   chr1    214330000   214331000   2.4916954259879276e-06  3.2
chr1    214262000   214263000   chr1    214328000   214329000   0.018937397406556755    3.6758347359905126
chr1    224513000   224514000   chr1    224854000   224855000   0.022073104537229164    2.111212657236631
chr1    223712000   223713000   chr1    223749000   223750000   0.019826464204297276    3.2
chr1    236108000   236109000   chr1    236491000   236492000   0.006056305533131967    2.599207668339954
chr1    236112000   236113000   chr1    236491000   236492000   0.015366736230005756    2.599207668339954
chr1    240026000   240027000   chr1    240149000   240150000   1.1829884760561349e-05  2.111212657236631
chr1    244602000   244603000   chr1    244796000   244797000   0.00033434594839602355  2.599207668339954
chr1    248134000   248135000   chr1    248150000   248151000   0.16454941793616168 2.599207668339954

Running on all chromosomes only reports loops for chromosome X:

docker run -i -v ${PWD}:/mnt mblanche/mustache mustache -p 24 -f /mnt/test_xlarge.cool -r 1000 -o /mnt/test_all.tsv

Output Generated:

cat test_all.tsv 
chrX    9995000 9996000 chrX    10118000    10119000    1.1212605821597776e-06  2.599207668339954
chrX    100685000   100686000   chrX    100768000   100769000   2.022866812723123e-06   3.6758347359905126
ay-lab commented 3 years ago

Hi, thanks for letting us know. 1- I can't download your data. It gives me the 404 Error. 2- I ran mustache on some other .cool file and it worked fine.
3- Please make sure you are using the last version 1.1.7.

mblanche commented 3 years ago

Cool, I’ll try with the latest and let you know. Sorry to have missed some new releases.

Sent from my iPad

-- Marco

On May 30, 2021, at 9:44 PM, ay-lab @.***> wrote:

 Hi, thanks for letting us know. 1- I can't download your data. It gives me the 404 Error. 2- I ran mustache on some other .cool file and it worked fine. 3- Please make sure you are using the last version 1.1.7.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

mblanche commented 3 years ago

Ok, thanks! Updating to 1.1.7 fixed the issue. You can close the ticket. Also, I fixed the typo in the URL of my request, the file is now live.

thanks again.