Skip to content

Add option for for enabling or disabling writing BAI and SBI files. - #5485

Merged
lbergelson merged 4 commits into
masterfrom
tw_disable_bai_sbi
Jan 24, 2019
Merged

lbergelson merged 4 commits into
masterfrom
tw_disable_bai_sbi

Conversation

@tomwhite

@tomwhite tomwhite commented Dec 5, 2018

Copy link
Copy Markdown
Contributor

Relies on disq-bio/disq#69, which has not yet been merged or released.

protected int numReducers = 0;

@Argument(doc = "For tools that write output BAM, write an BAI file. Defaults to true.",
fullName = WRITE_SBI_LONG_NAME,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Suggested change
fullName = WRITE_SBI_LONG_NAME,
fullName = WRITE_BAI_LONG_NAME,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@lbergelson lbergelson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomwhite Minor comments 👍 otherwise

optional = true)
protected int numReducers = 0;

@Argument(doc = "For tools that write output BAM, write an BAI file. Defaults to true.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use the same argument name / configuration as this:

@Argument(fullName=StandardArgumentDefinitions.CREATE_OUTPUT_BAM_INDEX_LONG_NAME,
shortName=StandardArgumentDefinitions.CREATE_OUTPUT_BAM_INDEX_SHORT_NAME,
doc = "If true, create a BAM/CRAM index when writing a coordinate-sorted BAM/CRAM file.", optional=true, common = true)
public boolean createOutputBamIndex = ConfigFactory.getInstance().getGATKConfig().createOutputBamIndex();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out! Fixed.

protected int numReducers = 0;

@Argument(doc = "For tools that write output BAM, write an BAI file. Defaults to true.",
fullName = WRITE_SBI_LONG_NAME,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woops, copy/paste error here

public static final String NUM_REDUCERS_LONG_NAME = "num-reducers";
public static final String SHARDED_OUTPUT_LONG_NAME = "sharded-output";
public static final String OUTPUT_SHARD_DIR_LONG_NAME = "output-shard-tmp-dir";
public static final String WRITE_BAI_LONG_NAME = "write-bai";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a constant for this already, see comment below.

public static final String SHARDED_OUTPUT_LONG_NAME = "sharded-output";
public static final String OUTPUT_SHARD_DIR_LONG_NAME = "output-shard-tmp-dir";
public static final String WRITE_BAI_LONG_NAME = "write-bai";
public static final String WRITE_SBI_LONG_NAME = "write-sbi";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe rename to create-output-bam-splitting-index for consistency

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@jamesemery jamesemery left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look good, one gripe with the tests and you seem to have the following compiler errors, but once those are resolved then i think we can merge:

k.java:111: error: cannot find symbol
            BaiWriteOption baiWriteOption = BaiWriteOption.fromBoolean(writeBai);
            ^
  symbol:   class BaiWriteOption
  location: class ReadsSparkSink
/home/travis/build/broadinstitute/gatk/src/main/java/org/broadinstitute/hellbender/engine/spark/datasources/ReadsSparkSink.java:111: error: cannot find symbol
            BaiWriteOption baiWriteOption = BaiWriteOption.fromBoolean(writeBai);
                                            ^
  symbol:   variable BaiWriteOption
  location: class ReadsSparkSink
/home/travis/build/broadinstitute/gatk/src/main/java/org/broadinstitute/hellbender/engine/spark/datasources/ReadsSparkSink.java:112: error: cannot find symbol
            SbiWriteOption sbiWriteOption = SbiWriteOption.fromBoolean(writeSbi);
            ^
  symbol:   class SbiWriteOption
  location: class ReadsSparkSink
/home/travis/build/broadinstitute/gatk/src/main/java/org/broadinstitute/hellbender/engine/spark/datasources/ReadsSparkSink.java:112: error: cannot find symbol
            SbiWriteOption sbiWriteOption = SbiWriteOption.fromBoolean(writeSbi);

// Reinstate once https://github.com/disq-bio/disq/issues/45 is done
//Assert.assertTrue(Files.exists(IOUtils.getPath(outputPath + SBIIndex.FILE_EXTENSION)));
if (IOUtils.isBamFileName(outputPath) && writeSbi) {
Assert.assertTrue(Files.exists(IOUtils.getPath(outputPath + BAMIndex.BAMIndexSuffix)));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be SBIIndex.FILE_EXTENSION. You should also permute the tests in the data provider above to include a case of true, false and false, true for extension arguments so we can be sure to test that they can be requested independently.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I've fixed this now.

@jamesemery jamesemery assigned tomwhite and unassigned jamesemery Jan 15, 2019
@tomwhite

Copy link
Copy Markdown
Contributor Author

Thanks @jamesemery. The compile errors will be fixed once Disq 0.2.0 is released.

@codecov-io

codecov-io commented Jan 21, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #5485 into master will decrease coverage by <.001%.
The diff coverage is 100%.

@@               Coverage Diff               @@
##              master     #5485       +/-   ##
===============================================
- Coverage     87.045%   87.044%   -<.001%     
- Complexity     31536     31538        +2     
===============================================
  Files           1930      1930               
  Lines         145421    145440       +19     
  Branches       16089     16090        +1     
===============================================
+ Hits          126581    126597       +16     
- Misses         12982     12983        +1     
- Partials        5858      5860        +2
Impacted Files Coverage Δ Complexity Δ
...ender/engine/spark/datasources/ReadsSparkSink.java 59.722% <100%> (+2.369%) 17 <1> (+1) ⬆️
...stitute/hellbender/engine/spark/GATKSparkTool.java 82.32% <100%> (+0.4%) 78 <0> (ø) ⬇️
...gine/spark/datasources/ReadsSparkSinkUnitTest.java 72.222% <100%> (+3.15%) 21 <0> (+3) ⬆️
...nder/utils/runtime/StreamingProcessController.java 67.299% <0%> (-1.422%) 33% <0%> (-1%)

@tomwhite

Copy link
Copy Markdown
Contributor Author

@lbergelson @jamesemery this is passing now and all comments have been addressed. Can you unblock so it can be merged please?

@lbergelson lbergelson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomwhite 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants