[Biojava-l] Using REstriction Mapper

ashish mittal mittalashr at yahoo.com
Tue Nov 28 04:54:35 UTC 2006


Hi all, 

I am trying to use restriction mapper to search for a list of resctriction enzymes in a given sequence. Can some one send me some sample code that does the same. I tried following and this code gives exception: 
Exception in thread "main" java.lang.NoClassDefFoundError: org/biojava/utils/bytecode/CodeException
        at org.biojava.bio.seq.FeatureFilter$OnlyChildren.<clinit>(FeatureFilter.java:1270)
        at org.biojava.bio.seq.FeatureFilter.<clinit>(FeatureFilter.java:1813)
        at org.biojava.bio.seq.SimpleFeatureHolder.<init>(SimpleFeatureHolder.java:52)
        at org.biojava.bio.seq.impl.ViewSequence.<init>(ViewSequence.java:116)
        at org.biojava.bio.seq.impl.ViewSequence.<init>(ViewSequence.java:143)
        at org.biojava.bio.molbio.RestrictionMapper.annotate(RestrictionMapper.java:115)
        at seed.rs.rsTry.Searcher.search(Searcher.java:91)
        at seed.rs.rsTry.Searcher.main(Searcher.java:101)


CODE: 

public class Searcher {
    
    ThreadPool tPool = new ThreadPool() {
        public void addRequest(Runnable runnable) {
        }
        public void startThreads() {
        }
        public void stopThreads() {
        }
        public void waitForThreads() {
        }
    };
    
    RestrictionMapper mapper = new RestrictionMapper(tPool);
    
    
    
    /** Creates a new instance of Searcher */
    public Searcher() {
    }
    
    public void search(){
    
        
        try {
            RestrictionEnzyme res1 = new RestrictionEnzyme("enz1",DNATools.createDNA("agtg"),0,0);
            RestrictionEnzyme res2 = new RestrictionEnzyme("enz2",DNATools.createDNA("gatt"),0,0);
            RestrictionEnzyme res3 = new RestrictionEnzyme("enz3",DNATools.createDNA("gatg"),0,0);
            
            mapper.addEnzyme(res1);
            mapper.addEnzyme(res2);
            mapper.addEnzyme(res3);
            
        RestrictionEnzymeManager.register(res1,new TreeSet());
        RestrictionEnzymeManager.register(res2,new TreeSet());
        RestrictionEnzymeManager.register(res3,new TreeSet());
      
            
        } catch (IllegalSymbolException ex) {
            ex.printStackTrace();
        } catch (IllegalAlphabetException ex) {
            ex.printStackTrace();
        }
        
        //RestrictionEnzymeManager  resManager = new RestrictionEnzymeManager();
        
        try {
            
            Sequence dnaSeq = DNATools.createDNASequence("agtgattcgtatcgattcggatggtcattttt","my_dnaseq");
            Sequence newSeq = mapper.annotate(dnaSeq);
            
        } catch (IllegalSymbolException ex) {
            ex.printStackTrace();
        }
    }
    
    public static void main (String args[])
    {
        Searcher searcherObj = new Searcher();
        searcherObj.search();
    }
}



Thanks in Advance. 
Ashish 





 
____________________________________________________________________________________
Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited



More information about the Biojava-l mailing list