Skip to content

Commit

Permalink
Disable memory-mapped index files. This is not needed for IGV, and ca…
Browse files Browse the repository at this point in the history
…n result rare but obscure errors.
  • Loading branch information
jrobinso committed Dec 9, 2024
1 parent f4287ff commit 76584da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/main/java/org/broad/igv/sam/reader/SAMReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public SAMReader(String samFile) throws IOException {
this(samFile, true);
}

public SAMReader(String samFile, boolean requireIndex) throws IOException {
public SAMReader(String samFile, boolean requireIndex) {
this.samFile = samFile;
if (requireIndex) {
featureIndex = SamUtils.getIndexFor(samFile);
Expand All @@ -78,7 +78,9 @@ public SAMReader(String samFile, boolean requireIndex) throws IOException {
}
}
factory = SamReaderFactory.makeDefault().
validationStringency(ValidationStringency.SILENT);
validationStringency(ValidationStringency.SILENT).
referenceSource(new IGVReferenceSource()).
enable(SamReaderFactory.Option.DONT_MEMORY_MAP_INDEX);
loadHeader();
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/broad/igv/sam/reader/SamReaderPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ private SamReader createReader(int bufferSize) throws IOException {
boolean isLocal = locator.isLocal();
final SamReaderFactory factory = SamReaderFactory.makeDefault().
referenceSource(new IGVReferenceSource()).
validationStringency(ValidationStringency.SILENT);
validationStringency(ValidationStringency.SILENT).
enable(SamReaderFactory.Option.DONT_MEMORY_MAP_INDEX);
SamInputResource resource;

if (isLocal) {
Expand Down

0 comments on commit 76584da

Please sign in to comment.