Wrapper for an ordered array of BCCodons, either DNA- or RNA-based
Declared In: BCSequenceCodon.h
A subclass of BCSequence, this class handles access to an ordered list of BCCodons. In addition to the usual BCSequence objects, it contains references to the genetic code used to generate the BCSequenceCodon, and the reading frame as a string (ie - +1, -2). Typically, BCCodonSequences are not created directly, but via the BCUtilTranslator class methods.
converts a range in the codon sequence to the equivalent range in the coding sequence
- (NSRange) convertRangeToOriginalSequence: (NSRange)entry;
in many cases, the ranges of locations in a codon sequence (ie - ORF locations) need to be located in the coding sequence of DNA or RNA bases. This method should allow the ranges generated by methods in this class to be converted to the equivalent ranges for use with BCSequence or RNA classes. The method accounts for reading frame.
nitializes a BCSequenceCodon object by passing it an array of BCCodon objects
- (id)initWithCodonArray:(NSArray *)anArray;
Scans the provided array for BCSequenceCodons and adds them to the resulting sequence. If the first codon is RNA, it will assume a BCUnversalCodeRNA origin, otherwise the DNA version. The reading frame is assumed to be +1.
Designated class initializer. Arguments should be self explanatory.
- (id)initWithCodonArray:(NSArray *)anArray geneticCode: (BCGeneticCodeName)codeType frame: (NSString *)theFrame;
This is the designated initializer: other initializers call this method. The designated initializer is thus different from the superclass. It calls the designated initializer for the superclass.
initializes a BCSequenceCodon object by passing it an NSString.
- (id)initWithString:(NSString *)aString skippingUnknownSymbols:(BOOL)skipFlag;
The implementation overrides the superclass. If skipFlag is YES, any character that cannot be converted to a BCNucleotideDNA object is eliminated from the final symbolArray. Otherwise, they are replaced by "undefined" symbols. As codons cannot be easily represented as single characters, this method attempts to determine if the sequence is likely to be RNA (no T's, U's present), and creates a BCSequenceRNA from it if so. If not, it creates a BCSequence. Once a sequence is made, it sends it for translation, and the returned codon array is sent to the designated initializer 'initWithCodonArray:geneticCode:frame:'
returns the longest stretch of codons that don't code for a stop or undefined aa.
- (NSRange) longestOpenReadingFrame;
returns the longest stretch of codons that starts with (codon) and doesn't contain a stop or undefined aa.
- (NSRange) longestOpenReadingFrameUsingStartCodon: (id)codon;
the start codon argument can be provided as a single BCCodon or as an array of codons, for situations/sepcies where there is more than one start codon.
returns all open reading frames longer than the supplied cutoff
- (NSArray *) openReadingFramesLongerThanCutoff: (unsigned int)cutoff;
The return array contains NSValues, coding for NSRanges. if no open reading frames are found, it will return an empty array. Note the BioCocoa provides a method in BCUtilValueAdditions that allows the sorting of these values based on the range length.
behaves identically to "openReadingFramesLongerThanCutoff:", but requires a start codon to initiate the ORF
- (NSArray *) openReadingFramesLongerThanCutoff: (unsigned int)cutoff usingStartCodon: (id)codon;
returns the reading frame ("+2", "-1", etc.) used to generate the codon sequence
- (NSString *)readingFrame;
creates and returns an autoreleased BCSequenceCodon object initialized with the codon array passed as argument
+ (BCSequenceCodon *)sequenceWithCodonArray:(NSArray *)anArray;
provides a protein sequence code for by the sub-sequence of codons within theRange
- (BCSequence *) translationOfRange: (NSRange) theRange;
This method will terminate short of the end of theRange if a stop codon or an undefined codon is encountered
behaves identically to "translationOfRange:" but requires a start codon to initiate translation
- (BCSequence *) translationOfRange: (NSRange) theRange usingStartCodon: (id)codon;
provides an array of BCSequences encoded by the receiver which are longer than cutoff
- (NSArray *) translationsLongerThanCutoff: (unsigned int)cutoff;
behaves identically to "translationsLongerThanCutoff:", but requires a start codon to initiate translation
- (NSArray *) translationsLongerThanCutoff: (unsigned int)cutoff usingStartCodon: (id)codon;
returns the genetic code used to generate the codon sequence
- (BCGeneticCodeName) usedCode;
© 2008 The BioCocoa Project.
Last Updated: Wednesday, October 01, 2008