Search in sources :

Example 1 with SequenceQuality

use of com.milaboratory.core.sequence.SequenceQuality in project mixcr by milaboratory.

the class CloneAccumulator method rebuildClonalSequence.

public void rebuildClonalSequence() {
    SequenceQuality newQuality = aggregator.getQuality();
    final NSequenceWithQuality[] updated = new NSequenceWithQuality[sequence.size()];
    int pointer = 0;
    for (int i = 0; i < updated.length; i++) {
        final NucleotideSequence s = this.sequence.get(i).getSequence();
        updated[i] = new NSequenceWithQuality(s, newQuality.getRange(pointer, pointer + s.size()));
        pointer += s.size();
    }
    sequence = new ClonalSequence(updated);
    return;
}
Also used : SequenceQuality(com.milaboratory.core.sequence.SequenceQuality) NSequenceWithQuality(com.milaboratory.core.sequence.NSequenceWithQuality) NucleotideSequence(com.milaboratory.core.sequence.NucleotideSequence) ClonalSequence(com.milaboratory.mixcr.basictypes.ClonalSequence)

Example 2 with SequenceQuality

use of com.milaboratory.core.sequence.SequenceQuality in project mixcr by milaboratory.

the class ClonalSequenceTest method createRandom.

private ClonalSequence createRandom(int size, RandomGenerator generator) {
    NSequenceWithQuality[] data = new NSequenceWithQuality[size];
    for (int i = 0; i < size; ++i) {
        NucleotideSequence s = TestUtil.randomSequence(NucleotideSequence.ALPHABET, generator, 2, 10);
        SequenceQuality q = SequenceQuality.getUniformQuality((byte) 0, s.size());
        data[i] = new NSequenceWithQuality(s, q);
    }
    return new ClonalSequence(data);
}
Also used : SequenceQuality(com.milaboratory.core.sequence.SequenceQuality) NSequenceWithQuality(com.milaboratory.core.sequence.NSequenceWithQuality) NucleotideSequence(com.milaboratory.core.sequence.NucleotideSequence)

Example 3 with SequenceQuality

use of com.milaboratory.core.sequence.SequenceQuality in project mixcr by milaboratory.

the class ClonalSequenceTest method create.

private ClonalSequence create(String... strings) {
    NSequenceWithQuality[] data = new NSequenceWithQuality[strings.length];
    for (int i = 0; i < strings.length; ++i) {
        NucleotideSequence s = new NucleotideSequence(strings[i]);
        SequenceQuality q = SequenceQuality.getUniformQuality((byte) 0, s.size());
        data[i] = new NSequenceWithQuality(s, q);
    }
    return new ClonalSequence(data);
}
Also used : SequenceQuality(com.milaboratory.core.sequence.SequenceQuality) NSequenceWithQuality(com.milaboratory.core.sequence.NSequenceWithQuality) NucleotideSequence(com.milaboratory.core.sequence.NucleotideSequence)

Aggregations

NSequenceWithQuality (com.milaboratory.core.sequence.NSequenceWithQuality)3 NucleotideSequence (com.milaboratory.core.sequence.NucleotideSequence)3 SequenceQuality (com.milaboratory.core.sequence.SequenceQuality)3 ClonalSequence (com.milaboratory.mixcr.basictypes.ClonalSequence)1