stringToStringSet - SeqAn API Documentation

# fn() stringToStringSet
Transform a String into a StringSet containing this String.

Defined in | <seqan/alignment_free.h>
Signature | `void stringToStringSet(stringSet, string); void stringToStringSet(dnaStringSet, dna5String);`

## Parameters

`stringSet` | StringSet to create with one sequence.
`string` | String to create the string set of.
`dnaStringSet` | StringSet of Strings over the alphabet Dna.
`dna5String` | String over the alphabet Dna5 to convert.

## Detailed Description

Note:

The second variant removes all N characters from the Dna5String.

### Examples

Transform a masked DNA sequence into a set of sequences with all masked parts removed.

    using namespace seqan2;
    Dna5String sequenceDna5 =
        "NNNNNNTTTCCGAAAAGGTANNNNNGCAACTTTANNNCGTGATCAAAGTTTTCCCCGTCGAAATTGGGNNTG";
    StringSet<DnaString> sequencesDna;
    stringToStringSet(sequencesDna, sequenceDna5);
    // Print the masked sequence
    std::cout<<sequenceDna5<<"\n";
    // Print the sequence with the masked parts removed
    for(unsigned i = 0; i < length(sequencesDna); ++i)
        std::cout<<sequencesDna[i]<<"\n";
    // sequencesDna[0] = "TTTCCGAAAAGTA"
    // sequencesDna[1] = "GCAACTTTA"
    // sequencesDna[2] = "CGTGATCAAAGTTTTCCCCGTCGAAATTGGG"
    // sequencesDna[3] = "TG"

## Data Races

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

## See Also

- MarkovModel
- alignmentFreeComparison
- countKmers
- cutNs

#### Dox Sources

    /*!
     * @fn stringToStringSet
     *
     * @headerfile <seqan/alignment_free.h>
     *
     * @brief Transform a String into a StringSet containing this String.
     *
     * @note The second variant removes all N characters from the @link Dna5String
     *       @endlink.
     *
     * @signature void stringToStringSet(stringSet, string);
     * @signature void stringToStringSet(dnaStringSet, dna5String);
     *
     * @param[out] stringSet @link StringSet @endlink to create with one sequence.
     * @param[in] string @link String @endlink to create the string set of.
     * @param[out] dnaStringSet @link StringSet @endlink of @link String Strings
     *                          @endlink over the alphabet @link Dna @endlink.
     * @param[in] dna5String @link String @endlink over the alphabet @link Dna5
     *                       @endlink to convert.
     *
     * @section Examples
     *
     * Transform a masked DNA sequence into a set of sequences with all masked parts
     * removed.
     *
     * @code{.cpp}
     * using namespace seqan2;
     * Dna5String sequenceDna5 =
     *     "NNNNNNTTTCCGAAAAGGTANNNNNGCAACTTTANNNCGTGATCAAAGTTTTCCCCGTCGAAATTGGGNNTG";
     * StringSet<DnaString> sequencesDna;
     * stringToStringSet(sequencesDna, sequenceDna5);
     * // Print the masked sequence
     * std::cout<<sequenceDna5<<"\n";
     * // Print the sequence with the masked parts removed
     * for(unsigned i = 0; i < length(sequencesDna); ++i)
     *     std::cout<<sequencesDna[i]<<"\n";
     * // sequencesDna[0] = "TTTCCGAAAAGTA"
     * // sequencesDna[1] = "GCAACTTTA"
     * // sequencesDna[2] = "CGTGATCAAAGTTTTCCCCGTCGAAATTGGG"
     * // sequencesDna[3] = "TG"
     * @endcode
     *
     *
     * @see MarkovModel
     * @see alignmentFreeComparison
     * @see cutNs
     * @see countKmers
     */