-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
Francesco Palozzi edited this page Jun 6, 2026
·
1 revision
The library is organized into three layers: controllers (entry points), model (domain objects and logic), and utilities.
controller/
IOController ← file loading and saving (Singleton)
TranslatorController ← format translation (Singleton)
model/
rnafile/
RNAFile ← representation of a loaded RNA file
RNAFormat ← enum of supported formats
RNAFileConstructor ← builds an RNAFile from disk (Singleton, ANTLR)
RNAFileTranslator ← translation logic between formats (static methods)
RNAInputFileParserException ← parsing exception (unchecked)
rnastructure/
RNASecondaryStructure ← secondary structure model
WeakBond ← index pair representing a bond
NonCanonicalEdgeFamily ← non-canonical edge family
NonCanonicalEdgeFamilyValues ← allowed values for edge families
utils/
Region ← region used in the pseudoknot algorithm
RNAStatisticsCalculator ← structure statistics (static methods)
The main entry point for I/O operations.
| Method | Description |
|---|---|
loadFile(Path) |
Parse and register a single file |
loadDirectory(Path) |
Parse and register all files in a directory |
getRNAFileOf(Path) |
Parse without registering |
saveFiles(...) |
Write files to disk, optionally with stats and ZIP |
getLoadedRNAFiles() |
Return an unmodifiable list of loaded files |
deleteFile(RNAFile) |
Remove a single file from the managed list |
clearAllDataStructures() |
Reset the controller state |
getRecognizedFormat() |
Return the current session's format |
Handles format conversion.
| Method | Description |
|---|---|
translate(RNAFile, RNAFormat) |
Translate a file to the target format |
getAvailableTranslations(RNAFormat) |
List compatible target formats |
Immutable representation of a parsed file. Key getters:
| Method | Returns |
|---|---|
getFormat() |
RNAFormat |
getFileName() |
Original file name |
getContent() |
List<String> — raw lines |
getStructure() |
RNASecondaryStructure |
| Method | Returns |
|---|---|
getSize() |
Number of nucleotides |
getSequence() |
Nucleotide sequence string |
isPseudoknotted() |
boolean |
getWeakBonds() |
List<WeakBond> |
-
Singletons are stateful.
IOControllerholds the list of loaded files and the recognized format. Always callclearAllDataStructures()between sessions with different formats. - ANTLR4 parsing. Format detection happens at parse time from file content, not from the file extension.
-
Translation returns new objects.
translator.translate(...)never mutates the sourceRNAFile. - 1-based indexing. All position indices start at 1, both internally and in all file formats.
RNA2DFormatIO – Copyright © 2026 Francesco Palozzi.
University of Camerino – Licensed under the Apache License, Version 2.0.