Skip to content

Commit

Permalink
Revert "Temp Doclet WIP."
Browse files Browse the repository at this point in the history
This reverts commit a19c562.
  • Loading branch information
cmnbroad committed Oct 12, 2022
1 parent a19c562 commit e9cc3d8
Show file tree
Hide file tree
Showing 9 changed files with 294 additions and 306 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.google.common.annotations.VisibleForTesting;
import htsjdk.samtools.Cigar;
import joptsimple.internal.Strings;
import org.apache.commons.lang3.ArrayUtils;
import org.broadinstitute.gatk.nativebindings.smithwaterman.SWOverhangStrategy;
import org.broadinstitute.gatk.nativebindings.smithwaterman.SWParameters;
Expand Down Expand Up @@ -152,7 +153,7 @@ public boolean containsVertex(final V v) {

@Override
public String toString() {
final String joinedPath = getVertices().stream().map(BaseVertex::getSequenceString).collect(Collectors.joining("->"));
final String joinedPath = Strings.join(getVertices().stream().map(BaseVertex::getSequenceString).collect(Collectors.toList()), "->");
return String.format("Path{path=%s}", joinedPath);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public class CNNScoreVariants extends TwoPassVariantWalker {

// Create the Python executor. This doesn't actually start the Python process, but verifies that
// the requestedPython executable exists and can be located.
StreamingPythonScriptExecutor<String> pythonExecutor; //= new StreamingPythonScriptExecutor<>(true);
final StreamingPythonScriptExecutor<String> pythonExecutor = new StreamingPythonScriptExecutor<>(true);

private List<String> batchList = new ArrayList<>(inferenceBatchSize);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public class CNNVariantTrain extends CommandLineProgram {
private String annotationSet = "best_practices";

// Start the Python executor. This does not actually start the Python process, but fails if python can't be located
PythonScriptExecutor pythonExecutor; // = new PythonScriptExecutor(true);
final PythonScriptExecutor pythonExecutor = new PythonScriptExecutor(true);


@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public class CNNVariantWriteTensors extends CommandLineProgram {
private int maxTensors = 1000000;

// Start the Python executor. This does not actually start the Python process, but fails if python can't be located
PythonScriptExecutor pythonExecutor;// = new PythonScriptExecutor(true);
final PythonScriptExecutor pythonExecutor = new PythonScriptExecutor(true);

@Override
protected void onStartup() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,41 @@
package org.broadinstitute.hellbender.utils.help;

import org.broadinstitute.barclay.help.DocWorkUnit;
import org.broadinstitute.barclay.help.DocWorkUnitHandler;
import org.broadinstitute.barclay.help.DocumentedFeature;

import org.broadinstitute.hellbender.utils.runtime.RuntimeUtils;

import javax.lang.model.element.Element;

/**
* Custom DocWorkUnit used for generating GATK help/documentation. Overrides the defaults to provide tool
* names that are annotated with a " (Picard)" suffix for Picard tools.
*
* 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. This class has a dependency on com.sun.javadoc classes,
* which may not be present since they're not provided as part of the normal GATK runtime classpath.
*/
@SuppressWarnings("removal")
public class GATKDocWorkUnit extends DocWorkUnit {

public GATKDocWorkUnit(
final DocWorkUnitHandler workUnitHandler,
final Element classElement,
final Class<?> clazz,
final DocumentedFeature documentedFeatureAnnotation) {
super(workUnitHandler, classElement, clazz, documentedFeatureAnnotation);
}

@Override
public String getName() {
// Override getName to return a display name that annotates Picard tool names with " (Picard)"
return RuntimeUtils.toolDisplayName(getClazz());
}

/**
* Sort in order of the name of this WorkUnit
*/
@Override
public int compareTo(DocWorkUnit other) {
return this.getName().compareTo(other.getName());
}
}
//package org.broadinstitute.hellbender.utils.help;
//
//import org.broadinstitute.barclay.help.DocWorkUnit;
//import org.broadinstitute.barclay.help.DocWorkUnitHandler;
//import org.broadinstitute.barclay.help.DocumentedFeature;
//
//import org.broadinstitute.hellbender.utils.runtime.RuntimeUtils;
//
///**
// * Custom DocWorkUnit used for generating GATK help/documentation. Overrides the defaults to provide tool
// * names that are annotated with a " (Picard)" suffix for Picard tools.
// *
// * 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. This class has a dependency on com.sun.javadoc classes,
// * which may not be present since they're not provided as part of the normal GATK runtime classpath.
// */
//@SuppressWarnings("removal")
//public class GATKDocWorkUnit extends DocWorkUnit {
//
// public GATKDocWorkUnit(
// final DocWorkUnitHandler workUnitHandler,
// final DocumentedFeature documentedFeatureAnnotation,
// final com.sun.javadoc.ClassDoc classDoc,
// final Class<?> clazz) {
// super(workUnitHandler, documentedFeatureAnnotation, classDoc, clazz);
// }
//
// @Override
// public String getName() {
// // Override getName to return a display name that annotates Picard tool names with " (Picard)"
// return RuntimeUtils.toolDisplayName(getClazz());
// }
//
// /**
// * Sort in order of the name of this WorkUnit
// */
// @Override
// public int compareTo(DocWorkUnit other) {
// return this.getName().compareTo(other.getName());
// }
//}
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package org.broadinstitute.hellbender.utils.help;

import org.broadinstitute.barclay.help.GSONWorkUnit;

/**
* Class representing a GSONWorkUnit for GATK work units.
*
* Adds "walkertype" to the base gson object created by Barclay.
*/
public class GATKGSONWorkUnit extends GSONWorkUnit {

private String walkerType;

public void setWalkerType(final String walkerType){
this.walkerType = walkerType;
}
}
//package org.broadinstitute.hellbender.utils.help;
//
//import org.broadinstitute.barclay.help.GSONWorkUnit;
//
///**
// * Class representing a GSONWorkUnit for GATK work units.
// *
// * Adds "walkertype" to the base gson object created by Barclay.
// */
//public class GATKGSONWorkUnit extends GSONWorkUnit {
//
// private String walkerType;
//
// public void setWalkerType(final String walkerType){
// this.walkerType = walkerType;
// }
//}
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
package org.broadinstitute.hellbender.utils.help;

import org.broadinstitute.barclay.argparser.CommandLineProgramProperties;
import org.broadinstitute.barclay.help.DefaultDocWorkUnitHandler;
import org.broadinstitute.barclay.help.DocWorkUnit;

import org.broadinstitute.barclay.help.HelpDoclet;

/**
* The GATK Documentation work unit handler class that is the companion to GATKHelpDoclet.
*
* 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 GATKHelpDocWorkUnitHandler extends DefaultDocWorkUnitHandler {

private final static String GATK_JAVADOC_TAG_PREFIX = "GATK"; // prefix for custom javadoc tags used by GATK

private final static String GATK_FREEMARKER_TEMPLATE_NAME = "generic.template.html";

public GATKHelpDocWorkUnitHandler(final HelpDoclet doclet) {
super(doclet);
}
/**
* @return Prefix for custom GATK tags that should be lifted from the javadoc and stored in the
* FreeMarker map. These will be available in the template returned by {@link #getTemplateName}.
*/
@Override
protected String getTagFilterPrefix() { return GATK_JAVADOC_TAG_PREFIX; }

/**
* @param workUnit the classdoc 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; }


/**
* Add any custom freemarker bindings discovered via custom javadoc tags. Subclasses can override this to
* provide additional custom bindings.
*
* @param currentWorkUnit the work unit for the feature being documented
*/
@Override
protected void addCustomBindings(final DocWorkUnit currentWorkUnit) {
super.addCustomBindings(currentWorkUnit);

// Picard tools use the summary line for the long overview section, so extract that
// from Picard tools only, and put it in the freemarker map.
Class<?> toolClass = currentWorkUnit.getClazz();
if (picard.cmdline.CommandLineProgram.class.isAssignableFrom(toolClass)) {
final CommandLineProgramProperties clpProperties = currentWorkUnit.getCommandLineProperties();
currentWorkUnit.setProperty("picardsummary", clpProperties.summary());
}
}

}
//package org.broadinstitute.hellbender.utils.help;
//
//import org.broadinstitute.barclay.argparser.CommandLineProgramProperties;
//import org.broadinstitute.barclay.help.DefaultDocWorkUnitHandler;
//import org.broadinstitute.barclay.help.DocWorkUnit;
//
//import org.broadinstitute.barclay.help.HelpDoclet;
//
///**
// * The GATK Documentation work unit handler class that is the companion to GATKHelpDoclet.
// *
// * 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 GATKHelpDocWorkUnitHandler extends DefaultDocWorkUnitHandler {
//
// private final static String GATK_JAVADOC_TAG_PREFIX = "GATK"; // prefix for custom javadoc tags used by GATK
//
// private final static String GATK_FREEMARKER_TEMPLATE_NAME = "generic.template.html";
//
// public GATKHelpDocWorkUnitHandler(final HelpDoclet doclet) {
// super(doclet);
// }
// /**
// * @return Prefix for custom GATK tags that should be lifted from the javadoc and stored in the
// * FreeMarker map. These will be available in the template returned by {@link #getTemplateName}.
// */
// @Override
// protected String getTagFilterPrefix() { return GATK_JAVADOC_TAG_PREFIX; }
//
// /**
// * @param workUnit the classdoc 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; }
//
//
// /**
// * Add any custom freemarker bindings discovered via custom javadoc tags. Subclasses can override this to
// * provide additional custom bindings.
// *
// * @param currentWorkUnit the work unit for the feature being documented
// */
// @Override
// protected void addCustomBindings(final DocWorkUnit currentWorkUnit) {
// super.addCustomBindings(currentWorkUnit);
//
// // Picard tools use the summary line for the long overview section, so extract that
// // from Picard tools only, and put it in the freemarker map.
// Class<?> toolClass = currentWorkUnit.getClazz();
// if (picard.cmdline.CommandLineProgram.class.isAssignableFrom(toolClass)) {
// final CommandLineProgramProperties clpProperties = currentWorkUnit.getCommandLineProperties();
// currentWorkUnit.setProperty("picardsummary", clpProperties.summary());
// }
// }
//
//}
Loading

0 comments on commit e9cc3d8

Please sign in to comment.