public static CharacterChromosome of(
		final String alleles,
		final CharSeq validChars
	) {
		final MSeq<CharacterGene> genes = MSeq.ofLength(alleles.length());
		for (int i = 0; i < alleles.length(); ++i) {
			genes.set(i, CharacterGene.of(alleles.charAt(i), validChars));
		}

		return new CharacterChromosome(genes.toISeq(), IntRange.of(alleles.length()));
	}
Create a new chromosome from the given genes (given as string).

@param alleles the character genes.
@param validChars the valid characters.
@return a new {@code CharacterChromosome} with the given parameter
@throws IllegalArgumentException if the genes string is empty.
jenetics/src/main/java/io/jenetics/CharacterChromosome.java