-
Notifications
You must be signed in to change notification settings - Fork 0
Saving files
Use IOController.saveFiles(...) to write RNAFile objects to disk. The method accepts any List<RNAFile> — files do not need to have been loaded through the controller.
io.saveFiles(
files, // List<RNAFile> to save
Path.of("/output/"), // destination directory
true, // generate non-canonical pairs CSV?
true, // generate statistics CSV?
"results" // ZIP archive name (null or "" to skip)
);| Parameter | Type | Description |
|---|---|---|
files |
List<RNAFile> |
Files to write |
outputDir |
Path |
Destination directory |
generateNonCanonicalPairs |
boolean |
Produce _nc.csv files |
generateStatistics |
boolean |
Produce _seqInfo.csv files |
zipFileName |
String |
Archive name; blank/null to skip |
Each saved file is named:
<original_name_without_extension>.<format_extension>.txt
Example: structure.bpseq translated to DB → structure.db.txt
When generateStatistics is true, a CSV with these columns is produced for each file:
Nucleotide count, Bond count, A count, C count, G count, U count, GC bonds, AU bonds, GU bonds
Statistics requiring the nucleotide sequence return
0forDB NO SEQUENCE,AAS NO SEQUENCE, andFASTA.
When generateNonCanonicalPairs is true, CSV files listing detected non-canonical pairs are produced. These files are generated by an external component in the current working directory (user.dir) — ensure it is writable.
When zipFileName is non-blank, all generated files (translated files + CSVs) are compressed into a single ZIP archive and the intermediate files are deleted.
List<RNAFile> translated = io.getLoadedRNAFiles().stream()
.map(f -> translator.translate(f, RNAFormat.DB))
.toList();
io.saveFiles(translated, Path.of("/output/"), false, true, "output_db");RNA2DFormatIO – Copyright © 2026 Francesco Palozzi.
University of Camerino – Licensed under the Apache License, Version 2.0.