Package picard.util

## Class DbSnpBitSetUtil

- java.lang.Object
- - picard.util.DbSnpBitSetUtil

-     public class DbSnpBitSetUtil
      extends Object

  Utility class to use with DbSnp files to determine is a locus is a dbSnp site.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `DbSnpBitSetUtil.DbSnpBitSets` | Little tuple class to contain one bitset for SNPs and another for Indels.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DbSnpBitSetUtil​(File dbSnpFile, htsjdk.samtools.SAMSequenceDictionary sequenceDictionary)` | Constructor that creates a bit set with bits set to true for all variant types.
    `DbSnpBitSetUtil​(File dbSnpFile, htsjdk.samtools.SAMSequenceDictionary sequenceDictionary, Collection<VariantType> variantsToMatch)` | Constructor that creates a bit set with bits set to true for the given variant types.
    `DbSnpBitSetUtil​(File dbSnpFile, htsjdk.samtools.SAMSequenceDictionary sequenceDictionary, Collection<VariantType> variantsToMatch, htsjdk.samtools.util.IntervalList intervals)` | Constructor that creates a bit set with bits set to true for the given variant types over the given regions.
    `DbSnpBitSetUtil​(File dbSnpFile, htsjdk.samtools.SAMSequenceDictionary sequenceDictionary, Collection<VariantType> variantsToMatch, htsjdk.samtools.util.IntervalList intervals, Optional<htsjdk.samtools.util.Log> log)` | Constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static DbSnpBitSetUtil.DbSnpBitSets` | `createSnpAndIndelBitSets​(File dbSnpFile, htsjdk.samtools.SAMSequenceDictionary sequenceDictionary)` | Factory method to create both a SNP bitmask and an indel bitmask in a single pass of the VCF.
    `static DbSnpBitSetUtil.DbSnpBitSets` | `createSnpAndIndelBitSets​(File dbSnpFile, htsjdk.samtools.SAMSequenceDictionary sequenceDictionary, htsjdk.samtools.util.IntervalList intervals)` | Factory method to create both a SNP bitmask and an indel bitmask in a single pass of the VCF.
    `static DbSnpBitSetUtil.DbSnpBitSets` | `createSnpAndIndelBitSets​(File dbSnpFile, htsjdk.samtools.SAMSequenceDictionary sequenceDictionary, htsjdk.samtools.util.IntervalList intervals, Optional<htsjdk.samtools.util.Log> log)` | Factory method to create both a SNP bitmask and an indel bitmask in a single pass of the VCF.
    `boolean` | `isDbSnpSite​(String sequenceName, int pos)` | Returns true if there is a dbSnp entry at pos in sequenceName, otherwise false

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### DbSnpBitSetUtil

          public DbSnpBitSetUtil​(File dbSnpFile,
                                 htsjdk.samtools.SAMSequenceDictionary sequenceDictionary)

      Constructor that creates a bit set with bits set to true for all variant types.

    - #### DbSnpBitSetUtil

          public DbSnpBitSetUtil​(File dbSnpFile,
                                 htsjdk.samtools.SAMSequenceDictionary sequenceDictionary,
                                 Collection<VariantType> variantsToMatch)

      Constructor that creates a bit set with bits set to true for the given variant types.

    - #### DbSnpBitSetUtil

          public DbSnpBitSetUtil​(File dbSnpFile,
                                 htsjdk.samtools.SAMSequenceDictionary sequenceDictionary,
                                 Collection<VariantType> variantsToMatch,
                                 htsjdk.samtools.util.IntervalList intervals)

      Constructor that creates a bit set with bits set to true for the given variant types over the given regions.

    - #### DbSnpBitSetUtil

          public DbSnpBitSetUtil​(File dbSnpFile,
                                 htsjdk.samtools.SAMSequenceDictionary sequenceDictionary,
                                 Collection<VariantType> variantsToMatch,
                                 htsjdk.samtools.util.IntervalList intervals,
                                 Optional<htsjdk.samtools.util.Log> log)

      Constructor. For each sequence, creates a BitSet that denotes whether a dbSNP entry is present at each base in the reference sequence. The set is reference.length() + 1 so that it can be indexed by 1-based reference base. True means dbSNP present, false means no dbSNP present.
      Parameters:
        `dbSnpFile` - in VCF format.
        `sequenceDictionary` - Optionally, a sequence dictionary corresponding to the dbSnp file, else null. If present, BitSets will be allocated more efficiently because the maximum size will be known.
        `variantsToMatch` - what types of variants to load.
        `intervals` - an interval list specifying the regions to load, or null, if we are return all dbSNP sites.

  - ### Method Detail

    - #### createSnpAndIndelBitSets

          public static DbSnpBitSetUtil.DbSnpBitSets createSnpAndIndelBitSets​(File dbSnpFile,
                                                                              htsjdk.samtools.SAMSequenceDictionary sequenceDictionary)

      Factory method to create both a SNP bitmask and an indel bitmask in a single pass of the VCF.

    - #### createSnpAndIndelBitSets

          public static DbSnpBitSetUtil.DbSnpBitSets createSnpAndIndelBitSets​(File dbSnpFile,
                                                                              htsjdk.samtools.SAMSequenceDictionary sequenceDictionary,
                                                                              htsjdk.samtools.util.IntervalList intervals)

      Factory method to create both a SNP bitmask and an indel bitmask in a single pass of the VCF. If intervals are given, consider only SNP and indel sites that overlap the intervals.

    - #### createSnpAndIndelBitSets

          public static DbSnpBitSetUtil.DbSnpBitSets createSnpAndIndelBitSets​(File dbSnpFile,
                                                                              htsjdk.samtools.SAMSequenceDictionary sequenceDictionary,
                                                                              htsjdk.samtools.util.IntervalList intervals,
                                                                              Optional<htsjdk.samtools.util.Log> log)

      Factory method to create both a SNP bitmask and an indel bitmask in a single pass of the VCF. If intervals are given, consider only SNP and indel sites that overlap the intervals. If log is given, progress loading the variants will be written to the log.

    - #### isDbSnpSite

          public boolean isDbSnpSite​(String sequenceName,
                                     int pos)

      Returns true if there is a dbSnp entry at pos in sequenceName, otherwise false