Skip to content

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

Merged
tomwhite merged 4 commits into
disq-bio:masterfrom
tomwhite:disable-bai-sbi
Dec 12, 2018
Merged

tomwhite merged 4 commits into
disq-bio:masterfrom
tomwhite:disable-bai-sbi

Conversation

@tomwhite

@tomwhite tomwhite commented Dec 3, 2018

Copy link
Copy Markdown
Member

No description provided.


import htsjdk.samtools.BAMIndex;

/** An option for for enabling or disabling writing BAI files. Enabled by default. */

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.

I would rather that writing index files were not enabled by default; per element of least surprise. Specifying options to disable features feels backwards.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've gone back and forth myself on this one. A counter argument is that tools should produce indexes by default, without the user having to remember to ask for them.

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.

I'm in favor of enabled by default but I don't care strongly. We'll just set it by default in gatk.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thinking about this more, I'm tempted to be consistent with htsjdk and only produce indexes when requested (i.e. off by default). See new commit in this PR. GATK can enable by default.

@heuermh heuermh 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.

Thank you, I think it reads better this way. Minor change requested in unit tests.

// default (both disabled)
String outputPath = createTempPath(bamExtension);
htsjdkReadsRddStorage.write(htsjdkReadsRdd, outputPath);
Assert.assertFalse(Files.exists(Paths.get(URI.create(outputPath + BAMIndex.BAMIndexSuffix))));

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.

use BAMIndex.getIndexExtension() here

String outputPath = createTempPath(bamExtension);
htsjdkReadsRddStorage.write(htsjdkReadsRdd, outputPath);
Assert.assertFalse(Files.exists(Paths.get(URI.create(outputPath + BAMIndex.BAMIndexSuffix))));
Assert.assertFalse(Files.exists(Paths.get(URI.create(outputPath + SBIIndex.FILE_EXTENSION))));

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.

use SBIIndex.getIndexExtension() here

@tomwhite
tomwhite merged commit 1a9b0c4 into disq-bio:master Dec 12, 2018
@tomwhite
tomwhite deleted the disable-bai-sbi branch December 12, 2018 09:19
@tomwhite

Copy link
Copy Markdown
Member Author

Thanks @heuermh

@tomwhite tomwhite added this to the 0.2.0 milestone Dec 18, 2018
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.

3 participants