[Biojava-l] Strang change of Location class

david de beule daviddebeule at pandora.be
Wed Nov 26 16:00:48 EST 2003


Hi,

This piece of code:

  //making a sequence
  Alphabet dna = DNATools.getDNA();
  SymbolTokenization dnaToke = dna.getTokenization("token");
  SymbolList seq0 = new SimpleSymbolList(dnaToke, "ACTGGACCTAAGG");
  Sequence sequence0 = new SimpleSequence(seq0, "test", "test", null);

  //adding a feature with a between location
  StrandedFeature.Template templ = new StrandedFeature.Template(); 
  templ.annotation = Annotation.EMPTY_ANNOTATION;
  templ.location = new BetweenLocation(new RangeLocation(7,8));
  templ.source = "my feature";
  templ.strand = StrandedFeature.POSITIVE;
  templ.type = "interesting motif";
  sequence0.createFeature(templ);

  Iterator iter = sequence0.features();
  while (iter.hasNext()) {
      Feature feature = (Feature)iter.next();
      Location location = feature.getLocation();
      System.out.println("orginal feature location: " + location.getClass()); 
  }

  //converting to a simplegappedsequence
  SimpleGappedSequence _sequence = new SimpleGappedSequence(sequence0);

  iter = _sequence.features();
  while (iter.hasNext()) {
      Feature feature = (Feature)iter.next();
      Location location = feature.getLocation();
      System.out.println("new feature location: " + location.getClass()); 
  }

Gives me the following output:

orginal feature location class org.biojava.bio.symbol.BetweenLocation
new feature location: class org.biojava.bio.symbol.RangeLocation

Why is the feature location changed from BetweenLocation to RangeLocation during the conversion ??

Any help would be appreciated,

David De Beule

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://portal.open-bio.org/pipermail/biojava-l/attachments/20031126/9f3d2d9f/attachment-0001.htm


More information about the Biojava-l mailing list