Spec Generic CyclicShape
CyclicShape initiated at runtime.

Extends CyclicShape
All Extended CyclicShape
Defined in <seqan/modifier.h>
Signature template <> class CyclicShape<GenericShape>;

Template Parameters

TSize Size type of the CyclicShape

Member Function Overview

Interface Function Overview

Interface Functions Inherited From CyclicShape

Interface Metafunction Overview

Interface Metafunctions Inherited From CyclicShape

Member Variable Overview

Member Variables Inherited From CyclicShape

Detailed Description

Generic Shapes can be easily created using stringToCyclicShape, but their usage comes with a significant loss in efficiency. For longer sequences, prefer the FixedCyclicShape.


#include <seqan/modifier.h>
#include <seqan/stream.h>

using namespace seqan;

int main(int argc, char const ** argv)
    // create a (generic) CyclicShape
    typedef CyclicShape<GenericShape> TShape;
    TShape shape;
    stringToCyclicShape(shape, "1110010");

    // print cyclic Shape
    CharString out;
    cyclicShapeToString(out, shape);
    std::cout << "shape: " << out << std::endl;

    // determine weight and span
    std::cout << "weight: " << (int)weight(shape);
    std::cout << ", span: " << (int)shape.span << std::endl;

    // modify a text to leave out characters
    CharString str = "this is an original string";
    ModifiedString<CharString, ModCyclicShape<TShape> > modStr(str, shape);

    // modStr can be used like a normal String
    std::cout << str << " => " << modStr << std::endl;
    std::cout << "length: " << length(str) << " => " << length(modStr) << std::endl;

    return 0;

The output is as follows:

shape: 1110010
weight: 4, span: 7
this is an original string => thii anrgin tri
length: 26 => 15

See Also

Member Functions Detail

CyclicShape(); CyclicShape(shape);

The constructor


shape A GenericCyclicShape to be copied.

The default constructor generates the pattern "1". The copy constructor copies the GenericCyclicShape shape.

        typedef CyclicShape<GenericShape> TShape;
        TShape shape;
        stringToCyclicShape(shape, "00111001010");


If you want to generate a GenericCyclicShape from a FixedCyclicShape, use cyclicShapeToString and stringToCyclicShape

Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

Interface Functions Detail

void stringToCyclicShape(shape, bitmap);

Converts a 0/1 string to a Generic CyclicShape.

Template Parameters

TString A string type, e.g. CharString.


shape Generic CyclicShape
bitmap 0/1 string of type TString. CyclicShapes may start and end with zeros, but must contain at least one 1.

Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

Member Variables Detail

String<TSize> GenericCyclicShape::diffs

Distances between care positions.

diffs has weight many non-zero entries describing the size of the gap after a care-position. The last entry holds the cyclic distance from the last "1" to the first one.