Skip to content

Commit

Permalink
update cache clearing
Browse files Browse the repository at this point in the history
  • Loading branch information
sa501428 committed Feb 13, 2022
1 parent 0b902c3 commit 2e503e8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/javastraw/StrawGlobals.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
package javastraw;

public class StrawGlobals {
public static final String versionNum = "2.09.01";
public static final String versionNum = "2.09.02";
// min hic file version supported
public static final int minVersion = 6;
public static final int bufferSize = 2097152;
Expand Down
3 changes: 2 additions & 1 deletion src/javastraw/reader/Dataset.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ public Dataset(DatasetReader reader) {
normalizationTypes = new ArrayList<>();
}

public void clearCache() {
public void clearCache(boolean onlyClearInter) {
for (Matrix matrix : matrices.values()) {
if (onlyClearInter && matrix.isIntra()) continue;
try {
matrix.clearCache();
} catch (Exception e) {
Expand Down
4 changes: 4 additions & 0 deletions src/javastraw/reader/Matrix.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ public boolean isNotIntra() {
return chr1 != chr2;
}

public boolean isIntra() {
return chr1 == chr2;
}

public void clearCache() {
for (MatrixZoomData mzd : bpZoomData) {
try {
Expand Down

0 comments on commit 2e503e8

Please sign in to comment.