# Class SamFiles

java.lang.Object
htsjdk.samtools.SamFiles

public class SamFiles extends Object

## Constructor Summary

Constructors
Constructor
Description
`SamFiles()`

## Method Summary

Modifier and Type
Method
Description
`static File`
`findIndex(File samFile)`
Finds the index file associated with the provided SAM file.
`static Path`
`findIndex(Path samPath)`
Finds the index file associated with the provided SAM file.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SamFiles

public SamFiles()

## Method Details

### findIndex

public static File findIndex(File samFile)
Finds the index file associated with the provided SAM file. The index file must exist and be reachable to be found. If the file is a symlink and the index cannot be found, try to unsymlink the file and look for the bai in the actual file path.

Returns:
  The index for the provided SAM, or null if one was not found.

### findIndex

public static Path findIndex(Path samPath)
Finds the index file associated with the provided SAM file. The index file must exist and be reachable to be found. If the file is a symlink and the index cannot be found, try to unsymlink the file and look for the bai in the actual file path.

Returns:
  The index for the provided SAM, or null if one was not found.