From 18a19cb9dd22d6a54965bb1693fc9b11d9f979ab Mon Sep 17 00:00:00 2001 From: IgorRodchenkov Date: Thu, 16 May 2024 14:42:23 -0400 Subject: [PATCH] Added a new JVM/system property: paxtools.pattern.blacklist --- README.md | 1 + .../main/java/org/biopax/paxtools/pattern/util/Blacklist.java | 2 +- .../src/main/java/org/biopax/paxtools/Commands.java | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 209bf26dd..8bc4b0990 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ Paxtools can be build and run with JDK-17 or newer, e.g. Temurin-21. Add these J - `-Dpaxtools.CollectionProvider=org.biopax.paxtools.trove.TProvider` to use a high-performance collections provider for BioPAX elements Map or Set (recommended). - `-Dpaxtools.normalizer.use-latest-registry=true` (if using Normalizer/Resolver) to use the latest registry.json from bioregistry.io. - `-Dpaxtools.core.use-latest-genenames=true` for the HGNC utility class use id mapping data from genenames.org instead of built-in older file. + - `-Dpaxtools.pattern.blacklist=` path to "ubique molecules blacklist" file to use with SIF searcher. If you have [homebrew](http://brew.sh/) installed on your system (Mac OS X), you can install the latest release of Paxtools via the following brew command (could be old version): diff --git a/pattern/src/main/java/org/biopax/paxtools/pattern/util/Blacklist.java b/pattern/src/main/java/org/biopax/paxtools/pattern/util/Blacklist.java index b93a1b86d..53010d34d 100644 --- a/pattern/src/main/java/org/biopax/paxtools/pattern/util/Blacklist.java +++ b/pattern/src/main/java/org/biopax/paxtools/pattern/util/Blacklist.java @@ -380,7 +380,7 @@ private String getSMRID(PhysicalEntity pe) */ public Collection getUbiques(Set entities, RelType context) { - Map ubiques = new HashMap(); + Map ubiques = new HashMap<>(); boolean allUbiques = true; for (PhysicalEntity pe : entities) diff --git a/paxtools-console/src/main/java/org/biopax/paxtools/Commands.java b/paxtools-console/src/main/java/org/biopax/paxtools/Commands.java index 62d85a78a..978547aaa 100644 --- a/paxtools-console/src/main/java/org/biopax/paxtools/Commands.java +++ b/paxtools-console/src/main/java/org/biopax/paxtools/Commands.java @@ -347,7 +347,8 @@ static void toSifnx(String[] argv) throws IOException { SIFSearcher searcher = new SIFSearcher(idFetcher, sifTypes.toArray(new SIFEnum[]{})); log.info("toSIF: using SIFTypes: " + sifTypes); //load and set blacklist.txt file if exists - File blacklistFile = new File("blacklist.txt"); + String blacklistPath = System.getProperty("paxtools.pattern.blacklist", "blacklist.txt"); + File blacklistFile = new File(blacklistPath); if(blacklistFile.exists()) { log.info("toSIF: using blacklist.txt from current directory"); searcher.setBlacklist(new Blacklist(new FileInputStream(blacklistFile)));