Assembly: BioSharp.Core (in BioSharp.Core.dll) Version: 0.1.3191.26120 (0.1.0.0)
Syntax
C# |
---|
public interface ISequence : ISymbolList, IFeatureHolder, IAnnotatable, IChangeable |
Remarks
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 (TODO: org.biojavax.bio.seq.RichSequence RichSequence) interface offers considerably more functionality and better persitence to BioSQL than it's super interface Sequence. We would recommend using it wherever possible.
Instantiation examples:
ISequence myDNA = DNATools.CreateDNASequence("ATTATTCGTG", "mySeq");
ISequence myFasta = SeqIOTools.ReadFastaProtein("mySeq.fa");
ISequence myGenbank = SeqIOTools.ReadGenbank("mySeq.gb");
Examples of some common operations:
// TODO - Doug - 9-Sep-2008 - fix up these examples
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);
Original BioJava version by Matthew Pocock and Thomas Down. Port to C# by Doug Swisher.