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

TASK-5858 - Fix alignment and coverage index analyses in blob storage #2416

Merged
merged 7 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,20 +168,22 @@ protected void run() throws Exception {
+ ") was not create, please, check log files.");
}

// Try to copy the BW file into the BAM file directory
// Try to move the BW file into the BAM file directory
boolean moveSuccessful = false;
Path targetPath = Paths.get(bamCatalogFile.getUri()).getParent().resolve(bwPath.getFileName());
try {
Files.move(bwPath, targetPath);
Path movedPath = Files.move(bwPath, targetPath);
moveSuccessful = targetPath.equals(movedPath);
} catch (Exception e) {
// Do nothing
logger.info("Moving from {} to {}: {}", bwPath, targetPath, e.getMessage());
// Log message
logger.info("Error moving the coverage file into the BAM folder {} to {}", bwPath, targetPath, e);
}

if (targetPath.toFile().exists()) {
if (moveSuccessful) {
bwPath = targetPath;
logger.info("Coverage file was copied into the BAM folder: {}", bwPath);
logger.info("Coverage file was moved into the BAM folder: {}", bwPath);
} else {
logger.info("Couldn't copy the coverage file into the BAM folder. The coverage file is in the job folder instead: {}",
logger.info("Couldn't move the coverage file into the BAM folder. The coverage file is in the job folder instead: {}",
bwPath);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,22 @@ protected void run() throws Exception {
throw new ToolException("Something wrong happened when computing index file for '" + inputFile + "'");
}

// Try to copy the BAI file into the BAM file directory
// Try to move the BAI file into the BAM file directory
boolean moveSuccessful = false;
Path targetPath = inputPath.getParent().resolve(outputPath.getFileName());
try {
Files.move(outputPath, targetPath);
Path movedPath = Files.move(outputPath, targetPath);
moveSuccessful = targetPath.equals(movedPath);
} catch (Exception e) {
// Do nothing
logger.info("Moving from {} to {}: {}", outputPath, targetPath, e.getMessage());
// Log message
logger.info("Error moving from {} to {}", outputPath, targetPath, e);
}

if (targetPath.toFile().exists()) {
if (moveSuccessful) {
outputPath = targetPath;
logger.info("Alignment index file was copied into the BAM folder: {}", outputPath);
logger.info("Alignment index file was moved into the BAM folder: {}", outputPath);
} else {
logger.info("Couldn't copy the alignment index file into the BAM folder. The index file is in the job folder instead: {}",
logger.info("Couldn't move the alignment index file into the BAM folder. The index file is in the job folder instead: {}",
outputPath);
}

Expand Down
Loading