picard.fingerprint

## Class HaplotypeMap

- java.lang.Object
- - picard.fingerprint.HaplotypeMap

-     public class HaplotypeMap
      extends Object

  A collection of metadata about Haplotype Blocks including multiple in memory "indices" of the data to make it easy to query the correct HaplotypeBlock or Snp by snp names, positions etc. Also has the ability to read and write itself to and from files.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HaplotypeMap(File file)` Constructs a HaplotypeMap from the provided file.
    `HaplotypeMap(htsjdk.samtools.SAMFileHeader header)` Constructs an empty HaplotypeMap using the provided SAMFileHeader's sequence dictionary.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addHaplotype(HaplotypeBlock haplotypeBlock)` Adds a HaplotypeBlock to the map and updates all the relevant caches/indices.
    `Set<Snp>` | `getAllSnps()` Returns an unmodifiable collection of all SNPs in all Haplotype blocks.
    `HaplotypeBlock` | `getHaplotype(Snp snp)` Queries a HaplotypeBlock by Snp object.
    `HaplotypeBlock` | `getHaplotype(String snpName)` Queries a HaplotypeBlock by Snp name.
    `HaplotypeBlock` | `getHaplotype(String chrom, int pos)` Queries a HaplotypeBlock by Snp chromosome and position.
    `List<HaplotypeBlock>` | `getHaplotypes()` Returns an unmodifiable collection of all the haplotype blocks in the map.
    `htsjdk.samtools.SAMFileHeader` | `getHeader()`
    `htsjdk.samtools.util.IntervalList` | `getIntervalList()` Returns an IntervalList with an entry for every SNP in every Haplotype in the map.
    `Snp` | `getSnp(String chrom, int pos)` Queries a Snp by chromosome and position.
    `HaplotypeMap` | `withoutChromosomes(Set<String> chroms)` Returns a copy of this haplotype map that excludes haplotypes on the chromosomes provided.
    `void` | `writeToFile(File file)` Writes out a HaplotypeMap file with the contents of this map.

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

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

- - ### Constructor Detail

    - #### HaplotypeMap

          public HaplotypeMap(File file)

      Constructs a HaplotypeMap from the provided file.

    - #### HaplotypeMap

          public HaplotypeMap(htsjdk.samtools.SAMFileHeader header)

      Constructs an empty HaplotypeMap using the provided SAMFileHeader's sequence dictionary.

  - ### Method Detail

    - #### addHaplotype

          public void addHaplotype(HaplotypeBlock haplotypeBlock)

      Adds a HaplotypeBlock to the map and updates all the relevant caches/indices.

    - #### getHaplotype

          public HaplotypeBlock getHaplotype(Snp snp)

      Queries a HaplotypeBlock by Snp object. Returns NULL if none found.

    - #### getHaplotype

          public HaplotypeBlock getHaplotype(String snpName)

      Queries a HaplotypeBlock by Snp name. Returns NULL if none found.

    - #### getHaplotype

          public HaplotypeBlock getHaplotype(String chrom,
                                             int pos)

      Queries a HaplotypeBlock by Snp chromosome and position. Returns NULL if none found.

    - #### getHaplotypes

          public List<HaplotypeBlock> getHaplotypes()

      Returns an unmodifiable collection of all the haplotype blocks in the map.

    - #### getSnp

          public Snp getSnp(String chrom,
                            int pos)

      Queries a Snp by chromosome and position. Returns NULL if none found.

    - #### getAllSnps

          public Set<Snp> getAllSnps()

      Returns an unmodifiable collection of all SNPs in all Haplotype blocks.

    - #### getIntervalList

          public htsjdk.samtools.util.IntervalList getIntervalList()

      Returns an IntervalList with an entry for every SNP in every Haplotype in the map.

    - #### withoutChromosomes

          public HaplotypeMap withoutChromosomes(Set<String> chroms)

      Returns a copy of this haplotype map that excludes haplotypes on the chromosomes provided.
      Parameters:
        `chroms` - a set of zero or more chromosome names

    - #### writeToFile

          public void writeToFile(File file)

      Writes out a HaplotypeMap file with the contents of this map.

    - #### getHeader

          public htsjdk.samtools.SAMFileHeader getHeader()