Added function to gatkdocs to specify what VCF field an annotation goes in (INFO or FORMAT)
This commit is contained in:
parent
edbd17b8e0
commit
0ea3f8ca58
|
|
@ -37,6 +37,8 @@ import org.broadinstitute.sting.commandline.*;
|
||||||
import org.broadinstitute.sting.gatk.CommandLineGATK;
|
import org.broadinstitute.sting.gatk.CommandLineGATK;
|
||||||
import org.broadinstitute.sting.gatk.refdata.tracks.FeatureManager;
|
import org.broadinstitute.sting.gatk.refdata.tracks.FeatureManager;
|
||||||
import org.broadinstitute.sting.gatk.walkers.*;
|
import org.broadinstitute.sting.gatk.walkers.*;
|
||||||
|
import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.GenotypeAnnotation;
|
||||||
|
import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation;
|
||||||
import org.broadinstitute.sting.utils.Utils;
|
import org.broadinstitute.sting.utils.Utils;
|
||||||
import org.broadinstitute.sting.utils.classloader.JVMUtils;
|
import org.broadinstitute.sting.utils.classloader.JVMUtils;
|
||||||
import org.broadinstitute.sting.utils.collections.Pair;
|
import org.broadinstitute.sting.utils.collections.Pair;
|
||||||
|
|
@ -295,6 +297,8 @@ public class GenericDocumentationHandler extends DocumentedGATKFeatureHandler {
|
||||||
// Get annotation info (what type of annotation, standard etc.)
|
// Get annotation info (what type of annotation, standard etc.)
|
||||||
final HashSet<String> annotInfo = getAnnotInfo(myClass, new HashSet<String>());
|
final HashSet<String> annotInfo = getAnnotInfo(myClass, new HashSet<String>());
|
||||||
root.put("annotinfo", StringUtils.join(annotInfo, ", "));
|
root.put("annotinfo", StringUtils.join(annotInfo, ", "));
|
||||||
|
// Get annotation field (whether it goes in INFO or FORMAT)
|
||||||
|
root.put("annotfield", getAnnotField(myClass));
|
||||||
// Get walker type if applicable
|
// Get walker type if applicable
|
||||||
root.put("walkertype", getWalkerType(myClass));
|
root.put("walkertype", getWalkerType(myClass));
|
||||||
// Get partition type if applicable
|
// Get partition type if applicable
|
||||||
|
|
@ -316,6 +320,7 @@ public class GenericDocumentationHandler extends DocumentedGATKFeatureHandler {
|
||||||
// put empty items to avoid blowups
|
// put empty items to avoid blowups
|
||||||
root.put("parallel", new HashSet<String>());
|
root.put("parallel", new HashSet<String>());
|
||||||
root.put("annotinfo", "");
|
root.put("annotinfo", "");
|
||||||
|
root.put("annotfield", "");
|
||||||
root.put("walkertype", "");
|
root.put("walkertype", "");
|
||||||
root.put("partitiontype", "");
|
root.put("partitiontype", "");
|
||||||
root.put("readfilters", new HashSet<HashMap<String, Object>>());
|
root.put("readfilters", new HashSet<HashMap<String, Object>>());
|
||||||
|
|
@ -359,6 +364,27 @@ public class GenericDocumentationHandler extends DocumentedGATKFeatureHandler {
|
||||||
return getParallelism(mySuperClass, parallelOptions);
|
return getParallelism(mySuperClass, parallelOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Utility function that looks up whether the annotation goes in INFO or FORMAT field.
|
||||||
|
*
|
||||||
|
* @param myClass the class to query for the interfaces
|
||||||
|
* @return a String specifying the annotation field
|
||||||
|
*/
|
||||||
|
private final String getAnnotField(Class myClass) {
|
||||||
|
//
|
||||||
|
// Look up superclasses recursively until we find either
|
||||||
|
// GenotypeAnnotation or InfoFieldAnnotation
|
||||||
|
final Class mySuperClass = myClass.getSuperclass();
|
||||||
|
if (mySuperClass == InfoFieldAnnotation.class) {
|
||||||
|
return "INFO (variant-level)";
|
||||||
|
} else if (mySuperClass == GenotypeAnnotation.class) {
|
||||||
|
return "FORMAT (sample genotype-level)";
|
||||||
|
} else if (mySuperClass.getSimpleName().equals("Object")) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return getAnnotField(mySuperClass);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility function that determines the annotation type for an instance of class c.
|
* Utility function that determines the annotation type for an instance of class c.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -123,8 +123,13 @@
|
||||||
<small>${partitiontype}</small>
|
<small>${partitiontype}</small>
|
||||||
</h3>
|
</h3>
|
||||||
</#if>
|
</#if>
|
||||||
|
<#if annotfield != "" >
|
||||||
|
<h3>VCF Field
|
||||||
|
<small>${annotfield}</small>
|
||||||
|
</h3>
|
||||||
|
</#if>
|
||||||
<#if annotinfo != "" >
|
<#if annotinfo != "" >
|
||||||
<h3>Annotation type
|
<h3>Type
|
||||||
<small>${annotinfo}</small>
|
<small>${annotinfo}</small>
|
||||||
</h3>
|
</h3>
|
||||||
</#if>
|
</#if>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue