java – Calculating physico-chemical properties of amino acids in Biojava

I need to calculate the number and percentages of polar/non-polar, aliphatic/aromatic/heterocyclic amino acids in this protein sequence that I got from UNIPROT, using BioJava.

I have found in the BioJava tutorial how to read the Fasta files and implemented this code. But I have no ideas how to solve this problem.

If you have some ideas please help me.

Maybe there are some sources where I can check it.

This is the code.

package biojava.biojava_project;


import org.biojava.nbio.core.sequence.ProteinSequence;

public class BioSeq {
    // Inserting the sequence from UNIPROT
    public static ProteinSequence getSequenceForId(String uniProtId) throws Exception {
        URL uniprotFasta = new URL(String.format("", uniProtId));
        ProteinSequence seq = FastaReaderHelper.readFastaProteinSequence(uniprotFasta.openStream()).get(uniProtId);
        System.out.printf("id : P31574", uniProtId, seq, System.getProperty("line.separator"), seq.getOriginalHeader());
        return seq;
    public static void main(String[] args) {
        try {
        } catch (Exception e) {

Read more here: Source link