This bug leads to an incorrectly shifted Hi-C matrix.
In the code base, the only place where bed2mat is invoked is within hic2mat (https://github.com/MonkeyLB/hicrep/blob/master/R/hic2mat.R#L25). hic2mat first convert the .hic file to a BED-like data frame (via strawr::straw), then bed2mat takes over and calculates the R matrix that meets hicrep input format requirements.
However, the output of strawr:straw is a BED-like structure as follows (the bin size in this example is 500kb):
strawr::straw denotes the "first bin" as 0. Therefore, during the conversion, the correct way of dealing with subscripts is shown here in this pull request.
This bug leads to an incorrectly shifted Hi-C matrix.
In the code base, the only place where
bed2mat
is invoked is withinhic2mat
(https://github.com/MonkeyLB/hicrep/blob/master/R/hic2mat.R#L25).hic2mat
first convert the .hic file to a BED-like data frame (viastrawr::straw
), thenbed2mat
takes over and calculates the R matrix that meets hicrep input format requirements.However, the output of
strawr:straw
is a BED-like structure as follows (the bin size in this example is 500kb):strawr::straw
denotes the "first bin" as 0. Therefore, during the conversion, the correct way of dealing with subscripts is shown here in this pull request.