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

How to load local data file for a track #572

Open
zhangzhen opened this issue Oct 28, 2021 · 7 comments
Open

How to load local data file for a track #572

zhangzhen opened this issue Oct 28, 2021 · 7 comments
Labels
question Further information is requested

Comments

@zhangzhen
Copy link

I've put the tsv file RD2109054FFP.blockData.tsv into the public folder, and then set the data url in the spec as follows:
"url": "./RD2109054FFP.blockData.tsv"
Nothing is displayed in the corresponding track. To shorten the data loading time, I want to fetch the local file instead of the remote one. How can I do this?

Zhen

@sehilyi
Copy link
Member

sehilyi commented Nov 3, 2021

This is not possible in the javascript libraries (including Gosling.js) by a security policy of browsers. You will need to have a server that serves your local data since the browser cannot access your local files directly.

@sehilyi sehilyi added the question Further information is requested label Nov 3, 2021
@sehilyi
Copy link
Member

sehilyi commented Nov 3, 2021

Can I ask how large the data is? Also, is the same data used multiple times in your specification? Would the use of a HiGlass server not be feasible in your case?

@zhangzhen
Copy link
Author

zhangzhen commented Nov 12, 2021

Can I ask how large the data is?

There are about 1 million lines in the data file.

Also, is the same data used multiple times in your specification?

Yes, because there are multiple value columns in that file.

Would the use of a HiGlass server not be feasible in your case?

I'm trying to use a HiGlass server to solve this issue. However, it is a bit tricky because I created a synthetic genome which has only chromosome 1 by removing regions that are not covered by probes. The coverage data file of a sample in the bedgraph format was converted to a hitile file using the following command:

clodius aggregate bedgraph          \
    RD2118193FFP.coverageData2.tsv    \
    --output-file RD2118193FFP.coverageData2.hitile \
    --chromosome-col 1              \
    --from-pos-col 2                \
    --to-pos-col 3                  \
    --value-col 4                   \
    --assembly grch37               \
    --nan-value NA                  \
    --transform exp2                \
    --has-header

The data is for only about 350 genes, attached below:
RD2118193FFP.coverageData2.csv

And then the hitile file was uploaded to the higlass server. By viewing the coverage data in browser I find the converted data looks something goes wrong , but I don't figure out what step goes wrong.
image

@sehilyi A question about zoom levels: how can I know what the current zoom level is in gosling?

Zhen

@zhangzhen
Copy link
Author

zhangzhen commented Nov 15, 2021

A question about zoom levels: how can I know what the current zoom level is in gosling?

@sehilyi I've already found the answer to this question in the source code for higlass:

  1. https://github.com/higlass/higlass/blob/54f5aae61d3474f9e868621228270f0c90ef9343/app/scripts/HorizontalTiled1DPixiTrack.js#L60
  2. https://github.com/higlass/higlass/blob/54f5aae61d3474f9e868621228270f0c90ef9343/app/scripts/services/tile-proxy.js#L330

@sehilyi
Copy link
Member

sehilyi commented Nov 16, 2021

I've already found the answer to this question in the source code for higlass:

Sorry that my response was late but great to hear that you found the answer!

Just curious -- since those are HiGlass code-bases, are you using those functions in your custom local Gosling.js on your machine?

@zhangzhen
Copy link
Author

zhangzhen commented Nov 16, 2021

Just curious -- since those are HiGlass code-bases, are you using those functions in your custom local Gosling.js on your machine?

No, I've not used those functions yet, but just read the code. To other questions I still have not found answers. Is there a way to view the content of a hitile file just like the way to view a csv file? I want to make sure if hitile files that are created by us are in right form and meet our requirements.

Zhen

@sehilyi
Copy link
Member

sehilyi commented Nov 19, 2021

@zhangzhen Sorry for the late response.

When I test your file (i.e., aggregate and ingest to the server), I see the following view, which seems to look fine for me. Could you elaborate on the issue you are confronting?

Screen Shot 2021-11-19 at 5 17 31 PM

Demo: http://higlass.io/l/?d=BOXopZfFS9-LTYLijCVekA

Also, you would want to use a --chromsizes-filename TEXT parameter of clodius to specify what chromosome you want to use and how large it is since you seem to be interested in custom-sized chromosome 1 only.

Since Hitile is based on HDF5, you can use HDF5 viewers, such as HDFView to browse metadata (e.g., chromosome sizes, assembly, ...) as well as raw values.

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

No branches or pull requests

2 participants