Package picard.fingerprint
Class HaplotypeMap
java.lang.Object
picard.fingerprint.HaplotypeMap
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.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHaplotypeMap
(htsjdk.samtools.SAMFileHeader header) Constructs an empty HaplotypeMap using the provided SAMFileHeader's sequence dictionary.HaplotypeMap
(File file) HaplotypeMap
(Collection<HaplotypeBlock> haplotypeBlocks) since this constructor doesn't initialize the HaplotypeMap "properly", it should be used carefully! -
Method Summary
Modifier and TypeMethodDescriptionvoid
addHaplotype
(HaplotypeBlock haplotypeBlock) Adds a HaplotypeBlock to the map and updates all the relevant caches/indices.Collection<htsjdk.variant.variantcontext.VariantContext>
asVcf
(htsjdk.samtools.reference.ReferenceSequenceFile ref) Returns an unmodifiable collection of all SNPs in all Haplotype blocks.getHaplotype
(String snpName) Queries a HaplotypeBlock by Snp name.getHaplotype
(String chrom, int pos) Queries a HaplotypeBlock by Snp chromosome and position.getHaplotype
(Snp snp) Queries a HaplotypeBlock by Snp object.Returns an unmodifiable collection of all the haplotype blocks in the map.htsjdk.samtools.SAMFileHeader
htsjdk.samtools.util.IntervalList
Returns an IntervalList with an entry for every SNP in every Haplotype in the map.Queries a Snp by chromosome and position.withoutChromosomes
(Set<String> chroms) Returns a copy of this haplotype map that excludes haplotypes on the chromosomes provided.void
writeAsVcf
(File output, File refFile) void
writeToFile
(File file) Writes out a HaplotypeMap file with the contents of this map.
-
Field Details
-
HET_GENOTYPE_FOR_PHASING
- See Also:
-
SYNTHETIC_PHASESET_PREFIX
- See Also:
-
PHASESET_PREFIX
- See Also:
-
-
Constructor Details
-
HaplotypeMap
public HaplotypeMap(htsjdk.samtools.SAMFileHeader header) Constructs an empty HaplotypeMap using the provided SAMFileHeader's sequence dictionary. -
HaplotypeMap
-
HaplotypeMap
since this constructor doesn't initialize the HaplotypeMap "properly", it should be used carefully!
-
-
Method Details
-
addHaplotype
Adds a HaplotypeBlock to the map and updates all the relevant caches/indices. -
getHaplotype
Queries a HaplotypeBlock by Snp object. Returns NULL if none found. -
getHaplotype
Queries a HaplotypeBlock by Snp name. Returns NULL if none found. -
getHaplotype
Queries a HaplotypeBlock by Snp chromosome and position. Returns NULL if none found. -
getHaplotypes
Returns an unmodifiable collection of all the haplotype blocks in the map. -
getSnp
Queries a Snp by chromosome and position. Returns NULL if none found. -
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
Returns a copy of this haplotype map that excludes haplotypes on the chromosomes provided.- Parameters:
chroms
- a set of zero or more chromosome names
-
writeAsVcf
- Throws:
FileNotFoundException
-
asVcf
public Collection<htsjdk.variant.variantcontext.VariantContext> asVcf(htsjdk.samtools.reference.ReferenceSequenceFile ref) -
writeToFile
Writes out a HaplotypeMap file with the contents of this map. -
getHeader
public htsjdk.samtools.SAMFileHeader getHeader()
-