higlass / higlass-docker

Builds a docker container wrapping higlass-server and higlass-client in nginx
MIT License
32 stars 14 forks source link

how to add plugin tracks into docker? #177

Open LiuJie1117 opened 2 years ago

LiuJie1117 commented 2 years ago

Hi, I'm trying to add arc tracks with plugin higlass-arcs into my docker higlass-container. But as a beginner in HiGlass, I'm not sure how to install higlass-arcs and use it in docker. Thanks for any suggestion.

pkerpedjiev commented 2 years ago

It should already be installed. How are you trying to view your data?

LiuJie1117 commented 2 years ago

It should already be installed. How are you trying to view your data?

Hi, I'm preparing my data, however I am not sure what the bed file (in example is "my-aggregated-bedfile.beddb") should be. I have bed files as HiC-Pro output, but when I tried clodius aggregate bedfile, I got error.

head raw_matrix/20000/sample1_G1_20000_abs.bed chr1 0 20000 1 chr1 20000 40000 2 chr1 40000 60000 3 chr1 60000 80000 4 chr1 80000 100000 5 chr1 100000 120000 6 chr1 120000 140000 7 chr1 140000 160000 8 chr1 160000 180000 9 chr1 180000 200000 10

clodius aggregate bedfile --delimiter $'\t' --chromsizes-filename ./data/chrom_mm10.sizes.sorted raw_matrix/20000/sample1_G1_20000_abs.bed (Core Error) IndexError: list index out of range

pkerpedjiev commented 2 years ago

That's an odd error. Would you be willing to share the bed file and chromsizes file? If you're not comfortable sharing publicly, feel free to email me at pkerpedjiev@gmail.com

LiuJie1117 commented 2 years ago

Hi pkerpedjiev,

Indeep what confused me is the input bed-like file for higlass-arcs. I wonder if it's a file provide every contact pairs? As HiC-Pro output I got 3 kinds of files:

  1. allValidPairs: all mapped contact pairs A00682:475:HKY5VDSXY:3:2461:27814:27743 chr1 3000032 + chr1 4463704 - 446 HIC_chr1_1 HIC_chr1_4010 4042 0-2 A00682:475:HKY5VDSXY:3:2332:7193:36620 chr1 3000034 + chr2 8118454 + 289 HIC_chr1_1 HIC_chr2_12177 3842 0-2

  2. hicpro.bed with specified resolution(chr\start\end\bin number)

chr1 0 20000 1 chr1 20000 40000 2 chr1 40000 60000 3 .... chr1 195440000 195460000 9773 chr1 195460000 195471971 9774 chr2 0 20000 9775 chr2 20000 40000 9776 chr2 40000 60000 9777 ....

  1. hicpro matrix matched the bed (bin bin contact-numbers) 151 151 25 151 152 27 151 153 6 151 154 4 151 155 5 151 156 4 151 157 4 151 158 2 151 159 3

which should be used for higlass-arc? Or can you provide me with a demo file? A lot of thanks for you help!

pkerpedjiev commented 2 years ago

The second format (chr start end ...) should be used.

Here's an example of what that looks like: https://resgen.io/pete/Bedfile%20arcs/project/dy_n7O9vT4auUEQWD459lw

If your file is small enough (less than 10Mb), you could just upload it to resgen (a hosted higlass instance) to view it without aggregating. See the docs for information about how to do that.

LiuJie1117 commented 2 years ago

Thanks!While I noticed the resgen example had tags below: assembly: hg19 track-type: 1d-arcs datatype: bedlike filetype: bedfile

When I used: docker exec higlass-order-container python higlass-server/manage.py ingest_tileset \ --filename /data/sample1_G1_20000_abs.bed \ --filetype bedfile --datatype bedlike

I could not choose track-type as 1d-arcs, so when I loaded my bed file, I could just see bedlike tracks, not 1d-arcs I wanted image image

pkerpedjiev commented 2 years ago

Resgen runs a slightly different version of higlass. If you want to use the higlass docker container, you have to first aggregate the bedfile using the instructions here:

https://docs.higlass.io/data_preparation.html#bed-files

And then ingest with --filetype beddb --datatype bedlike. Once you have it loaded, you need to open the viewconf editor like so:

image

And then change the track type to 1d-arcs directly in there.

LiuJie1117 commented 2 years ago

Thanks for your detailed explantion! I loaded a test beddb file but didn't find the "Edit view config". It's weird. I wonder if that has anything to do with my higlass-docker version? I used v0.6.1 first, then I updated it to v0.8.4, still got the same result. Also, when I loaded in other tracks (mcool, hitile, .etc) , I still could find it in browser.

image
pkerpedjiev commented 2 years ago

If you've updated to the latest docker can you do a hard reload (shift-reload) on your browser to make sure it loads the latest javascript and try again?

jeprescottroy commented 2 years ago

Hi @pkerpedjiev,

First off, thank you for creating HiGlass. It's a really nice piece of software!

I have a question about using plugins like higlass-vcf and/or higlass-gnomad. I see that they are not part of the latest HiGlass docker container. How would I go about adding them? I checked DockerHub to see if there was a Dockerfile I could modify; however, I couldn't find one.

I suppose that I could run HiGlass as a standalone web application in a conda environment on my server; however, I'd really like to be able to deploy it via Docker.

Thanks for your help!

Kind regards,

Joann

pkerpedjiev commented 2 years ago

Hi, sorry for the delayed response. There is a docker file in this repo. But the way to do what you're trying to do would be to add the js files for those plugins here, and then run ./build.sh -w 2 (-w 2 means build the Docker container to support two worker threads).

You may also want to include the version of the plugin in build.sh.

Running ./build.sh -w 2 will create the image and give it some tags. You should be able to modify those to your desire to push to your Docker repo. Or if you'd like to create a PR, I'd be more than happy to merge it and push an official release.