public class HaplotypeMap
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
HET_GENOTYPE_FOR_PHASING |
static java.lang.String |
PHASESET_PREFIX |
static java.lang.String |
SYNTHETIC_PHASESET_PREFIX |
Constructor and Description |
---|
HaplotypeMap(java.util.Collection<HaplotypeBlock> haplotypeBlocks)
since this constructor doesn't initialize the HaplotypeMap "properly", it should be used carefully!
|
HaplotypeMap(java.io.File file) |
HaplotypeMap(htsjdk.samtools.SAMFileHeader header)
Constructs an empty HaplotypeMap using the provided SAMFileHeader's sequence dictionary.
|
Modifier and Type | Method and Description |
---|---|
void |
addHaplotype(HaplotypeBlock haplotypeBlock)
Adds a HaplotypeBlock to the map and updates all the relevant caches/indices.
|
java.util.Collection<htsjdk.variant.variantcontext.VariantContext> |
asVcf(htsjdk.samtools.reference.ReferenceSequenceFile ref) |
java.util.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(java.lang.String snpName)
Queries a HaplotypeBlock by Snp name.
|
HaplotypeBlock |
getHaplotype(java.lang.String chrom,
int pos)
Queries a HaplotypeBlock by Snp chromosome and position.
|
java.util.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(java.lang.String chrom,
int pos)
Queries a Snp by chromosome and position.
|
HaplotypeMap |
withoutChromosomes(java.util.Set<java.lang.String> chroms)
Returns a copy of this haplotype map that excludes haplotypes on the chromosomes provided.
|
void |
writeAsVcf(java.io.File output,
java.io.File refFile) |
void |
writeToFile(java.io.File file)
Writes out a HaplotypeMap file with the contents of this map.
|
public static final java.lang.String HET_GENOTYPE_FOR_PHASING
public static final java.lang.String SYNTHETIC_PHASESET_PREFIX
public static final java.lang.String PHASESET_PREFIX
public HaplotypeMap(htsjdk.samtools.SAMFileHeader header)
public HaplotypeMap(java.io.File file)
public HaplotypeMap(java.util.Collection<HaplotypeBlock> haplotypeBlocks)
public void addHaplotype(HaplotypeBlock haplotypeBlock)
public HaplotypeBlock getHaplotype(Snp snp)
public HaplotypeBlock getHaplotype(java.lang.String snpName)
public HaplotypeBlock getHaplotype(java.lang.String chrom, int pos)
public java.util.List<HaplotypeBlock> getHaplotypes()
public Snp getSnp(java.lang.String chrom, int pos)
public java.util.Set<Snp> getAllSnps()
public htsjdk.samtools.util.IntervalList getIntervalList()
public HaplotypeMap withoutChromosomes(java.util.Set<java.lang.String> chroms)
chroms
- a set of zero or more chromosome namespublic void writeAsVcf(java.io.File output, java.io.File refFile) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public java.util.Collection<htsjdk.variant.variantcontext.VariantContext> asVcf(htsjdk.samtools.reference.ReferenceSequenceFile ref)
public void writeToFile(java.io.File file)
public htsjdk.samtools.SAMFileHeader getHeader()