Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package org.broadinstitute.hellbender.utils.help;
import htsjdk.samtools.util.Iso8601Date;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import org.broadinstitute.barclay.argparser.*;
import org.broadinstitute.barclay.help.DocWorkUnit;
import org.broadinstitute.barclay.help.HelpDoclet;
import org.broadinstitute.barclay.help.TemplateProperties;
import org.broadinstitute.barclay.help.WDLWorkUnitHandler;
import org.broadinstitute.hellbender.engine.FeatureInput;
import org.broadinstitute.hellbender.engine.GATKPath;
import org.broadinstitute.hellbender.engine.spark.GATKSparkTool;
import org.broadinstitute.hellbender.exceptions.GATKException;
import picard.illumina.parser.ReadStructure;
import java.util.*;
// Note: WDL Gen doesn't handle arguments that accept tagged argument values
/**
* The GATK WDL work unit handler. Its main task is to convert the types for all arguments for a given work
* unit (tool) from Java types to WDL-compatible types by updating the freemarker map with the transformed types.
*
* NOTE: Methods in this class are intended to be called by Gradle/Javadoc only, and should not be called
* by methods that are used by the GATK runtime, as this class assumes a dependency on com.sun.javadoc classes
* which may not be present.
*/
public class GATKWDLWorkUnitHandler extends WDLWorkUnitHandler {
private final static String GATK_FREEMARKER_TEMPLATE_NAME = "wdlToolTemplate.wdl.ftl";
// This must be kept in sync with the value used in build.gradle, where the file is created
private final static String dummyWDLTestFileName = "dummyWDLTestFile";
private final static String WDL_TEST_VALUE_PROPERTY = "testValue";
// Map of Java argument types that the WDL generator knows how to convert to a WDL type, along with the
// corresponding string substitution that needs to be run on the (Barclay-generated) string that describes
// the type. From a purely string perspective, some of these transforms are no-ops in that no actual
// conversion is required because the type names are identical in Java and WDL (i.e, File->File or
// String->String), but they're included here for completeness, and to document the allowed type transitions.
private final static Map, ImmutablePair> javaToWDLTypeMap =
new HashMap, ImmutablePair>() {
private static final long serialVersionUID = 1L;
{
// GATK-specific File Types
put(GATKPath.class, new ImmutablePair<>(GATKPath.class.getSimpleName(), "File"));
// FeatureInputs require special handling to account for the generic type param(s)
put(FeatureInput.class, new ImmutablePair<>(FeatureInput.class.getSimpleName(), "File"));
put(Iso8601Date.class, new ImmutablePair<>(Iso8601Date.class.getSimpleName(), "String"));
put(Date.class, new ImmutablePair<>(Date.class.getSimpleName(), "String"));
put(ReadStructure.class, new ImmutablePair<>(ReadStructure.class.getSimpleName(), "String"));
}
};
public GATKWDLWorkUnitHandler(final HelpDoclet doclet) {
super(doclet);
}
/**
* @param workUnit the DocWorkUnit object being processed
* @return the name of a the freemarker template to be used for the class being documented.
* Must reside in the folder passed to the Barclay Doclet via the "-settings-dir" parameter to
* Javadoc.
*/
@Override
public String getTemplateName(final DocWorkUnit workUnit) { return GATK_FREEMARKER_TEMPLATE_NAME; }
/**
* Return the flat filename (no paths) that the handler would like the Doclet to
* write out the documentation for workUnit.
* @param workUnit
* @return the name of the destination file to which documentation output will be written
*/
@Override
public String getDestinationFilename(final DocWorkUnit workUnit) {
return workUnit.getClazz().getSimpleName() + ".wdl";
}
/**
* Returns the JSON output file name.
*/
@Override
public String getJSONFilename(final DocWorkUnit workUnit) {
return workUnit.getClazz().getSimpleName() + "Inputs.json";
}
/**
* Add the named argument {@code argDef}to the property map if applicable.
* @param currentWorkUnit current work unit
* @param args the freemarker arg map
* @param argDef the arg to add
*/
@Override
@SuppressWarnings("unchecked")
protected void processNamedArgument(
final DocWorkUnit currentWorkUnit,
final Map>> args,
final NamedArgumentDefinition argDef)
{
// for WDL gen, we don't want the special args such as --help or --version to show up in the
// WDL or JSON input files
if (!argDef.getUnderlyingField().getDeclaringClass().equals(SpecialArgumentsCollection.class)) {
super.processNamedArgument(currentWorkUnit, args, argDef);
// now extract any newlines out of the summary since the summary appears in a WDL line comment
final List