[Biojava-l] error using the proteomic package

Roger Moraga bioram1976 at yahoo.com
Wed Jun 25 09:38:48 EDT 2003


I've put together this in 2 minutes, but it works,
check it out:

import java.io.*;
import java.util.*;
import org.biojava.bio.*;
import org.biojava.bio.seq.io.*;
import org.biojava.bio.symbol.*;
import org.biojava.bio.proteomics.*;
import org.biojava.bio.seq.*;
import org.biojava.bio.symbol.*;
import
org.biojava.bio.symbol.SymbolList.EmptySymbolList;
import org.biojava.bio.symbol.SimpleAtomicSymbol;
import org.biojava.bio.seq.ProteinTools.*;
import org.biojava.bio.seq.impl.*;


public class Seq {
  public static void main (String args[]) {

    try {
      Protease pp = new Protease("RK", true, "P");
      ProteinTools protT= new ProteinTools();

      SymbolList myProt=
protT.createProtein("MAADSIPLKREDTMEALIEWLIPKKEDDGHGKLE");
      SimpleSequence s = new SimpleSequence( myProt, 
                                             ":P",
                                             "Test
Protein",
                                             new
Annotation.EmptyAnnotation());
    
      Digest digest = new Digest();
    
      digest.setSequence(s);
      digest.setProtese(pp);
      digest.setMaxMissedCleavages(1);
      digest.addDigestFeatures();
    
      Iterator it = s.features();
    
      while (it.hasNext()) {
      
        SimpleFeature sf = (SimpleFeature) it.next();
        SymbolList ss = sf.getSymbols();

        // ^^ That looks needlessly messy, doesn't it.
      
        double mass = 0;
        SymbolPropertyTable st= 
         
ProteinTools.getSymbolPropertyTable("MONO_MASS");
        Alphabet as=ProteinTools.getAlphabet();
        MassCalc mc= new MassCalc(st.MONO_MASS, true);

        mass=mc.getMass(ss,st.MONO_MASS,true);
        System.out.println(ss.seqString() + " " +
mass);
      }
    }
    catch (Exception e){
      e.printStackTrace();
    }
  }
}



--- Robert Stones <r.stones at csl.gov.uk> wrote:
> I keep getting this error using the proteomic
> package when performing
> simulated digests on proteins and some peptides with
> masses are not
> being generated:
> 
> Has anybody got an example code for setting
> proteases and working out
> masses?  
> 
> org.biojava.bio.symbol.IllegalSymbolException: No
> mass Set for Symbol
> [GLU SER GLY PHE LEU PRO ALA VAL ASN SEC HIS MET THR
> TYR ARG ILE LYS GLN
> TRP CYS ASP]
> at
>
org.biojava.bio.proteomics.MassCalc.getVMasses(MassCalc.java:365)
> 
> my code
> 
> 	try
> 	{
> 	seq = si.nextSequence(); 	
> 	Annotation anno = seq.getAnnotation();
> 				
> 	it = seq.features(); 
> 	}//try 
> 	catch (BioException bex)
> 	{
> 	System.out.println(bex);
> 	}
> 		
> 	while ( it.hasNext() ) 
> 	{
> 	Feature f = (Feature) it.next();
> 
> 		if (f.getType().equals("Peptide"))
> 		{
> 			try
> 			{
> 			MassCalc  massCalc = new
> MassCalc(SymbolPropertyTable.MONO_MASS,
> true);
> 			double[] masses =
> massCalc.getVariableMasses(f.getSymbols());
> 			double mass = masses[0];
> 			}//try
>             
> 				
> 			catch(Exception is)
> 			{				
> 			is.printStackTrace();
> 			}
> 		}
> 	}	
> 
> biojava-l-request at biojava.org wrote:


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com


More information about the Biojava-l mailing list