-
Notifications
You must be signed in to change notification settings - Fork 0
Auto detection
When no ToolType is provided, RnaUnifier delegates to ParserFactory.detectTool(). This method peeks at the first 4 096 bytes of the stream and applies the following heuristics in priority order:
| Priority | Signal | Detected tool |
|---|---|---|
| 1 | Contains BEGIN_base-pair
|
RNAVIEW |
| 2 | Contains Residue conformations
|
MCANNOTATE |
| 3 | Contains > and seq
|
RNAPOLIS |
| 4 | JSON with key "annotations"
|
FR3D |
| 5 | JSON with key "pairs"
|
X3DNA |
| 6 | Lines matching N_INT_INT N_INT_INT XXc pattern |
BARNABA |
| 7 | Lines with ? separator and W:WC-style tokens |
BPNET |
If no signature matches, an IllegalArgumentException is thrown.
The InputStream passed to detectTool (or to any auto-detecting process overload) must support mark()/reset(). A BufferedInputStream always satisfies this requirement.
If you are passing a raw FileInputStream, wrap it first:
try (BufferedInputStream bis = new BufferedInputStream(new FileInputStream(myFile))) {
String result = unifier.process(bis, true);
}Note:
RnaUnifier.process(File, boolean)wraps the file internally, so you do not need to do this manually when passing aFileobject.
← Output Formats | Next: Logging →
RNA2DUnifier – Copyright © 2026 Francesco Palozzi.
University of Camerino – Licensed under the Apache License, Version 2.0.