Skip to content

Commit

Permalink
Cleaned up javadoc... (#1434)
Browse files Browse the repository at this point in the history
- cleaned up javadoc so that there are no warnings and so that the links work properly.
- removed unneeded imports
- some IDE-recommended changes.
  • Loading branch information
Yossi Farjoun committed Feb 20, 2020
1 parent d6cb393 commit ab0435a
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 30 deletions.
10 changes: 5 additions & 5 deletions src/main/java/picard/analysis/CollectWgsMetrics.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ protected IntervalList getIntervalsToExamine() {
return intervals;
}

/** This method should only be called after {@link this.getSamReader()} is called. */
/** This method should only be called after {@link #getSamReader()} is called. */
protected SAMFileHeader getSamFileHeader() {
if (this.header == null) throw new IllegalStateException("getSamFileHeader() was called but this.header is null");
return this.header;
Expand Down Expand Up @@ -360,10 +360,10 @@ protected long getBasesExcludedBy(final CountingFilter filter) {
}

/**
* Creates {@link htsjdk.samtools.util.AbstractLocusIterator} implementation according to {@link this#USE_FAST_ALGORITHM} value.
* Creates {@link htsjdk.samtools.util.AbstractLocusIterator} implementation according to {@link #USE_FAST_ALGORITHM} value.
*
* @param in inner {@link htsjdk.samtools.SamReader}
* @return if {@link this#USE_FAST_ALGORITHM} is enabled, returns {@link htsjdk.samtools.util.EdgeReadIterator} implementation,
* @return if {@link #USE_FAST_ALGORITHM} is enabled, returns {@link htsjdk.samtools.util.EdgeReadIterator} implementation,
* otherwise default algorithm is used and {@link htsjdk.samtools.util.SamLocusIterator} is returned.
*/
protected AbstractLocusIterator getLocusIterator(final SamReader in) {
Expand All @@ -378,11 +378,11 @@ protected AbstractLocusIterator getLocusIterator(final SamReader in) {
}

/**
* Creates {@link picard.analysis.AbstractWgsMetricsCollector} implementation according to {@link this#USE_FAST_ALGORITHM} value.
* Creates {@link picard.analysis.AbstractWgsMetricsCollector} implementation according to {@link #USE_FAST_ALGORITHM} value.
*
* @param coverageCap the maximum depth/coverage to consider.
* @param intervals the intervals over which metrics are collected.
* @return if {@link this#USE_FAST_ALGORITHM} is enabled, returns {@link picard.analysis.FastWgsMetricsCollector} implementation,
* @return if {@link #USE_FAST_ALGORITHM} is enabled, returns {@link picard.analysis.FastWgsMetricsCollector} implementation,
* otherwise default algorithm is used and {@link picard.analysis.CollectWgsMetrics.WgsMetricsCollector} is returned.
*/
protected AbstractWgsMetricsCollector getCollector(final int coverageCap, final IntervalList intervals) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/picard/illumina/DistanceMetric.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected int distance0(final SingleBarcodeDistanceMetric editDistance) {
"Unequal bases are considered mismatches. No-call read-bases, or those with low quality are not considered mismatches.") {
@Override
protected int distance0(final SingleBarcodeDistanceMetric editDistance) {
return editDistance.leniantHammingDistance();
return editDistance.lenientHammingDistance();
}
},

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/picard/sam/PositionBasedDownsampleSam.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import picard.cmdline.CommandLineProgram;
import picard.cmdline.StandardOptionDefinitions;
import picard.cmdline.programgroups.ReadDataManipulationProgramGroup;
import picard.sam.markduplicates.util.OpticalDuplicateFinder;
import picard.sam.markduplicates.MarkDuplicates;
import picard.sam.util.PhysicalLocationInt;
import picard.sam.util.ReadNameParser;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/picard/sam/SamErrorMetric/BaseCalculator.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import htsjdk.samtools.util.SamLocusIterator;

/**
* An interface that can take a collection of bases (provided as {@link htsjdk.samtools.util.SamLocusIterator.RecordAndOffset RecordAndOffset}
* and {@link SamLocusAndReferenceIterator.SAMLocusAndReference SAMLocusAndReference}) and generates a
* An interface that can take a collection of bases (provided as {@link SamLocusIterator.RecordAndOffset}
* and {@link SamLocusAndReferenceIterator.SAMLocusAndReference}) and generates a
* {@link ErrorMetric} from them.
* <p>
* The Calculator has a suffix which will be used to generate the metric file suffixes.
Expand All @@ -47,7 +47,7 @@ public interface BaseCalculator {
ErrorMetric getMetric();

/**
* the function by which new loci are "shown" to the calculator
* The function by which new loci are "shown" to the calculator
**/
void addBase(final SamLocusIterator.RecordAndOffset recordAndOffset,
final SamLocusAndReferenceIterator.SAMLocusAndReference locusInfo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@ public String getSuffix() {
*
* @param <T> the type of the left Stratifier
* @param <S> the type of the right Stratifier
* @param leftStratifier a {@link RecordAndOffsetStratifier<T>} to use
* @param rightStratifier a {@link RecordAndOffsetStratifier<S>} to use
* @param leftStratifier a {@link RecordAndOffsetStratifier} to use
* @param rightStratifier a {@link RecordAndOffsetStratifier} to use
* @param suffix the suffix to use for the new stratifier
* @return an instance of {@link PairStratifier>} that will stratify according to both <code>leftStratifier</code>
* @return an instance of {@link PairStratifier} that will stratify according to both <code>leftStratifier</code>
* and <code>rightStratifier</code>
*/
public static <T extends Comparable<T>, S extends Comparable<S>> PairStratifier<T, S> PairStratifierFactory(
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/picard/util/BaitDesigner.java
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,6 @@ int estimateBaits(final int start, final int end) {
return Math.max(MINIMUM_BAITS_PER_TARGET, (int) (Math.ceil(length - BAIT_SIZE) / (double) BAIT_OFFSET) + 1);
}

/**
* Main method that coordinates the checking of inputs, designing of baits and then
* the writing out of all necessary files.
*
* @return
*/
@Override
protected int doWork() {
// Input parameter munging and checking
Expand Down
14 changes: 10 additions & 4 deletions src/main/java/picard/util/SingleBarcodeDistanceMetric.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,17 @@ public int hammingDistance() {
return numMismatches;
}

/**
* Similar to Hamming distance but this version doesn't penalize matching bases with low quality for the read.
* @return
*/

@Deprecated //(due to typo in original name. 1/9/2020)
public int leniantHammingDistance() {
return lenientHammingDistance();
}
/**
* Similar to Hamming distance but this version doesn't penalize matching bases with low quality for the read.
* @return the edit distance between the barcode(s) and the read(s)
*/
public int lenientHammingDistance() {
int numMismatches = 0;
for (int i = 0; i < barcodeBases.length && i < maskedBases.length && numMismatches <= maximalInterestingDistance; ++i) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
import htsjdk.variant.vcf.VCFHeaderLineType;
import htsjdk.variant.vcf.VCFInfoHeaderLine;
import org.broadinstitute.barclay.argparser.Argument;
import org.broadinstitute.barclay.argparser.CommandLineProgramProperties;
import org.broadinstitute.barclay.help.DocumentedFeature;
import picard.cmdline.CommandLineProgram;
import org.broadinstitute.barclay.argparser.CommandLineProgramProperties;
import picard.cmdline.StandardOptionDefinitions;
import picard.cmdline.programgroups.VariantEvaluationProgramGroup;
import picard.pedigree.PedFile;
Expand Down Expand Up @@ -209,24 +209,22 @@ private Set<Interval> parseIntervalLists(final Set<String> intervalLists){
}
return intervals;
}
/**

/**
* Validates that the sex chromosomes don't overlap and parses the pseudo-autosomal regions into usable
* objects to ensure their parsability
*
* @return
*/
@Override
protected String[] customCommandLineValidation() {
final List<String> errors = new ArrayList<>();

// Check that the sex chromosomes are not overlapping
final Set<String> sexChroms = new HashSet<>();
sexChroms.addAll(FEMALE_CHROMS);
final Set<String> sexChroms = new HashSet<>(FEMALE_CHROMS);
sexChroms.retainAll(MALE_CHROMS);
if (!sexChroms.isEmpty()) errors.add("The following chromosomes were listed as both male and female sex chromosomes: " + sexChroms);

if (errors.isEmpty()) return null;
else return errors.toArray(new String[errors.size()]);
else return errors.toArray(new String[0]);
}

@Override
Expand Down

0 comments on commit ab0435a

Please sign in to comment.