-
Notifications
You must be signed in to change notification settings - Fork 4
Extension to 3D tensors
This page documents all uses of "Straw" by juicebox.js, with suggestions for extensions to support 3D tensors. The main function affects is getContactRecords
, which now will return all records in the cube specified by the 3 region arguments. See contactRecord.js
for object description, basically it will be {bin1, bin2, bin3, counts}. The
getKey()` method of that class will need extended.
Call to fetch contact records, through a "Straw" object (straw.js). This needs to be extended to take a region3
.
Note this is just a passthrough function to HicFile.getContactRecords
.
straw.getContactRecords(normalization, region1, region2, units, binsize)
A region
is defined as
{
chr: <chromosome index>,
start: <start position in genome coordinates>,
end: <end position in genome coordinates>
}
Note that for intra-chr matrices, data is stored in lower diagonal coordinates. Or maybe its upper. Anyway its stored only once, and the input regions are transposed if necessary. This method calls getBlocks
internally, you can trace the extension to 3D in this method, it should be straightforward. There's a few esoteric things in their like arrow (i.e. lambda) functions and promises but I think its clear what they do. If not you can ask.
Other functions and properties used by juicebox.js are via the "HicFile" object. These are probably not affected by the extension to 3D
hicFile.hasNormalizationVector(type, chr, unit, binSize)
hicFile.init();
hicFile.genomeId
hicFile.chromosomes
hicFile.bpResolutions
hicFile.wholeGenomeChromosome
hicFile.wholeGenomeResolution
hicFile.hasNormalizationVector(type, chr, unit, binSize);
hicFile.getMatrix(chr1, chr2)
hicFile.getNormVectorIndex()
hicFile.getNormalizationOptions()
``