Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.biojava.bio.seq
Interface Sequence

All Superinterfaces:
  Annotatable, Changeable, FeatureHolder, SymbolList

All Known Subinterfaces:
  GappedSequence, RichSequence

All Known Implementing Classes:
  CircularView, DummySequence, NewSimpleAssembly, PhredSequence, RevCompSequence, SimpleAssembly, SimpleGappedSequence, SimpleRichSequence, SimpleSequence, SubSequence, ThinRichSequence, ViewSequence

    public interface Sequence

extends SymbolList, FeatureHolder, Annotatable

A biological sequence.

## Instantiation

     Sequence myDNA = DNATools.createDNASequence("ATTATTCGTG", "mySeq");
     Sequence myFasta = SeqIOTools.readFastaProtein("mySeq.fa");
     Sequence myGenbank = SeqIOTools.readGenbank("mySeq.gb");

## Common operations

     System.out.println("Length: " + myGenbank.length());
     System.out.println("Features: " + myGenbank.countFeatures());
     for(Iterator fi = myGenbank.features(); fi.hasNext(); ) {
       Feature f = (Feature) fi.next();
       System.out.println(f.getType() + "\t" + f.getLocation());
     }

     // create a new feature on a sequence
     StrandedFeature.Template ft = new StrandedFeature.Template();
     ft.type = "span";
     ft.location = new RangeLocation(230, 450);
     ft.source = "hand_made";
     ft.strand = StrandedFeature.NEGATIVE;

     StrandedFeature newSpan = (StrandedFeature) mySeq.createFeature(ft);

## Description

This interface is a symbol list, so it contains symbols. It is annotatable so that you can add annotation to it, and it is a FeatureHolder so that you can add information about specific regions.

It is expected that there may be several implementations of this interface, each of which may be fairly heavy-weight. It takes the SymbolList interface that is nice mathematically, and turns it into a biologically useful object.

The `RichSequence` interface offers considerably more functionality and better persitence to BioSQL than it's super interface Sequence. We would recommend using it wherever possible.

Author:
  Matthew Pocock, Thomas Down
See Also:
  `RichSequence`

Nested Class Summary

Nested classes/interfaces inherited from interface org.biojava.bio.seq.FeatureHolder
`FeatureHolder.EmptyFeatureHolder`

Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable
`Annotatable.AnnotationForwarder`

Field Summary

Fields inherited from interface org.biojava.bio.symbol.SymbolList
`EDIT, EMPTY_LIST`

Fields inherited from interface org.biojava.bio.seq.FeatureHolder
`EMPTY_FEATURE_HOLDER, FEATURES, SCHEMA`

Fields inherited from interface org.biojava.bio.Annotatable
`ANNOTATION`

Method Summary
`String` | `getName()` The name of this sequence.
`String` | `getURN()` A Uniform Resource Identifier (URI) which identifies the sequence represented by this object.

Methods inherited from interface org.biojava.bio.symbol.SymbolList
`edit, getAlphabet, iterator, length, seqString, subList, subStr, symbolAt, toList`

Methods inherited from interface org.biojava.utils.Changeable
`addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener`

Methods inherited from interface org.biojava.bio.seq.FeatureHolder
`containsFeature, countFeatures, createFeature, features, filter, filter, getSchema, removeFeature`

Methods inherited from interface org.biojava.utils.Changeable
`addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener`

Methods inherited from interface org.biojava.bio.Annotatable
`getAnnotation`

Methods inherited from interface org.biojava.utils.Changeable
`addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener`

Method Detail

### getURN

    String getURN()

  A Uniform Resource Identifier (URI) which identifies the sequence represented by this object. For sequences in well-known database, this may be a URN, e.g.

       urn:sequence/embl:AL121903

  It may also be a URL identifying a specific resource, either locally or over the network

       file:///home/thomas/myseq.fa|seq22
       http://www.mysequences.net/chr22.seq

  Returns:
    the URI as a String

### getName

    String getName()

  The name of this sequence.

  The name may contain spaces or odd characters.

  Returns:
    the name as a String

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD