Search in sources :

Example 1 with OverrepresentedSeq

use of uk.ac.babraham.FastQC.Modules.OverRepresentedSeqs.OverrepresentedSeq in project irida by phac-nml.

the class FastqcFileProcessor method handleOverRepresentedSequences.

/**
 * Handle getting over represented sequences from fastqc.
 *
 * @param seqs
 *            overrepresented sequences.
 * @return a collection of {@link OverrepresentedSequence} corresponding to
 *         the FastQC {@link OverRepresentedSeqs}.
 */
private Set<OverrepresentedSequence> handleOverRepresentedSequences(OverRepresentedSeqs seqs) {
    OverrepresentedSeq[] sequences = seqs.getOverrepresentedSequences();
    if (sequences == null) {
        return Collections.emptySet();
    }
    Set<OverrepresentedSequence> overrepresentedSequences = new HashSet<>(sequences.length);
    for (OverrepresentedSeq s : sequences) {
        String sequenceString = s.seq();
        int count = s.count();
        BigDecimal percent = BigDecimal.valueOf(s.percentage());
        String possibleSource = s.contaminantHit();
        overrepresentedSequences.add(new OverrepresentedSequence(sequenceString, count, percent, possibleSource));
    }
    return overrepresentedSequences;
}
Also used : OverrepresentedSeq(uk.ac.babraham.FastQC.Modules.OverRepresentedSeqs.OverrepresentedSeq) OverrepresentedSequence(ca.corefacility.bioinformatics.irida.model.sequenceFile.OverrepresentedSequence) BigDecimal(java.math.BigDecimal) HashSet(java.util.HashSet)

Aggregations

OverrepresentedSequence (ca.corefacility.bioinformatics.irida.model.sequenceFile.OverrepresentedSequence)1 BigDecimal (java.math.BigDecimal)1 HashSet (java.util.HashSet)1 OverrepresentedSeq (uk.ac.babraham.FastQC.Modules.OverRepresentedSeqs.OverrepresentedSeq)1