public class VCFUtils extends Object
Constructor | Description |
---|---|
VCFUtils() |
Modifier and Type | Method | Description |
---|---|---|
static File |
createTemporaryIndexedVcfFile(String prefix,
String suffix) |
This method creates a temporary VCF file and its appropriately named index file, and will delete them on exit.
|
static File |
createTemporaryIndexedVcfFromInput(File vcfFile,
String tempFilePrefix) |
This method makes a copy of the input VCF and creates an index file for it in the same location.
|
static List<VCFContigHeaderLine> |
makeContigHeaderLines(SAMSequenceDictionary refDict,
File referenceFile) |
Create VCFHeaderLines for each refDict entry, and optionally the assembly if referenceFile != null
|
static Set<VCFHeaderLine> |
smartMergeHeaders(Collection<VCFHeader> headers,
boolean emitWarnings) |
|
static VCFHeader |
withUpdatedContigs(VCFHeader oldHeader,
File referenceFile,
SAMSequenceDictionary refDict) |
Add / replace the contig header lines in the VCFHeader with the in the reference file and master reference dictionary
|
static Set<VCFHeaderLine> |
withUpdatedContigsAsLines(Set<VCFHeaderLine> oldLines,
File referenceFile,
SAMSequenceDictionary refDict) |
|
static Set<VCFHeaderLine> |
withUpdatedContigsAsLines(Set<VCFHeaderLine> oldLines,
File referenceFile,
SAMSequenceDictionary refDict,
boolean referenceNameOnly) |
public static Set<VCFHeaderLine> smartMergeHeaders(Collection<VCFHeader> headers, boolean emitWarnings) throws IllegalStateException
IllegalStateException
public static VCFHeader withUpdatedContigs(VCFHeader oldHeader, File referenceFile, SAMSequenceDictionary refDict)
oldHeader
- the header to updatereferenceFile
- the file path to the reference sequence used to generate this vcfrefDict
- the SAM formatted reference sequence dictionarypublic static Set<VCFHeaderLine> withUpdatedContigsAsLines(Set<VCFHeaderLine> oldLines, File referenceFile, SAMSequenceDictionary refDict)
public static Set<VCFHeaderLine> withUpdatedContigsAsLines(Set<VCFHeaderLine> oldLines, File referenceFile, SAMSequenceDictionary refDict, boolean referenceNameOnly)
public static List<VCFContigHeaderLine> makeContigHeaderLines(SAMSequenceDictionary refDict, File referenceFile)
refDict
- reference dictionaryreferenceFile
- for assembly name. May be nullpublic static File createTemporaryIndexedVcfFile(String prefix, String suffix) throws IOException
prefix
- - The prefix string to be used in generating the file's name; must be at least three characters longsuffix
- - The suffix string to be used in generating the file's name; may be null, in which case the suffix ".tmp" will be usedIOException
- - if a file could not be created.public static File createTemporaryIndexedVcfFromInput(File vcfFile, String tempFilePrefix) throws IOException
vcfFile
- the vcf file to indexIOException