-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore array output in gCNV WDLs for efficient postprocessing. (#5490)
* Added canonicalization of all file paths passed to gCNV python scripts. * Restore array output in gCNV WDLs for efficient postprocessing.
- Loading branch information
1 parent
0570670
commit c89c189
Showing
7 changed files
with
115 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/java/org/broadinstitute/hellbender/tools/copynumber/utils/CopyNumberUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.broadinstitute.hellbender.tools.copynumber.utils; | ||
|
||
import org.broadinstitute.hellbender.exceptions.UserException; | ||
import org.broadinstitute.hellbender.utils.Utils; | ||
import org.broadinstitute.hellbender.utils.python.PythonScriptExecutor; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
public final class CopyNumberUtils { | ||
private CopyNumberUtils() {} | ||
|
||
/** | ||
* File paths that are passed to {@link PythonScriptExecutor} must be canonical (rather than absolute). | ||
* See https://github.com/broadinstitute/gatk/issues/4724. | ||
*/ | ||
public static String getCanonicalPath(final File file) { | ||
Utils.nonNull(file); | ||
try { | ||
return file.getCanonicalPath(); | ||
} catch (final IOException e) { | ||
throw new UserException.BadInput(String.format("Could not resolve a canonical file path: %s", file)); | ||
} | ||
} | ||
|
||
/** | ||
* File paths that are passed to {@link PythonScriptExecutor} must be canonical (rather than absolute). | ||
* See https://github.com/broadinstitute/gatk/issues/4724. | ||
*/ | ||
public static String getCanonicalPath(final String filename) { | ||
Utils.nonEmpty(filename); | ||
return getCanonicalPath(new File(filename)); | ||
} | ||
} |