ajrange.c


Section: Range Constructors

All constructors return a new object by pointer. It is the responsibility of the user to first destroy any previous object. The target pointer does not need to be initialised to NULL, but it is good programming practice to do so anyway.

Functions:
ajRangeNewIDefault constructor for AJAX range objects.
ajRangeNewFilenameLoad a range object from a file
ajRangeNewFilenameLimitsLoad a range object from a file
ajRangeNewRangeCopy constructor for AJAX range objects.
ajRangeNewStringCreate a range object from a string
ajRangeNewStringLimitsCreate a range object from a string


Function ajRangeNewI

Default constructor for AJAX range objects.

Prototype

AjPRange ajRangeNewI (
      ajuint n
);

TypeNameRead/WriteDescription
ajuintnInputnumber of ranges
AjPRange RETURNPointer to a range object

From EMBOSS 1.0.0


Function ajRangeNewFilename

Load a range object from a file

Prototype

AjPRange ajRangeNewFilename (
      const AjPStr name
);

TypeNameRead/WriteDescription
const AjPStrnameInputrange file name
AjPRange RETURNrange object

From EMBOSS 6.2.0


Function ajRangeNewFilenameLimits

Load a range object from a file

Prototype

AjPRange ajRangeNewFilenameLimits (
      const AjPStr name,
      ajuint imin,
      ajuint imax,
      ajuint minsize,
      ajuint size
);

TypeNameRead/WriteDescription
const AjPStrnameInputrange file name
ajuintiminInputMinimum value
ajuintimaxInputMaximum value
ajuintminsizeInputMinimum number of values
ajuintsizeInputRequired number of values, zero for unlimited
AjPRange RETURNrange object

From EMBOSS 6.2.0


Function ajRangeNewRange

Copy constructor for AJAX range objects.

Prototype

AjPRange ajRangeNewRange (
      const AjPRange src
);

TypeNameRead/WriteDescription
const AjPRangesrcInputSource range
AjPRange RETURNPointer to a range object

From EMBOSS 6.2.0


Function ajRangeNewString

Create a range object from a string

Prototype

AjPRange ajRangeNewString (
      const AjPStr str
);

TypeNameRead/WriteDescription
const AjPStrstrInputrange string
AjPRange RETURNrange object

From EMBOSS 6.2.0


Function ajRangeNewStringLimits

Create a range object from a string

Prototype

AjPRange ajRangeNewStringLimits (
      const AjPStr str,
      ajuint imin,
      ajuint imax,
      ajuint minsize,
      ajuint size
);

TypeNameRead/WriteDescription
const AjPStrstrInputrange string
ajuintiminInputMinimum value
ajuintimaxInputMaximum value
ajuintminsizeInputMinimum number of values
ajuintsizeInputRequired number of values, zero for unlimited
AjPRange RETURNrange object

From EMBOSS 6.2.0


Section: Range Destructors

Default destructor for AJAX range objects

Functions:
ajRangeDelDefault destructor for AJAX range objects.


Function ajRangeDel

Default destructor for AJAX range objects.

Prototype

void ajRangeDel (
      AjPRange* thys
);

TypeNameRead/WriteDescription
AjPRange*thysDeleterange structure
void RETURN

From EMBOSS 1.0.0


Section: Range Functions

Other functions for AJAX range objects

Functions:
ajRangeGetSizeReturn the number of ranges in a range object
ajRangeElementGetTextReturn (as parameters) text value of a range element
ajRangeElementGetValuesReturn (as parameters) start and end values in a range
ajRangeElementSetSet the values of a start and end in a (pre-existing) range element
ajRangeSetOffsetSets the range values offset relative to the Begin value.
ajRangeSeqExtractListExtract the range from a sequence and place the resulting text in a list of strings.
ajRangeSeqExtractExtract the range from a sequence (Remove regions not in the range(s)) N.B. the resulting sequence will be regions of the original concatenated in the order specified in the set of ranges. If these are not in ascending order, the resulting sequence will not be in position order either.
ajRangeSeqExtractPepExtract the range from a sequence (Remove regions not in the range(s)) and translate to protein.
ajRangeSeqStuffThe opposite of ajRangeSeqExtract() Stuff space characters into a string to pad out to the range.
ajRangeSeqStuffPepThe opposite of ajRangeSeqExtractPep() Stuff space characters into a translated string to pad out to the range.
ajRangeSeqMaskMask the range in a String
ajRangeSeqToLowerChange the range in a String to lower-case
ajRangeStrExtractListExtract the range from a String and place the resulting text in a list of strings.
ajRangeStrExtractExtract the range from a String (Remove regions not in the range(s))
ajRangeStrStuffThe opposite of ajRangeStrExtract() Stuff space characters into a string to pad out to the range.
ajRangeStrMaskMask the positions defined by a range in a string
ajRangeStrToLowerChange positions defined by the range in a string to lower-case
ajRangeElementTypeOverlapDetect an overlap of a single range element to a region of a sequence
ajRangeCountOverlapsDetect overlaps of a set of ranges to a region of a sequence
ajRangeIsOrderedTests to see if the set of ranges are in ascending non-overlapping order
ajRangeIsWholeTest whether the default range is used for a sequence


Function ajRangeGetSize

Return the number of ranges in a range object

Prototype

ajuint ajRangeGetSize (
      const AjPRange thys
);

TypeNameRead/WriteDescription
const AjPRangethysInputrange object
ajuint RETURNnumber of ranges

From EMBOSS 6.2.0


Function ajRangeElementGetText

Return (as parameters) text value of a range element

Prototype

AjBool ajRangeElementGetText (
      const AjPRange thys,
      ajuint element,
      AjPStr* text
);

TypeNameRead/WriteDescription
const AjPRangethysInputrange object
ajuintelementInputrange element (0 to n-1)
AjPStr*textOutputtext value
AjBool RETURNtrue if range exists

From EMBOSS 6.2.0


Function ajRangeElementGetValues

Return (as parameters) start and end values in a range

Prototype

AjBool ajRangeElementGetValues (
      const AjPRange thys,
      ajuint element,
      ajuint* start,
      ajuint* end
);

TypeNameRead/WriteDescription
const AjPRangethysInputrange object
ajuintelementInputrange element (0 to n-1)
ajuint*startOutputstart value
ajuint*endOutputend value
AjBool RETURNtrue if range exists

From EMBOSS 6.2.0


Function ajRangeElementSet

Set the values of a start and end in a (pre-existing) range element

Prototype

AjBool ajRangeElementSet (
      AjPRange thys,
      ajuint element,
      ajuint start,
      ajuint end
);

TypeNameRead/WriteDescription
AjPRangethysOutputrange object
ajuintelementInputrange element (0 to n-1)
ajuintstartInputstart value
ajuintendInputend value
AjBool RETURNtrue if range exists

From EMBOSS 6.2.0


Function ajRangeSetOffset

Sets the range values offset relative to the Begin value.

Prototype

AjBool ajRangeSetOffset (
      AjPRange thys,
      ajuint begin
);

TypeNameRead/WriteDescription
AjPRangethysModifyrange object
ajuintbeginInputbegin parameter obtained from ajSeqGetBegin(seq)
AjBool RETURNtrue if region values modified

From EMBOSS 6.2.0


Function ajRangeSeqExtractList

Extract the range from a sequence and place the resulting text in a list of strings.

Prototype

AjBool ajRangeSeqExtractList (
      const AjPRange thys,
      const AjPSeq seq,
      AjPList outliststr
);

TypeNameRead/WriteDescription
const AjPRangethysInputrange object
const AjPSeqseqInputsequence to extract from
AjPListoutliststrOutputresulting list of strings
AjBool RETURNtrue if result is not the whole sequence

From EMBOSS 3.0.0


Function ajRangeSeqExtract

Extract the range from a sequence (Remove regions not in the range(s)) N.B. the resulting sequence will be regions of the original concatenated in the order specified in the set of ranges. If these are not in ascending order, the resulting sequence will not be in position order either.

Prototype

AjBool ajRangeSeqExtract (
      const AjPRange thys,
      AjPSeq seq
);

TypeNameRead/WriteDescription
const AjPRangethysInputrange object
AjPSeqseqModifySequence
AjBool RETURNtrue if sequence was modified

From EMBOSS 3.0.0


Function ajRangeSeqExtractPep

Extract the range from a sequence (Remove regions not in the range(s)) and translate to protein.

Prototype

AjPSeq ajRangeSeqExtractPep (
      const AjPRange thys,
      AjPSeq seq,
      const AjPTrn trntable,
      ajint frame
);

TypeNameRead/WriteDescription
const AjPRangethysInputrange object
AjPSeqseqModifySequence
const AjPTrntrntableInputTranslation table
ajintframeInputReading frame 1..3 or -1..-3
AjPSeq RETURNTranslated protein sequence

From EMBOSS 6.1.0


Function ajRangeSeqStuff

The opposite of ajRangeSeqExtract() Stuff space characters into a string to pad out to the range.

Prototype

AjBool ajRangeSeqStuff (
      const AjPRange thys,
      AjPSeq seq
);

TypeNameRead/WriteDescription
const AjPRangethysInputrange object
AjPSeqseqModifySequence to be modified
AjBool RETURNtrue if sequence was modified

From EMBOSS 3.0.0


Function ajRangeSeqStuffPep

The opposite of ajRangeSeqExtractPep() Stuff space characters into a translated string to pad out to the range.

Prototype

AjBool ajRangeSeqStuffPep (
      const AjPRange thys,
      AjPSeq seq,
      ajint frame
);

TypeNameRead/WriteDescription
const AjPRangethysInputrange object
AjPSeqseqModifySequence to be modified
ajintframeInputReading frame 1..3 or -1..-3
AjBool RETURNtrue if sequence was modified

From EMBOSS 6.1.0


Function ajRangeSeqMask

Mask the range in a String

Prototype

AjBool ajRangeSeqMask (
      const AjPRange thys,
      const AjPStr maskchar,
      AjPSeq seq
);

TypeNameRead/WriteDescription
const AjPRangethysInputrange object
const AjPStrmaskcharInputcharacter to mask with
AjPSeqseqModifysequence to be masked
AjBool RETURNtrue if string modified

From EMBOSS 3.0.0


Function ajRangeSeqToLower

Change the range in a String to lower-case

Prototype

AjBool ajRangeSeqToLower (
      const AjPRange thys,
      AjPSeq seq
);

TypeNameRead/WriteDescription
const AjPRangethysInputrange object
AjPSeqseqModifysequence to be lower-cased
AjBool RETURNtrue if sequence was modified

From EMBOSS 3.0.0


Function ajRangeStrExtractList

Extract the range from a String and place the resulting text in a list of strings.

Prototype

AjBool ajRangeStrExtractList (
      const AjPRange thys,
      const AjPStr instr,
      AjPList outliststr
);

TypeNameRead/WriteDescription
const AjPRangethysInputrange object
const AjPStrinstrInputstring to extract from
AjPListoutliststrOutputresulting list of strings
AjBool RETURNtrue if string modified

From EMBOSS 1.0.0


Function ajRangeStrExtract

Extract the range from a String (Remove regions not in the range(s))

Prototype

AjBool ajRangeStrExtract (
      const AjPRange thys,
      const AjPStr instr,
      AjPStr* outstr
);

TypeNameRead/WriteDescription
const AjPRangethysInputrange object
const AjPStrinstrInputstring to extract from
AjPStr*outstrOutputresulting extracted string
AjBool RETURNtrue if string modified

From EMBOSS 1.0.0


Function ajRangeStrStuff

The opposite of ajRangeStrExtract() Stuff space characters into a string to pad out to the range.

Prototype

AjBool ajRangeStrStuff (
      const AjPRange thys,
      const AjPStr instr,
      AjPStr* outstr
);

TypeNameRead/WriteDescription
const AjPRangethysInputrange object
const AjPStrinstrInputstring to stuff
AjPStr*outstrOutputresulting stuffed string
AjBool RETURNtrue if string modified

From EMBOSS 1.0.0


Function ajRangeStrMask

Mask the positions defined by a range in a string

Prototype

AjBool ajRangeStrMask (
      const AjPRange thys,
      const AjPStr maskchar,
      AjPStr* str
);

TypeNameRead/WriteDescription
const AjPRangethysInputrange object
const AjPStrmaskcharInputcharacter to mask with
AjPStr*strOutputstring to be masked
AjBool RETURNtrue if string modified

From EMBOSS 1.0.0


Function ajRangeStrToLower

Change positions defined by the range in a string to lower-case

Prototype

AjBool ajRangeStrToLower (
      const AjPRange thys,
      AjPStr* str
);

TypeNameRead/WriteDescription
const AjPRangethysInputrange object
AjPStr*strOutputstring to be lower-cased
AjBool RETURNtrue if string modified

From EMBOSS 2.7.0


Function ajRangeElementTypeOverlap

Detect an overlap of a single range element to a region of a sequence

Prototype

ajuint ajRangeElementTypeOverlap (
      const AjPRange thys,
      ajuint element,
      ajuint pos,
      ajuint length
);

TypeNameRead/WriteDescription
const AjPRangethysInputrange object
ajuintelementInputrange element (0 to n-1)
ajuintposInputposition in sequence of start of region of sequence
ajuintlengthInputlength of region of sequence
ajuint RETURN0=no overlap 1=internal 2=complete 3=at left 4=at right

From EMBOSS 6.2.0


Function ajRangeCountOverlaps

Detect overlaps of a set of ranges to a region of a sequence

Prototype

ajuint ajRangeCountOverlaps (
      const AjPRange thys,
      ajuint pos,
      ajuint length
);

TypeNameRead/WriteDescription
const AjPRangethysInputrange object
ajuintposInputposition in sequence of start of region of sequence
ajuintlengthInputlength of region of sequence
ajuint RETURNNumber of ranges in range object with overlaps to the region

From EMBOSS 6.2.0


Function ajRangeIsOrdered

Tests to see if the set of ranges are in ascending non-overlapping order

Prototype

AjBool ajRangeIsOrdered (
      const AjPRange thys
);

TypeNameRead/WriteDescription
const AjPRangethysInputrange object
AjBool RETURNajTrue if in ascending non-overlapping order

From EMBOSS 6.2.0


Function ajRangeIsWhole

Test whether the default range is used for a sequence

Prototype

AjBool ajRangeIsWhole (
      const AjPRange thys,
      const AjPSeq s
);

TypeNameRead/WriteDescription
const AjPRangethysInputrange object
const AjPSeqsInputsequence
AjBool RETURNtrue if default range

From EMBOSS 6.2.0