Class Str

Description

String.php

String class, for biological sequences

  1. $oSeq new Seq("GAGATGGATGTAGATTATTAGTATATG""DnaAlphabet"TRUE);
  2. print $oSeq->getData();
  3. $oSeq->rev();
  4. print $oSeq->getData();

  • author: Mark Brooks
  • version: 0.8.2
  • copyright: 2004-2008 Mark Brooks <markabrooks@users.sourceforge.net>
  • access: public

Located in /Root/Str.php (line 51)

PEAR
   |
   --Bio
      |
      --Str
Direct descendents
Class Description
Seq Seq
Method Summary
static string InTrim_ (string $sStr)
static string Left_ (string $sStr,  $iNumChars, int $numChars)
static void Len_ ([string $sStr = ""])
static array ReMatch_ (string $sNeedle,  $sHayStack, [boolean $bCaseSensitive = TRUE], string $sHaystack)
static array ReReplace_ (string $sNeedle,  $sNewNeedle, boolean $sHayStack, [ $bCaseSensitive = TRUE], string $sHaystack)
static array ReSplit_ (string $sNeedle, string $sHaystack, [boolean $bCaseSensitive = TRUE])
static string Rev_ ([ $sStr = ""], string $Str)
static string Right_ (string $sStr, int $iNumChars)
static void Sub_ ( $sStr,  $iStart, [ $iLength = ""])
static array SymFreq_ (string $sSymbol, string $sStr, [boolean $bCaseSensitive = TRUE])
static string Trim_ ( &$sStr, string $sStr)
object __construct ([string $sStr = ""], [boolean $bIsRev = 0])
void cat (Str $oOther, object Seq $other)
string catStr ( $sOther, string $otherStr)
string CatStr_ ( $sFirst,  $sOther, string $otherStr)
void errorCallBack ( $oError)
string getData ()
bool getIsRev (none 0)
string getRev (none 0)
string inTrim ()
string left (int $iNnumChars, string $sStr)
integer len ()
array reMatch (string $sNeedle, [boolean $bCaseSensitive = TRUE])
string rev (none 0)
string right ( $iNumChars, string $sStr, int $iChars)
void setData ( $sData, string $sStr)
void setIsRev (boolean $bIsRev)
void sub ( $iStart, [ $iLength = ""])
array symFreq (string $sSymbol, [boolean $bCaseSensitive = TRUE])
boolean toggleIsRev (none 0)
string trim ()
string __toString ()
Variables

Inherited Variables

Inherited from Bio

Bio::$bWarnings
Methods
static method InTrim_ (line 469)

function InTrim_

Strips internal whitespace from a sequence

static string InTrim_ (string $sStr)
  • string $sStr

Redefined in descendants as:
static method Left_ (line 577)

function Left_ desc Return the first $numChars characters of a string.

  • return: substring
static string Left_ (string $sStr,  $iNumChars, int $numChars)
  • string $sStr
  • int $numChars: number of chars to return
  • $iNumChars
static method Len_ (line 431)

function Len_

Nothing to do with Coronation Street

  • access: public
static void Len_ ([string $sStr = ""])
  • string $sStr
static method ReMatch_ (line 351)

function ReMatch_

Simple function to search strings. Where is the =~ operator when you need it?

  • return: Matches (or FALSE for no matches)
  • access: public
static array ReMatch_ (string $sNeedle,  $sHayStack, [boolean $bCaseSensitive = TRUE], string $sHaystack)
  • string $sNeedle: String to search for
  • string $sHaystack: String to search in
  • boolean $bCaseSensitive: bCaseSensitive Is the search supposed to be case-sensitive?
  • $sHayStack
static method ReReplace_ (line 380)

ReReplace_

Simple function to search strings. Where is the =~ operator when you need it?

  • return: Matches (or FALSE for no matches)
  • access: public
static array ReReplace_ (string $sNeedle,  $sNewNeedle, boolean $sHayStack, [ $bCaseSensitive = TRUE], string $sHaystack)
  • string $sNeedle: String to search for
  • string $sHaystack: String to search in
  • boolean $sHayStack: bCaseSensitive Is the search supposed to be case-sensitive?
  • $sNewNeedle
  • $bCaseSensitive
static method ReSplit_ (line 403)

function ReSplit_

  • return: Matches (or FALSE for no matches)
  • access: public
  • uses: Simple - function to search strings. Where is the =~ operator when you need it?
static array ReSplit_ (string $sNeedle, string $sHaystack, [boolean $bCaseSensitive = TRUE])
  • string $sNeedle: String to search for
  • string $sHaystack: String to search in
  • boolean $bCaseSensitive: bCaseSensitive
static method Rev_ (line 187)

function Rev_

Reverses sequence of the object, places it in $_revStr (can be used with no Seq instance)

  • access: public
static string Rev_ ([ $sStr = ""], string $Str)
  • string $Str
  • $sStr
static method Right_ (line 596)

function Right

  • return: substring
  • access: public
  • uses: Return - the substring beginning at $numChars characters from the right end of a string.
static string Right_ (string $sStr, int $iNumChars)
  • string $sStr
  • int $iNumChars: number of chars to return
static method Sub_ (line 635)

function Sub_

Hmolog of the string function substr

  • access: public
static void Sub_ ( $sStr,  $iStart, [ $iLength = ""])
  • $sStr
  • $iStart
  • $iLength
static method SymFreq_ (line 299)

function SymFreq_

  • access: public
  • uses: returns - frequency of a given string in another
static array SymFreq_ (string $sSymbol, string $sStr, [boolean $bCaseSensitive = TRUE])
  • string $sSymbol: Symbol to be searched for
  • string $sStr: String to be searched in
  • boolean $bCaseSensitive: bCaseSensitive Is the search supposed to be case-sensitive?
static method Trim_ (line 536)

function Trim_

  • return: Trimmed string
  • uses: Removes - leading and trailing spaces from a string.
static string Trim_ ( &$sStr, string $sStr)
  • string $sStr: String to be trimmed
  • &$sStr
Constructor __construct (line 80)

function __construct

  • return: String Instance
object __construct ([string $sStr = ""], [boolean $bIsRev = 0])
  • string $sStr: String data of the object
  • boolean $bIsRev: Is the string reversed?

Redefinition of:
Bio::__construct()
function Bio ()

Redefined in descendants as:
cat (line 712)

function cat

concats Str objects $oOther with $this

  • access: public
void cat (Str $oOther, object Seq $other)

Redefined in descendants as:
catStr (line 673)

function catStr

Workalike for MutableSeq::append in BioPython

  • access: public
string catStr ( $sOther, string $otherStr)
  • string $otherStr
  • $sOther

Redefined in descendants as:
CatStr_ (line 694)

function CatStr_

Workalike for MutableSeq::append in BioPython

  • access: public
string CatStr_ ( $sFirst,  $sOther, string $otherStr)
  • string $otherStr
  • $sFirst
  • $sOther
errorCallBack (line 756)

function errorCallBack

handles errors

  • access: public
void errorCallBack ( $oError)
  • $oError
getData (line 166)

function getData

  • access: public
string getData ()
getIsRev (line 134)

function getIsRev

  • access: public
bool getIsRev (none 0)
  • none 0
getRev (line 232)

function getRev

Reverses sequence of this Seq object by calling revStr Requires an instance of $this and does not modify the sequence in place

  • return: Rev_ersed string
  • access: public
string getRev (none 0)
  • none 0
inTrim (line 497)

function inTrim

Strip whitespace from the Seq->_seqStr

string inTrim ()
left (line 556)

function left

Set the Sequence data to the the first $iNnumChars characters of a string

  • return: substring
string left (int $iNnumChars, string $sStr)
  • string $sStr
  • int $iNnumChars: number of chars to return
len (line 451)

function len

Calculates length of Seq obj Str data

  • return: length of sequence object
  • access: public
integer len ()
reMatch (line 330)

function reMatch Simple function to search instantiated String objects.

Calls the static func. ReMatch_ to do the work.

array reMatch (string $sNeedle, [boolean $bCaseSensitive = TRUE])
  • string $sNeedle: Symbol to be searched
  • boolean $bCaseSensitive: bCaseSensitive Is the search supposed to be case-sensitive?
rev (line 210)

function rev

Reverses sequence of this Seq object by calling revStr Requires an instance of $this and reverses the sequence in place

  • return: Rev_ersed string
  • access: public
string rev (none 0)
  • none 0
right (line 615)

function right

  • return: substring
  • access: public
  • uses: Set - the Sequence data to the substring beginning at $numChars characters from the right end of a string.
string right ( $iNumChars, string $sStr, int $iChars)
  • string $sStr
  • int $iChars: number of chars to return
  • $iNumChars
setData (line 150)

function setData

  • access: public
void setData ( $sData, string $sStr)
  • string $sStr: String represented
  • $sData
setIsRev (line 116)

function setIsRev

  • access: public
void setIsRev (boolean $bIsRev)
  • boolean $bIsRev
sub (line 653)

function sub

Calls Sub for $this Seq object

  • access: public
void sub ( $iStart, [ $iLength = ""])
  • $iStart
  • $iLength
symFreq (line 278)

function symFreq Simple function to search instantiated String objects for characters.

Calls the static func. SymFreq_ to do the work.

array symFreq (string $sSymbol, [boolean $bCaseSensitive = TRUE])
  • string $sSymbol: Symbol to be searched
  • boolean $bCaseSensitive: Is the search supposed to be case-sensitive?
toggleIsRev (line 254)

function toggleIsRev

  • access: public
boolean toggleIsRev (none 0)
  • none 0
trim (line 516)

function trim Removes leading and trailing spaces from a string.

  • return: Trimmed sequence string
string trim ()
__toString (line 98)

function __toString

string __toString ()

Redefined in descendants as:

Inherited Methods

Inherited From Bio

Bio::__construct()
Bio::printWithNl()
Class Constants

Inherited Constants

Inherited from Bio

Bio::NEWLINE

Documentation generated on Sun, 28 Sep 2008 11:09:40 +0200 by phpDocumentor 1.4.2