Skip to content

Latest commit

 

History

History
58 lines (45 loc) · 2.17 KB

File metadata and controls

58 lines (45 loc) · 2.17 KB
title BioJava:CookBookItaliano:Alphabets
permalink wiki/BioJava%3ACookBookItaliano%3AAlphabets

Come posso ottenere l'alfabeto del DNA, dell'RNA o Proteico?

In BioJava gli Alfabeti sono collezioni di Simboli. I più comuni alfabeti biologici (DNA, RNA, protein, etc) sono memorizzati tramite il BioJava AlphabetManager all'avvio e vi si può accedere tramite il nome.

The DNA, RNA and protein alphabets can also be accessed using convenient static methods from DNATools, RNATools and ProteinTools respectively.

Both of these approaches are shown in the example below

org.biojava.bio.seq.\*;

public class AlphabetExample {

` public static void main(String[] args) {`  
`   Alphabet dnarnaprotproteinterm ;`

`   //get the DNA alphabet by name`  
`   dna = AlphabetManager.alphabetForName("DNA");`

`   //get the RNA alphabet by name`  
`   rna = AlphabetManager.alphabetForName("RNA");`

`   //get the Protein alphabet by name`  
`   prot = AlphabetManager.alphabetForName("PROTEIN");`  
`   //get the protein alphabet that includes the * termination Symbol`  
`   prot = AlphabetManager.alphabetForName("PROTEIN-TERM");`

`   //get those same Alphabets from the Tools classes`  
`   dna = DNATools.getDNA();`  
`   rna = RNATools.getRNA();`  
`   prot = ProteinTools.getAlphabet();`  
`   //or the one with the * symbol`  
`   proteinterm  = ProteinTools.getTAlphabet();`

` }`

} ```