Skip to content

Structure statistics

Francesco Palozzi edited this page Jun 6, 2026 · 1 revision

Structure Statistics

The RNAStatisticsCalculator class exposes static methods to analyze an RNAFile. Import them statically for concise usage:

import static it.unicam.cs.bdslab.rna2dformatIO.tarnas.model.utils.RNAStatisticsCalculator.*;

Available Methods

Method Returns Requires sequence?
getNucleotideCount(file) Total number of nucleotides
getBondCount(file) Total number of weak bonds
getACount(file) Count of adenine (A) bases
getCCount(file) Count of cytosine (C) bases
getGCount(file) Count of guanine (G) bases
getUCount(file) Count of uracil (U) bases
getGcBonds(file) Number of G-C bonds
getAuBonds(file) Number of A-U bonds
getGuBonds(file) Number of G-U bonds

Usage Example

RNAFile file = io.loadFile(Path.of("structure.bpseq"));
 
System.out.println("Total nucleotides : " + getNucleotideCount(file));
System.out.println("Total bonds       : " + getBondCount(file));
System.out.println("GC bonds          : " + getGcBonds(file));
System.out.println("AU bonds          : " + getAuBonds(file));
System.out.println("GU bonds          : " + getGuBonds(file));
System.out.println("A count           : " + getACount(file));
System.out.println("C count           : " + getCCount(file));
System.out.println("G count           : " + getGCount(file));
System.out.println("U count           : " + getUCount(file));

Limitations

Methods that require the nucleotide sequence return 0 when the format does not carry one:

Format Sequence-dependent methods
DB_NO_SEQUENCE Return 0
AAS_NO_SEQUENCE Return 0
FASTA Return 0 (no bond data either)

Statistics CSVs generated via saveFiles use these same methods and will contain 0 for the affected columns.


See Also

Clone this wiki locally