Package solodel

Source Code of solodel.Locus

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package solodel;

import java.util.Iterator;
import java.util.List;
import net.sf.picard.util.SamLocusIterator;
import net.sf.samtools.SAMRecord;

/**
*
* @author kimjh
*/
public class Locus {

    private String chr;
    private int pos;
    private double meanMapQ;
    private double meanSeqQ;
    private int depth;

    /**
     * @return the chr
     */
    public String getChr() {
        return chr;
    }

    /**
     * @param chr the chr to set
     */
    public void setChr(String chr) {
        this.chr = chr;
    }

    /**
     * @return the pos
     */
    public int getPos() {
        return pos;
    }

    /**
     * @param pos the pos to set
     */
    public void setPos(int pos) {
        this.pos = pos;
    }

    /**
     * @return the meanMapQ
     */
    public double getMeanMapQ() {
        return meanMapQ;
    }

    /**
     * @param meanMapQ the meanMapQ to set
     */
    public void setMeanMapQ(double meanMapQ) {
        this.meanMapQ = meanMapQ;
    }

    /**
     * @return the meanSeqQ
     */
    public double getMeanSeqQ() {
        return meanSeqQ;
    }

    /**
     * @param meanSeqQ the meanSeqQ to set
     */
    public void setMeanSeqQ(double meanSeqQ) {
        this.meanSeqQ = meanSeqQ;
    }

    public void setMeanQualities(List<SamLocusIterator.RecordAndOffset> l) {
        Iterator it = l.iterator();
        double mapQ = 0.0;
        double seqQ = 0.0;
        while (it.hasNext()) {
            SamLocusIterator.RecordAndOffset record = (SamLocusIterator.RecordAndOffset) it.next();
            seqQ += (int) record.getBaseQuality();
            SAMRecord sr = record.getRecord();
            mapQ += sr.getMappingQuality();
        }       
        setMeanMapQ(mapQ / (double) l.size());
        setMeanSeqQ(seqQ / (double) l.size());       
    }

    /**
     * @return the depth
     */
    public int getDepth() {
        return depth;
    }

    /**
     * @param depth the depth to set
     */
    public void setDepth(int depth) {
        this.depth = depth;
    }
}
TOP

Related Classes of solodel.Locus

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.