Class Specialization
CStyle String
Allows adaption of strings to C-style strings.
| |||||||||||||
![]() | ![]() | ||||||||||||
CStyle String |
Include Headers
seqan/sequence.h
Parameters
The value type, that is the type of the items/characters stored in the string. Remarks: Use Value to get the value type for a given class. |
Remarks
The purpose of this class is to access to the content of a sequence
in a "zero terminated string" style.
This can be useful if SeqAn classes has to be integrated in programs that use char arrays
to store strings.
Instances of String<TValue, CStyle> can implicitely converted to a TValue * that
points to a zero terminated CStyle of TValue .
The stored c-style string object can be set by constructors or assignment.
The content of a c-style string can eighter be stored in a separate buffer, that is the source string
is copied. Or the buffer of the source string itself is used instead, in this case the c-style string
depends on the source string and gets invalid as soon as the buffer of the source string is destroyed.
Hence, this class is a kind of adaptor from an arbitrary SeqAn string to char arrays.
Of course, the opposite way is possible too:
Read here about adapting char arrays to SeqAn strings.
Specialization of
Implements
Metafunctions
The default overflow strategy for explicit resize. (String) | |
The default overflow strategy for implicit resize. (String) | |
Infix sequence type. (String) | |
Determines whether a container stores its elements in sequential order. (String) | |
The string type of the finder. (String) | |
Type of an object that represents a position in a container. (String) | |
Prefix sequence type. (String) | |
The default alphabet type of a suffix array, i.e. the type to store a position of a string or string set. (String) | |
The spec of a class. (String) | |
Suffix sequence type. (String) | |
Type of the items in the container or behind an iterator. (String) |
Functions
Concatenate two containers. (String) | |
Appends all sequences stored in files of directory to a StringSet. (String) | |
Assigns one object to another object. (String) | |
Extracts the sequence id up to the first whitespace of a sequence file fragment. (String) | |
Extracts the quality values of a sequence file fragment. (String) | |
Extracts the quality value id of a sequence file fragment. (String) | |
Extracts the sequence part of a sequence file fragment. (String) | |
Extracts the sequence id of a sequence file fragment. (String) | |
Assigns value to item. (ContainerConcept) | |
The last item in container. (ContainerConcept) | |
Convert BamAlignmentRecord to an Align object. (String) | |
The begin of a container. (String) | |
Begin position of object in host. (String) | |
Builds an Alignment Graph from a set of input alignments. (String) | |
Calculates the covariance for the number of word occurrences for two words in a sequence of length n, given a background model. (String) | |
Calculate word overlaps: epsilon(word1,word2)= 1 where word2[j]=word1[j+p] for all j=1...(k-p) (String) | |
Calculate word periodicity (indicator for overlaps) (String) | |
Calculates the probability of a sequence given a Bernoulli model (String of background frequencies) (String) | |
Calculates the variance for the number of word occurrences of a word in a sequence of length n given a background model. (String) | |
Test whether an automaton can parse a string completely. (String) | |
The maximal length. (String) | |
Resets an object. (String) | |
Returns all leaves underneath a given vertex. (String) | |
Complement a sequence or a StringSet in-place. (String) | |
Counts kmers in a sequence. Optionally, a background model is returned. (String) | |
Makes an object to owner of its content. | |
Creates the LF table (String) | |
Creates a factor oracle. (String) | |
Creates a factor oracle for the reversed string. (String) | |
Creates the prefix sum table (String) | |
This functions creates the dictionary. (String) | |
Computes the wavelet tree structure of a text. (String) | |
This functions creates the dictionary structure. (String) | |
Creates a trie of all suffixes of a text. (String) | |
Creates a trie. (String) | |
Creates a trie for all reversed keywords. (String) | |
Test whether object depends on other objects. | |
Determines the consensus pattern of a given profile. (String) | |
Test a container for being empty. (String) | |
The end of a container. (String) | |
End position of object in host. (String) | |
Erases a part of a container (String) | |
Deletes the last item of a container and reduces its size by 1. The container must have a size greater than or equal to 1. (String) | |
Extends a seed. (String) | |
Find all intervals that contain the query point or overlap with the query interval. (String) | |
Find all intervals that contain the query point, exclude intervals that touch the query, i.e. where the query point equals the start or end point. (String) | |
Search for repeats in a text. (String) | |
The first item in container. (ContainerConcept) | |
Computes a pairwise distance matrix from an alignment graph. (String) | |
A value that identifies the underlying sequence. (String) | |
Gets the successor for a given vertex and an edge label. For an automaton a single character is required whereas for a word graph getSuccessor takes a string. (String) | |
Access to the value. (ContainerConcept) | |
Computes the best global pairwise alignment score. (String) | |
Iterates down one edge or a path in a tree. (String) | |
Computes the heaviest increasing subsequence. (String) | |
Creates infix object. (String) | |
Creates infix object. (String) | |
Integrates an alignment into another by copying the gaps. (String) | |
Iterator to item at given position. (String) | |
The number of items/characters. (String) | |
Computes the longest common subsequence. (String) | |
Computes the longest increasing subsequence. (String) | |
Assigns value to item. (ContainerConcept) | |
Computes a guide tree from a distance matrix. (String) | |
Parses a string one character at a time and moves accordingly in the automaton. (String) | |
Position of an iterator. (ContainerConcept) | |
Creates prefix object. (String) | |
Read first sequence from a FASTA file. (String) | |
Read the next sequence record from SequenceStream. (String) | |
Load the infix of a sequence from a FaiIndex. (String) | |
Load a whole sequence from an FaiIndex. (String) | |
Replaces a part of a container with another container. (String) | |
Increases the capacity. (String) | |
Resizes a container. If the new length exceeds the old length the new elements are filled with copies of | |
Makes free space in container (String) | |
Reverse and complement a sequence or a StringSet in-place. (String) | |
Sets the haystack of a Finder object. (String) | |
Sets the host of an object. (String) | |
Sets the needle of a Pattern object and optionally induces preprocessing. (String) | |
Converts a given shape into a sequence of '1' (relevant position) and '0' (irrelevant position). (String) | |
Determines whether two sequences share the same resource. (String) | |
Retrieves a string of delimiter positions of a StringSet which is needed for local<->global position conversions. (String) | |
Takes a shape given as a string of '1' (relevant position) and '0' (irrelevant position) and converts it into a Shape object. (String) | |
Transform a String into a StringSet containing this String. (String) | |
Creates suffix object. (String) | |
Swaps the contents of two values. (String) | |
Access sequence as c-style string. (String) | |
Convert characters in sequence or StringSet to lower case in-place. (String) | |
Performs a topological sort on a directed acyclic graph (DAG). (String) | |
Convert characters in sequence or StringSet to lower case in-place. (String) | |
Inverse of the hash function; for ungapped shapes. (String) | |
Computes a guide tree from a distance matrix. (String) | |
Reference to the value. (String) | |
Write one sequence record from to a SequenceStream object. (String) |
Examples
String<char> str = "this is a test string";
// Create a c-style string object for str:
String<char, CStyle> cStyle = str;
// Now use cStyle as char array:
strcmp(cStyle, "compare it to this string");
If the c-style string is needed only temporarily, the function toCString can be used:
strcmp(toCString(str), "compare it to this string");
Example Programs
See Also
SeqAn - Sequence Analysis Library - www.seqan.de