Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bai location when output not specified for BuildBamIndex #1838

Closed
wants to merge 1 commit into from

Conversation

kachulis
Copy link
Contributor

Addresses #1827

Copy link
Contributor

@cmnbroad cmnbroad left a comment

Choose a reason for hiding this comment

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

@kachulis I have a branch with the fix I proposed below, and a test, but I haven't yet fixed the test issue I mentioned below with the existing tests (writing into the testdata directory). I'll finish that and get it submitted.

@@ -88,7 +88,7 @@ protected int doWork() {
// set default output file - input-file.bai
if (OUTPUT == null) {

final String baseFileName = inputPath.getFileName().toString();
final String baseFileName = INPUT.hasFileSystemProvider() ? inputPath.toAbsolutePath().toString() : inputPath.getFileName().toString();
Copy link
Contributor

Choose a reason for hiding this comment

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

The best fix for this would be to change OUTPUT to have the same type (PicardHtsPath) as INPUT, so that they have the same semantics. Keeping OUTPUT as File while INPUT is a PicardHtsPath will most likely cause problems with cloud inputs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Awesome, I was hoping you might have a better solution to this :)

/* First sort, before indexing */
new SortSam().instanceMain(new String[]{
"I=" + INPUT_FILE,
"O=" + OUTPUT_SORTED_FILE,
Copy link
Contributor

Choose a reason for hiding this comment

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

The test is called "NoOutputSpecified", but it specifies an output .

Copy link
Contributor

Choose a reason for hiding this comment

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

The existing tests in this file are already a bit sketchy, since they write their outputs into the testdata directory. Its not clear if they're actually overwriting test data or not (I don't think they are, but it LOOKS like they are).

@kachulis kachulis closed this Oct 17, 2022
@kachulis kachulis deleted the ck_build_bam_index_fix branch October 17, 2022 15:49
@lbergelson
Copy link
Member

@kachulis What happened to this branch? Was it abandoned on purpose or by accident?

@kachulis
Copy link
Contributor Author

Closed on purpose because @cmnbroad said he had a better solution. Not sure if that ever got implemented.

@lbergelson lbergelson restored the ck_build_bam_index_fix branch February 14, 2023 18:15
@lbergelson lbergelson reopened this Feb 14, 2023
@lbergelson
Copy link
Member

We're closing this and adding it to the list of things to be cloudified.

@lbergelson lbergelson closed this Feb 14, 2023
@lbergelson lbergelson deleted the ck_build_bam_index_fix branch February 14, 2023 18:26
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