public class MafOutputRenderer extends OutputRenderer
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
VERSION
Version of the MAF standard that this
MafOutputRenderer writes. |
dataSourceFactories, manualAnnotations, toolVersion
Constructor and Description |
---|
MafOutputRenderer(java.nio.file.Path outputFilePath,
java.util.List<DataSourceFuncotationFactory> dataSources,
htsjdk.variant.vcf.VCFHeader inputFileHeader,
java.util.LinkedHashMap<java.lang.String,java.lang.String> unaccountedForDefaultAnnotations,
java.util.LinkedHashMap<java.lang.String,java.lang.String> unaccountedForOverrideAnnotations,
java.util.Set<java.lang.String> toolHeaderLines,
java.lang.String referenceVersion,
java.util.Set<java.lang.String> excludedOutputFields,
java.lang.String toolVersion)
Create a
MafOutputRenderer . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the
OutputRenderer . |
com.google.common.collect.ImmutableMap<java.lang.String,java.util.Set<java.lang.String>> |
getReverseOutputFieldNameMap()
No field ordering is preserved in the output of this method.
|
protected void |
initializeDefaultMapWithKeys()
Initializes
defaultMap with the default keys for the columns in a MAF file. |
static java.lang.String |
mafTransform(java.lang.String key,
java.lang.String value,
java.lang.String referenceVersion)
Transforms a given
value to the equivalent MAF-valid value based on the given key . |
static java.lang.String |
mafTransformInvert(java.lang.String key,
java.lang.String value,
java.lang.String referenceVersion)
Transforms a given
value from a MAF-valid value to a general-purpose value based on the given key . |
void |
write(htsjdk.variant.variantcontext.VariantContext variant,
FuncotationMap txToFuncotationMap)
Write the given
variant and txToFuncotationMap to the output file. |
protected void |
writeHeader(java.util.List<java.lang.String> outputFields)
Write the header to the output file.
|
createFuncotationFromLinkedHashMap, getDataSourceInfoString, getToolVersion
public static java.lang.String VERSION
MafOutputRenderer
writes.public MafOutputRenderer(java.nio.file.Path outputFilePath, java.util.List<DataSourceFuncotationFactory> dataSources, htsjdk.variant.vcf.VCFHeader inputFileHeader, java.util.LinkedHashMap<java.lang.String,java.lang.String> unaccountedForDefaultAnnotations, java.util.LinkedHashMap<java.lang.String,java.lang.String> unaccountedForOverrideAnnotations, java.util.Set<java.lang.String> toolHeaderLines, java.lang.String referenceVersion, java.util.Set<java.lang.String> excludedOutputFields, java.lang.String toolVersion)
MafOutputRenderer
. Usage for germline use cases is unsupported.outputFilePath
- Path
to output file (must not be null).dataSources
- List
of DataSourceFuncotationFactory
to back our annotations (must not be null).inputFileHeader
- VCFHeader
of input VCF file to preserve (must not be null).unaccountedForDefaultAnnotations
- LinkedHashMap
of default annotations that must be added (must not be null).unaccountedForOverrideAnnotations
- LinkedHashMap
of override annotations that must be added (must not be null).toolHeaderLines
- Lines to add to the header with information about the tool (must not be null).referenceVersion
- Version of the reference we're using (must not be null).excludedOutputFields
- Fields that should not be rendered in the final output. Only exact name matches will be excluded (must not be null).toolVersion
- The version number of the tool used to produce the MAF file (must not be null).public void close()
OutputRenderer
OutputRenderer
.close
in interface java.lang.AutoCloseable
close
in class OutputRenderer
public void write(htsjdk.variant.variantcontext.VariantContext variant, FuncotationMap txToFuncotationMap)
OutputRenderer
variant
and txToFuncotationMap
to the output file.write
in class OutputRenderer
variant
- VariantContext
to write to the file.txToFuncotationMap
- FuncotationMap
to add to the given variant
on output.public static java.lang.String mafTransform(java.lang.String key, java.lang.String value, java.lang.String referenceVersion)
value
to the equivalent MAF-valid value based on the given key
.key
- The key
off of which to base the transformation. This key is the final (transformed) key for output (i.e. the column name in the MAF file).value
- The value
to transform into a MAF-valid value.referenceVersion
- The version of the reference used to create these annotations.value
.public static java.lang.String mafTransformInvert(java.lang.String key, java.lang.String value, java.lang.String referenceVersion)
value
from a MAF-valid value to a general-purpose value based on the given key
.key
- The key
off of which to base the transformation. This key is the transformed key for output (i.e. the column name in the MAF file).value
- The value
to transform from a MAF-valid value into a general-purpose value.referenceVersion
- The version of the reference used to create these annotations.value
.protected void writeHeader(java.util.List<java.lang.String> outputFields)
outputFields
- Ordered list of the header columns. These will be written as presented.public com.google.common.collect.ImmutableMap<java.lang.String,java.util.Set<java.lang.String>> getReverseOutputFieldNameMap()
null
protected void initializeDefaultMapWithKeys()
defaultMap
with the default keys for the columns in a MAF file.