Samples the complete sequence once in the forward direction
Destructively modifies the sequence in place.
@param sequence the sequence to start with.
969130
public void sampleSequenceForward(SequenceModel model, int[] sequence, double temperature) {
    // System.err.println("Sampling forward");
    for (int pos=0; pos<sequence.length; pos++) {
      samplePosition(model, sequence, pos, temperature);
    }
  }
931328
public static boolean isNonAmbNucleotideSequence(String sequence) {
	sequence = SequenceUtil.cleanSequence(sequence);
	if (SequenceUtil.DIGIT.matcher(sequence).find()) {
		return false;
	}
	if (SequenceUtil.NON_NUCLEOTIDE.matcher(sequence).find()) {
		return false;
		/*
		 * System.out.format("I found the text starting at " +
		 * "index %d and ending at index %d.%n", nonDNAmatcher .start(),
		 * nonDNAmatcher.end());
		 */
	}
	final Matcher DNAmatcher = SequenceUtil.NUCLEOTIDE.matcher(sequence);
	return DNAmatcher.find();
	}
1295508
public void setSamples(java.util.Collection<Sample> samples) {
        if (samples == null) {
            this.samples = null;
            return;
        }

        this.samples = new java.util.ArrayList<Sample>(samples);
    }
242912
public function addSequence(Sequence $sequence)
    {
        if ($this->hasSequence($sequence->getName())) {
            throw SchemaException::schemaSequenceAlreadyExists($this->getName(), $sequence->getName());
        }

        $this->sequences[$sequence->getName()] = $sequence;
    }
19788
@Override
    public void set(final long value)
    {
        final Sequence[] sequences = this.sequences;
        for (Sequence sequence : sequences)
        {
            sequence.set(value);
        }
    }
227401
protected function _addSequence(Sequence $sequence)
    {
        $namespaceName = $sequence->getNamespaceName();
        $seqName       = $sequence->getFullQualifiedName($this->getName());

        if (isset($this->_sequences[$seqName])) {
            throw SchemaException::sequenceAlreadyExists($seqName);
        }

        if ($namespaceName !== null
            && ! $sequence->isInDefaultNamespace($this->getName())
            && ! $this->hasNamespace($namespaceName)) {
            $this->createNamespace($namespaceName);
        }

        $this->_sequences[$seqName] = $sequence;
    }
126247
public List<List<Writable>> transformRawStringsToInputSequence(List<List<String>> sequence) {
        List<List<Writable>> ret = new ArrayList<>();
        for(List<String> input : sequence)
            ret.add(transformRawStringsToInputList(input));
        return ret;
    }
161220
public static <C extends Compound> Iterator<C> createIterator(
			Sequence<C> sequence) {
		return new SequenceIterator<C>(sequence);
	}
723076
public static void writeSequence(OutputStream outputStream, Sequence<?> sequence) throws Exception {
		writeSequences(outputStream, singleSeqToCollection(sequence));
	}
581753
public void setSequenceNumber(long value) {
        Preconditions.checkState(this.sequenceNumber < 0, "Sequence Number has been previously set for this entry. Cannot set a new one.");
        Exceptions.checkArgument(value >= 0, "value", "Sequence Number must be a non-negative number.");

        this.sequenceNumber = value;
    }
184037
public static String cleanSequence(String sequence) {
	assert sequence != null;
	final Matcher m = SequenceUtil.WHITE_SPACE.matcher(sequence);
	sequence = m.replaceAll("").toUpperCase();
	return sequence;
	}
618218
public void setSampleUtterances(java.util.Collection<String> sampleUtterances) {
        if (sampleUtterances == null) {
            this.sampleUtterances = null;
            return;
        }

        this.sampleUtterances = new java.util.ArrayList<String>(sampleUtterances);
    }
945902
protected final <R extends Request<T>> R setSequence(int sequence) {
        checkIfActive();
        this.sequence = sequence;
        return (R) this;
    }
1038853
public DictionaryBuilder add(CharSequence seq) throws DictionaryBuilderException {
        if (d_finalized)
            throw new DictionaryBuilderException("Cannot add a sequence to a finalized DictionaryBuilder.");

        if (d_prevSeq != null && compareCharacterSequences(d_prevSeq, seq) >= 0)
            throw new DictionaryBuilderException(String.format("Sequences are not added in lexicographic order: %s %s", d_prevSeq, seq));

        d_prevSeq = seq;

        // Traverse across the shared prefix.
        int i = 0;
        State curState = d_startState;
        for (int len = seq.length(); i < len; i++) {
            State nextState = curState.move(seq.charAt(i));
            if (nextState != null)
                curState = nextState;
            else
                break;
        }

        if (curState.hasOutgoing())
            replaceOrRegisterIterative(curState);

        addSuffix(curState, seq.subSequence(i, seq.length()));

        ++d_nSeqs;

        return this;
    }
1110747
@InterfaceAudience.Private
    public void setLastSequence(String lastSequenceIn) {
        if (lastSequenceIn != null && !lastSequenceIn.equals(lastSequence)) {
            Log.v(Log.TAG_SYNC, "%s: Setting lastSequence to %s from(%s)", this, lastSequenceIn, lastSequence);
            lastSequence = lastSequenceIn;
            if (!lastSequenceChanged) {
                lastSequenceChanged = true;
                synchronized (executor) {
                    if (!executor.isShutdown()) {
                        executor.schedule(new Runnable() {
                            public void run() {
                                saveLastSequence();
                            }
                        }, SAVE_LAST_SEQUENCE_DELAY, TimeUnit.SECONDS);
                    }
                }
            }
        }
    }
875304
private void initSequential(final Boolean sequential) {

        // Try to retrieve the Sequential annotation at class level within class hierarchy
        final Sequential seq = ClassUtility.getLastClassAnnotation(this.getClass(), Sequential.class);

        // First try to get the annotation value (if present
        // Secondly by provided runtType argument
        // Thirdly (default case) use FALSE value
        setSequential(seq == null ? sequential == null ? DEFAULT_SEQUENTIAL_VALUE : sequential : seq.value());

    }
573597
public void moveSegmentOut(final String sequenceName, final List<SegmentIdWithShardSpec> identifiers)
  {
    synchronized (segments) {
      final SegmentsForSequence activeSegmentsForSequence = segments.get(sequenceName);
      if (activeSegmentsForSequence == null) {
        throw new ISE("WTF?! Asked to remove segments for sequenceName[%s] which doesn't exist...", sequenceName);
      }

      for (final SegmentIdWithShardSpec identifier : identifiers) {
        log.info("Moving segment[%s] out of active list.", identifier);
        final long key = identifier.getInterval().getStartMillis();
        final SegmentsOfInterval segmentsOfInterval = activeSegmentsForSequence.get(key);
        if (segmentsOfInterval == null ||
            segmentsOfInterval.getAppendingSegment() == null ||
            !segmentsOfInterval.getAppendingSegment().getSegmentIdentifier().equals(identifier)) {
          throw new ISE("WTF?! Asked to remove segment[%s] that didn't exist...", identifier);
        }
        segmentsOfInterval.finishAppendingToCurrentActiveSegment(SegmentWithState::finishAppending);
      }
    }
  }