export http_proxy=proxy.mySite.com:888 alias java="java -Dhttp.proxyHost=proxy.mySite.com -Dhttp.proxyPort=888 "
# Specify the program you use to fetch files from Internet DOWNLOAD="wget -N" wget --version || DOWNLOAD="curl -O" # The path separator character is usually a colon PATHSEP=":" if [[ "$OSTYPE" == cygwin ]]; then PATHSEP=";"; fi # Create a test Directory mkdir $HOME/testSTRAP_Scripting cd $HOME/testSTRAP_Scripting # Fetch the examples and the strap.jar. Alternatively take the browser $DOWNLOAD http://www.charite.de/bioinf/strap/strapScript/allExamples.jar $DOWNLOAD http://www.charite.de/bioinf/strap/strap.jar # Extract the zipped archive, which contains the examples jar -xf allExamples.jar # Adjust classpath export CLASSPATH=.$PATHSEP"strap.jar"$PATHSEP$(echo biojava-live/*.jar | tr ' ' "$PATHSEP")$PATHSEP
javac DemoProtein_aminoAcids.java; java DemoProtein_aminoAcids javac DemoPrintSequence.java; java DemoPrintSequence a1_SaccharomycesCerevisiae.pdb javac DemoProteinParser2.java; java DemoProteinParser2 hs_EscherichiaColi.pdb javac DemoProteinWriter.java; java DemoProteinWriter
javac DemoSequenceBlaster.java; java DemoSequenceBlaster javac DemoPrediction.java; java DemoPrediction
javac DemoProtein_userObjects.java; java DemoProtein_userObjects
javac DemoResidueSubset.java; java DemoResidueSubset hs_EscherichiaColi.pdb javac DemoResidueSubset2.java; java DemoResidueSubset2 hs_EscherichiaColi.pdb
javac DemoProtein_gaps.java; java DemoProtein_gaps javac DemoProtein_gaps_advanced.java; java DemoProtein_gaps_advanced javac DemoSequenceAligner1.java; java DemoSequenceAligner1 javac DemoAlignmentWriter.java; java DemoAlignmentWriter
javac DemoDrawGappedSequence.java; java DemoDrawGappedSequence
javac DemoProtein_nucleotides.java; java DemoProtein_nucleotides javac DemoProtein_nucleotides_advanced.java; java DemoProtein_nucleotides_advanced
javac DemoResidueAnnotation.java; java DemoResidueAnnotation javac DemoResidueAnnotation_NT.java; java DemoResidueAnnotation_NT
javac DemoSuperimpose1.java; java DemoSuperimpose1 a1_SaccharomycesCerevisiae.pdb hs_EscherichiaColi.pdb javac DemoViewProteinBackbone.java; java DemoViewProteinBackbone hs_EscherichiaColi.pdb
java charite.christo.J_JavaEditor DemoViewProteinBackbone.java &
A SequenceAligner aligns two or more sequences automatically.
DemoSequenceAligner1.java aligns two sequences.
The two sequences are given as java.lang.String objects.
The computed alignment is provided as String array containing the gapped sequences.
A SequenceBlaster runs the program BLAST. which is an algorithm for comparing biological sequences. Given a collection of sequences, a BLAST search enables a researcher to look for sequences that resemble a given sequence of interest. The query sequence is provided as a String object.
DemoSequenceBlaster.java identifies all sequences in the PDB-Seq database that are similar to a given amino acid sequence. The result is an XML text. The XML text is transformed into a structure by BlastParser . This structure is then written in the human readable form. Web-BLAST takes some time to compute. To avoid repeated BLAST runs with the same query a cache is maintained.
A SecondaryStructure_Predictor predicts the secondary structure from amino acid sequences. It takes the query sequence from a String. Some Web-services process many amino-acid sequences at once. Rather than contacting the server several times one server job is submitted with many sequences. Therefore the class takes not a sequence in form of a String but several sequences in form of a string array using the method SecondaryStructure_Predictor#setGappedSequences(java.lang.String) . Two other interfaces are used in the same way like SecondaryStructure_Predictor: TransmembraneHelix_Predictor and CoiledCoil_Predictor
DemoPrediction.java shows how the secondary structure can be predicted from an amino-acid sequences. The secondary structure is obtained with the method getPrediction() which returns a characer array for each input sequence. The characer 'H' denotes helical residues whereas 'E' stands for extended or sheets.
StrapProtein is the basic class for proteins. The contained sequence might contain gaps. 3D-information of the protein structure may be contained as well.
shows how a protein object is created with StrapProtein#newInstance(File)
The amino acid sequence is set by StrapProtein#setResidueType(String)
the amino acid sequence is retrieved with StrapProtein#getResidueTypeAsString()
DemoProtein_nucleotides.java shows how an amino acid sequence can also be defined indirectly by its coding nucleotide sequence using StrapProtein#setNucleotides(String,String) .
DemoProtein_gaps.java shows how gapped sequences can be created by inserting white space into the amino acid sequence. Several methods exist to define the gaps.
DemoProtein_userObjects.java: If your application requires data fields not yet existing in StrapProtein you can associate data with protein Objects. This is resembles JComponent#putClientProperty(Object,Object) and JComponent#getClientProperty(Object) .
DemoResidueSubset.java shows how a subset of residues (range of amino acid positions) can be extracted from a protein. As an example, you might be interested in the protein without the leading signal sequence.
DemoProtein_gaps_advanced.java shows some advanced methods concerned with gaps in sequences.
DemoProtein_nucleotides_advanced.java shows some advanced methods concerned with nucleotides and translation into amino acids.
DemoResidueSubset2.java shows how an expression denoting a ( contiguous or non-contiguous) set of residues is used to define a subset of the protein. The residues are given either by their index (start at 1 !) or by the pdb number and chain. It follows the convention of residue subsets in Rasmol.
A ProteinParser collects information from a text (or text-file) and sets the amino acid sequence and other information in a protein object.
DemoProteinParser1.java shows how
the default protein parsers work. A file name is given at the command line and the protein file is parsed.
For each protein file type a different ProteinParser exists.
All parsers are tried one after the other until one parser recognizes the format.
Using this approach file types like SWISSPROT, EMBL and PDB are recognized automatically.
DemoProteinParser2.java shows how a self-written ProteinParser is designed and used. This is necessary only in rare cases if protein file formats need to be imported that are not yet supported by STRAP.
An AlignmentWriter creates a multiple sequence alignment text from a number of StrapProtein's.
In the example two StrapProtein's are created and written as an alignment in MSF-format.
A ProteinWriter creates a text-file for a protein object.
shows how proteins are written using the class ProteinWriterFasta.
A ProteinViewer is used to display proteins three-dimensionally. The 3D-information is usually given in a PDB-file.
DemoViewProteinBackbone.java creates a StrapProtein from a PDB-file and displays the 3D-structure.
The class DrawGappedSequence has methods to draw a gapped protein sequence graphically. If there are annotated residues they will be be highlighted.
DemoDrawGappedSequence.java creates a StrapProtein by an amino acid sequence, subsequently inserts a gap and defines a residue annotation. The protein sequence is then displayed in a graphical window.
A Superimpose3D aligns two protein backbones three-dimensionally.
superimposes two proteins three-dimensionally. Subsequently the new coordinates are written.
A ResidueAnnotation selects a subset of amino-acids (or nucleotides).
defines a StrapProtein and adds a ResidueAnnotation to this protein.
DemoResidueAnnotation_NT.java defines a StrapProtein from a nucleotide sequence and adds a ResidueAnnotation object to this protein. The example shows that the residue selection can also be defined by nucleotide positions of the coding sequence. An amino-acid is selected if at least one of the three nucleotides of the triplet is selected.
The class ProteinProteinValue returns a value for pairs of proteins. ProteinProteinDistance and ProteinProteinSimilarity are subtypes. For ProteinProteinDistance pairs of similar proteins get small values and dissimilar proteins get large values. This can be used for distance matrices. For ProteinProteinSimilarity the returned value is the larger the more similar the two proteins are.
Example is under construction.
$DOWNLOAD http://www.biojava.org/download/bj16/rc1/all/biojava-all.jar jar -xf biojava-all.jar export CLASSPATH=.$PATHSEP"strap.jar"$PATHSEP$(echo biojava-live/*.jar | tr ' ' "$PATHSEP")$PATHSEPTo run the BioJava-examples copy the following lines into the command shell:
javac DemoBiojavaSequence2StrapProtein.java; java DemoBiojavaSequence2StrapProtein javac DemoStrapProtein2BiojavaSequence.java; java DemoStrapProtein2BiojavaSequenceBioJava is a set of modules and packages for biology, including sequence analysis, database access, and parsers for sequence files. An interface to use STRAP and BioJava together is provided. This is useful because BioJava has methods, which are not contained in STRAP and vice versa More information is found in biojava.html, Secondary structure prediction, Computing sequence alignments and Blast
DemoBiojavaSequence2StrapProtein.java: In this example a BioJava-sequence GappedSequence is created. This BioJava object is then converted into a StrapProtein.
DemoStrapProtein2BiojavaSequence.java creates a StrapProtein object and converts it to a gapped BioJava sequence GappedSequence. The latter is displayed with renderers provided by BioJava.