lib: fix protein check of downloaded files
@@ -408,18 +408,16 @@ public class CoreDownloadManager extends DownloadManager {
}
logger.info("Downloading protein information ...");
Path proteinFolder = downloadFolder.resolve("protein");
-
- if (!Files.exists(proteinFolder)) {
Files.createDirectories(proteinFolder);
+
String url = configuration.getDownload().getUniprot().getHost();
downloadFile(url, proteinFolder.resolve("uniprot_sprot.xml.gz").toString());
String relNotesUrl = configuration.getDownload().getUniprotRelNotes().getHost();
downloadFile(relNotesUrl, proteinFolder.resolve("uniprotRelnotes.txt").toString());
- saveVersionData(EtlCommons.PROTEIN_DATA, UNIPROT_NAME, getLine(proteinFolder.resolve("uniprotRelnotes.txt"), 1),
- getTimeStamp(), Collections.singletonList(url), proteinFolder.resolve("uniprotVersion.json"));
-
Files.createDirectories(proteinFolder.resolve("uniprot_chunks"));
splitUniprot(proteinFolder.resolve("uniprot_sprot.xml.gz"), proteinFolder.resolve("uniprot_chunks"));
+ saveVersionData(EtlCommons.PROTEIN_DATA, UNIPROT_NAME, getLine(proteinFolder.resolve("uniprotRelnotes.txt"), 1),
+ getTimeStamp(), Collections.singletonList(url), proteinFolder.resolve("uniprotVersion.json"));
url = configuration.getDownload().getIntact().getHost();
downloadFile(url, proteinFolder.resolve("intact.txt").toString());
@@ -432,10 +430,6 @@ public class CoreDownloadManager extends DownloadManager {
downloadFile(relNotesUrl, proteinFolder.resolve("interproRelnotes.txt").toString());
saveVersionData(EtlCommons.PROTEIN_DATA, INTERPRO_NAME, getLine(proteinFolder.resolve("interproRelnotes.txt"), 5),
getTimeStamp(), Collections.singletonList(url), proteinFolder.resolve("interproVersion.json"));
-
- } else {
- logger.info("Protein: skipping this since it is already downloaded. Delete 'protein' folder to force download");
- }
}
private void splitUniprot(Path uniprotFilePath, Path splitOutdirPath) throws IOException {
