File: BCUtilStringDNA.h

package info (click to toggle)
biococoa 2.2.2-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,184 kB
  • sloc: objc: 21,348; makefile: 17; ansic: 4
file content (60 lines) | stat: -rw-r--r-- 2,141 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
//  BCUtilStringDNA.h
//
//  Created by John Timmer on Fri Jul 16 2004.
//  Copyright (c) 2004 The BioCocoa Project. All rights reserved.
//

#import <Foundation/Foundation.h>


@interface BCUtilStringDNA : NSObject {

    NSDictionary *baseComplements;
    NSCharacterSet *strictBaseSet;
    NSCharacterSet *normalBaseSet;
    NSCharacterSet *looseBaseSet;
    NSDictionary *basesAndReplacements;
}



//////////////////////////////////////////////////////////////////////////////////
//  A note on usage - 
//  Most of these methods require the use of character sets and dictionaries.
//  To save a bit of energy, we create a single shared instance, so we only make
//  them once.  Use "sharedDNAUtilObject" to get it.
//////////////////////////////////////////////////////////////////////////////////
// creation of this object
- (BCUtilStringDNA *) init;
+ (BCUtilStringDNA *) sharedDNAUtilObject;


//////////////////////////////////////////////////////////////////////////////////
// A note on the strings returned -
// These methods handle differences in case by uppercasing everything, so the 
// string returned will be uppercase.
// This should be an invitation for someone to write a case preserving version!
//////////////////////////////////////////////////////////////////////////////////

// handling the composition of a string in terms of valid DNA characters
// the strict methods allow ATCGN
// the others allow the full spectrum:  ATCGNMKRYWSHVDB
- (BOOL) hasNonDNACharacters: (NSString *)entry;
- (BOOL) hasNonDNACharacters_Strict: (NSString *)entry;
- (NSString *) stripNonDNACharacters: (NSString *)entry;
- (NSString *) stripNonDNACharacters_Strict: (NSString *)entry;

// complementing DNA sequences
- (NSString *) complementOfSequence: (NSString *)entry;
- (NSString *) reverseComplementOfSequence: (NSString *)entry;


// building a list of all possible sequences from a sequence with ambiguous bases
- (NSArray *) getAllSitesForSequence: (NSString *) entry;

// finding ORFs
- (NSRange) findLongestORFInSequence: (NSString *)entry startingWithATG: (BOOL)atgStart inBothDirections: (BOOL)bothDirections;

@end