-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fine tuned server-side behavior of some parameters.
Added a sample analysis folder. Added new executable for converting SIF files to json.
- Loading branch information
1 parent
b003bf0
commit 06cd6a1
Showing
4 changed files
with
198 additions
and
25 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
47 changes: 47 additions & 0 deletions
47
src/main/java/org/panda/causalpath/run/JasonizeResultGraphsRecursively.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,47 @@ | ||
package org.panda.causalpath.run; | ||
|
||
import org.panda.causalpath.network.GraphWriter; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Paths; | ||
|
||
/** | ||
* This class is used for converting SIF and format files to json files that can be uploaded to the webserver for | ||
* visualization. | ||
* | ||
* Usage: java -jar causalpath.jar <in-dir> <sif-name> <out-dir> <json-name> | ||
* | ||
*/ | ||
public class JasonizeResultGraphsRecursively | ||
{ | ||
public static void main(String[] args) throws IOException | ||
{ | ||
String inBase = new File(args[0]).getPath(); | ||
String sifNameWOExtension = args[1]; | ||
String outBase = new File(args[2]).getPath(); | ||
String jsonName = args.length > 3 ? args[3] : "causative.json"; | ||
|
||
generate(inBase, inBase, sifNameWOExtension, outBase, jsonName); | ||
} | ||
|
||
private static void generate(String inBase, String inDir, String sifName, String outBase, String jsonName) throws IOException | ||
{ | ||
String sifPath = inDir + File.separator + sifName + ".sif"; | ||
String formatPath = inDir + File.separator + sifName + ".format"; | ||
|
||
if (Files.exists(Paths.get(sifPath)) && Files.exists(Paths.get(formatPath))) | ||
{ | ||
String outDir = inDir.replace(inBase, outBase); | ||
Files.createDirectories(Paths.get(outDir)); | ||
|
||
GraphWriter.convertSIFToJSON(sifPath, formatPath, outDir + File.separator + jsonName); | ||
} | ||
|
||
for (File sub : new File(inDir).listFiles()) | ||
{ | ||
if (sub.isDirectory()) generate(inBase, sub.getPath(), sifName, outBase, jsonName); | ||
} | ||
} | ||
} |
Binary file not shown.