package ca.bcgsc.abyssexplorer.parsers; import java.util.ArrayList; import java.util.List; import ca.bcgsc.abyssexplorer.graph.ContigLabel; /** * Class to capture the paired-end (PE) contig information. * Member list is ordered relative to this PE contig's * positive strand orientation. * * @author Cydney Nielsen * */ public class PairedEndContig { protected int id; // no strand; positive only protected int coverage; protected List mLabels; public PairedEndContig(int i) { id = i; coverage = -1; mLabels = new ArrayList(); } public void addMember(String cLabel) { ContigLabel mLabel; int mId; if (cLabel.endsWith("+")) { mId = Integer.parseInt(cLabel.replace("+", "")); mLabel = new ContigLabel(mId, (byte) 0); } else if (cLabel.endsWith("-")) { mId = Integer.parseInt(cLabel.replace("-", "")); mLabel = new ContigLabel(mId, (byte) 1); } else { throw new IllegalArgumentException("Paired-end contig label must end in '+' or '-'"); } mLabels.add(mLabel); } public int getCoverage() { return coverage; } public List getMembers() { return mLabels; } public int getNumMembers() { return mLabels.size(); } public String getLabel() { String label = id + "+"; return label; } public int getId() { return id; } public void setCoverage(int c) { coverage = c; } }