lanl / 4DGB

4D Genome Browser project
1 stars 2 forks source link

Data backend for Contact Maps #4

Closed camtauxe closed 3 years ago

camtauxe commented 3 years ago

This PR is a first step towards implementing the contact map widget and addresses the server/database's handling of contact map data.

It includes:

When the server is running, you can use the following command to query the contact records and view them as a tsv again: curl -sL 'localhost:8000/data/contactmap/1/contacts' | perl -MJSON -0777 -E 'say join "\t", @{$_}{qw(x y value)} for @{ decode_json(<>)->{contacts} }'

NOTE: I wasn't exactly sure how to incorporate the contact map data into the project.json, since it had placeholders for both "hic" data and "md-contact-map" data. But since neither was actually implemented yet, I went ahead and just picked one.

camtauxe commented 3 years ago

( this is associated with issue #1 btw )

dhrogers commented 3 years ago

Looks good.

The md-contact-map is the correct place to put these, as these are files generated by us, and that aren't strict 'hic' format. At the moment, md-contact-map format is loosely defined as a csv-ish file. We should nail this down.

In general, I'm placing data into the following structure: source/ (anything that's raw data) 0/ (dataset ID. A dataset is a group of data. There can be as many of these as we'd like) file.ext file.ext

So I'll approve this request, and then if you could update things so that the md-contact-map files are in the correct place, that would be great. The schema doesn't require this organization, it's just easier to keep track of things in the project if they are semented like this.