You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe your issue here.
When creating instances of SamInputResource, there are two overloads that take a java.nio.Path:
public static SamInputResource of(final Path path)
public static SamInputResource of(final Path path, Function<SeekableByteChannel, SeekableByteChannel> wrapper)
As of #1124, these two methods have very different behaviors on non-regular files. Overload 1 partially handles the issues described in #1084, while overload 2 does not.
However, as of HTSJDK 4.1.1, this same conditional logic is missing from the SamReaderFactory method public SamReader open(final Path path, Function<SeekableByteChannel, SeekableByteChannel> dataWrapper, Function<SeekableByteChannel, SeekableByteChannel> indexWrapper).
Unlike the code linked above in #1494, the SamReaderFactory.open method does not check for null wrappers. This ultimately means that non-regular files passed as java.io.File end up being treated differently than the exact same file passed as java.nio.file.Path.
Description of the issue:
This issue is related to:
Describe your issue here.
When creating instances of
SamInputResource
, there are two overloads that take ajava.nio.Path
:public static SamInputResource of(final Path path)
public static SamInputResource of(final Path path, Function<SeekableByteChannel, SeekableByteChannel> wrapper)
As of #1124, these two methods have very different behaviors on non-regular files. Overload 1 partially handles the issues described in #1084, while overload 2 does not.
To choose between the overloads, code such as in #1494 checks if the caller has passed in a
null
wrapper to call overload 1 or 2. Direct link: https://github.com/samtools/htsjdk/pull/1494/files#diff-1001d1e3b784b6fa1bab848edafb7430f4f031dd17fa0bee7a5482880d2a1a7aR159-R161However, as of HTSJDK 4.1.1, this same conditional logic is missing from the
SamReaderFactory
methodpublic SamReader open(final Path path, Function<SeekableByteChannel, SeekableByteChannel> dataWrapper, Function<SeekableByteChannel, SeekableByteChannel> indexWrapper)
.Unlike the code linked above in #1494, the
SamReaderFactory.open
method does not check fornull
wrappers. This ultimately means that non-regular files passed asjava.io.File
end up being treated differently than the exact same file passed asjava.nio.file.Path
.Your environment:
Steps to reproduce
Call:
Expected behaviour
Actual behaviour
Workaround
While this is being fixed, you are able to write your own
open
method that works correctly. Something like:The text was updated successfully, but these errors were encountered: