Skip to content

Commit

Permalink
Change default in RevertSam for restoring hard-clips to true (#1509)
Browse files Browse the repository at this point in the history
* Change default in RevertSam for restoring hard-clips to true.
  • Loading branch information
fleharty authored May 15, 2020
1 parent 40b8d40 commit 53b419c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/main/java/picard/sam/RevertSam.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ public class RevertSam extends CommandLineProgram {
@Argument(shortName = "OBR", doc = "When true, outputs each read group in a separate file.")
public boolean OUTPUT_BY_READGROUP = false;

@Argument(shortName = "RHC", doc = "Restore reads and qualities with hard-clips of records containing have XB and XQ tags.")
public boolean RESTORE_HARDCLIPS = false;
@Argument(shortName = "RHC", doc = "When true, restores reads and qualities of records with hard-clips containing XB and XQ tags.")
public boolean RESTORE_HARDCLIPS = true;

public static enum FileType implements CommandLineParser.ClpEnum {
sam("Generate SAM files."),
Expand Down
16 changes: 11 additions & 5 deletions src/test/java/picard/sam/RevertSamTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public String getCommandLineProgramName() {
}

@Test(dataProvider="positiveTestData")
public void basicPositiveTests(final SAMFileHeader.SortOrder so, final boolean removeDuplicates, final boolean removeAlignmentInfo,
public void basicPositiveTests(final SAMFileHeader.SortOrder so, final boolean removeDuplicates, final boolean removeAlignmentInfo, final boolean restoreHardClips,
final boolean restoreOriginalQualities, final boolean outputByReadGroup, final String sample, final String library,
final List<String> attributesToClear) throws Exception {

Expand All @@ -98,6 +98,9 @@ public void basicPositiveTests(final SAMFileHeader.SortOrder so, final boolean r
if (outputByReadGroup) {
argSize++;
}
if (!restoreHardClips) {
argSize++;
}
final String args[] = new String[argSize];
int index = 0;
args[index++] = "INPUT=" + basicSamToRevert;
Expand All @@ -110,6 +113,9 @@ public void basicPositiveTests(final SAMFileHeader.SortOrder so, final boolean r
}
args[index++] = "REMOVE_DUPLICATE_INFORMATION=" + removeDuplicates;
args[index++] = "REMOVE_ALIGNMENT_INFORMATION=" + removeAlignmentInfo;
if (!restoreHardClips) {
args[index++] = "RESTORE_HARDCLIPS=" + restoreHardClips;
}
args[index++] = "RESTORE_ORIGINAL_QUALITIES=" + restoreOriginalQualities;
if (sample != null) {
args[index++] = "SAMPLE_ALIAS=" + sample;
Expand Down Expand Up @@ -273,10 +279,10 @@ private void verifyPositiveResults(
@DataProvider(name="positiveTestData")
public Object[][] getPostitiveTestData() {
return new Object[][] {
{null, true, true, true, true, null, null, Collections.EMPTY_LIST},
{SAMFileHeader.SortOrder.queryname, true, true, true, false, "Hey,Dad!", null, Arrays.asList("XT")},
{null, false, true, false, false, "Hey,Dad!", "NewLibraryName", Arrays.asList("XT")},
{null, false, false, false, false, null, null, Collections.EMPTY_LIST}
{null, true, true, true, true, true, null, null, Collections.EMPTY_LIST},
{SAMFileHeader.SortOrder.queryname, true, true, true, true, false, "Hey,Dad!", null, Arrays.asList("XT")},
{null, false, true, true, false, false, "Hey,Dad!", "NewLibraryName", Arrays.asList("XT")},
{null, false, false, false, false, false, null, null, Collections.EMPTY_LIST}
};
}

Expand Down

0 comments on commit 53b419c

Please sign in to comment.