Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bioinformatics
PanTools
Commits
b22c7076
Verified
Commit
b22c7076
authored
Nov 29, 2022
by
Moed, Matthijs
Browse files
Remove scratch directory completely, not just its files. See
!95
.
parent
0e28ebc2
Pipeline
#57599
passed with stage
in 43 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/nl/wur/bif/pantools/pangenome/GenomeLayer.java
View file @
b22c7076
...
...
@@ -2148,6 +2148,9 @@ public class GenomeLayer {
System
.
err
.
println
(
"Error occurred during localization: "
+
e
);
e
.
printStackTrace
(
System
.
err
);
System
.
exit
(
1
);
}
finally
{
if
(!
keepIntermediateFiles
)
deleteDirectoryRecursively
(
scratchDirectory
);
}
try
(
Transaction
tx
=
GRAPH_DB
.
beginTx
())
{
...
...
@@ -2215,7 +2218,8 @@ public class GenomeLayer {
add_sequence_properties
(
scratchDirectory
);
localize_nodes
();
genome_overview
();
deleteDirectoryRecursively
(
scratchDirectory
);
System
.
out
.
println
(
"\rNumber of kmers: "
+
indexSc
.
length
());
System
.
out
.
println
(
"Number of nodes: "
+
num_nodes
);
System
.
out
.
println
(
"Number of edges: "
+
num_edges
);
...
...
@@ -3457,4 +3461,18 @@ public class GenomeLayer {
}
return
directory
;
}
/**
* Delete a directory and its contents.
* @param directory path to directory.
*/
public
void
deleteDirectoryRecursively
(
Path
directory
)
throws
IOException
{
try
(
Stream
<
Path
>
paths
=
Files
.
walk
(
directory
))
{
//noinspection ResultOfMethodCallIgnored
paths
.
sorted
(
Comparator
.
reverseOrder
())
.
map
(
Path:
:
toFile
)
.
forEach
(
File:
:
delete
);
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment