BioJava Cookbook for release 3.*
BioJava 3 is a major re-write of BioJava 1. As such many things work differently. This cookbook provides examples how to work with the new codebase.
The page was inspired by various programming cookbooks and follows a "How do I...?" type approach. Each "How do I?" is linked to some example code that does what you want and sometimes more. Basically if you find the code you want and copy and paste it into your program you should be up and running quickly. I have endeavoured to over document the code to make it more obvious what I am doing so some of the code might look a bit bloated.
If you re-use code from the cookbook please cite:
BioJava: an Open-Source Framework for Bioinformatics
R.C.G. Holland; T. Down; M. Pocock; A. Prlić; D. Huen; K. James; S. Foisy; A. Dräger; A. Yates; M. Heuer; M.J. Schreiber
Bioinformatics 2008; doi: 10.1093/bioinformatics/btn397
How Do I....?
- Overview of biojava3-core?
- How are sequences created?
- How do I read or write Fasta files?
- How do I view Features on a sequence?
- How do I convert Profile object into Multiple Sequence Alignment object to be use in the TreeConstructor
Required modules: biojava3-core Required external library: forester.jar
Required modules: biojava3-alignment, biojava3-core, biojava3-phylo Required external library: forester.jar
- How can I calculate a Pairwise Sequence Alignment? (Smith Waterman, Needleman Wunsch)
- How can I calculate a Pairwise Sequence Alignment with DNA sequences?
- How can I create a Multiple Sequence Alignment?
- How can I profile the time and memory requirements of a Multiple Sequence Alignment?
Required modules: biojava3-structure, biojava3-alignment Optional module : biojava3-structure-gui for the 3D visualisation Optional external library : JmolApplet.jar for the 3D visualisation
- How can I parse a PDB file?
- How can I parse a .mmcif file?
- How can I access the atoms in a structure?
- How can I do calculations on atoms?
- How to work with Groups (AminoAcid, Nucleotide, Hetatom)?
- How can I access the header information of a PDB file?
- How does BioJava deal with SEQRES and ATOM groups?
- How can I mutate a residue?
- How can I calculate a structure alignment?
- How can I use a simple GUI to calculate an alignment?
- How can I interact with Jmol?
- How can I serialize to a database?
- How can I load data from the SCOP classification?
- How can I find residues binding a ligand?
Physico-Chemical Properties Computation
Required modules: biojava3-aa-prop, biojava3-structure and biojava3-core
- How can I compute physico-chemical properties via APIs?
- How can I compute physico-chemical properties using Command Prompt?
- How can I compute PROFEAT properties via APIs?
- How can I predict disordered regions of the protein using its sequence?
- Can I use the predictor from the command line?
Protein Modification Identification
Required modules: biojava3-modfinder, biojava-structure
- How can I identify protein modifications in a 3D struture?
- How can I get the list of supported protein modifications?
- How can I define and register a new protein modification?
Required modules: biojava3-core, biojava-ws
- How can I use NCBI's QBlast service ?
- How can I get Pfam annotations for a protein sequence using the Hmmer3 service?
Legacy 1.7 CookBook
The CookBook for the legacy 1.X code base is available from BioJava:CookBook1.7.