All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.milaboratory.mitcr.cdrextraction.Strand Maven / Gradle / Ivy

Go to download

MiTCR is an open source software package aimed at extraction of information on repertoire of T-cell clones from Next Generation Sequencing (NGS) data. It is designed with the knowledge of the critical challenges arising in everyday processing of immunological data.

The newest version!
/*
 * MiTCR 
 *
 * Copyright (c) 2010-2013:
 *     Bolotin Dmitriy     
 *     Chudakov Dmitriy    
 *
 * MiTCR is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation, either version 3 of the License, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program. If not, see .
 */
package com.milaboratory.mitcr.cdrextraction;

import java.util.HashMap;
import java.util.Map;

/**
 * Strand to perform search on.
 */
public enum Strand {
    Forward(0, "Forward", "forward", true, false),
    ReverseComplement(1, "Reverse Complement", "reverseComplement", false, true),
    Both(-1, "Both", "both", true, true);
    private static Map xmlMap;
    private int id;
    private final boolean forward, reverse;
    private String name;
    private String xmlRepresentation;

    private Strand(int id, String name, String xmlRepresentation,
                   boolean forward, boolean reverse) {
        this.id = id;
        this.name = name;
        this.xmlRepresentation = xmlRepresentation;
        this.forward = forward;
        this.reverse = reverse;
    }

    public String getXmlRepresentation() {
        return xmlRepresentation;
    }

    public int id() {
        return id;
    }

    public boolean isForward() {
        return forward;
    }

    public boolean isReverse() {
        return reverse;
    }

    public static Strand fromXML(String xml) {
        return xmlMap.get(xml);
    }

    @Override
    public String toString() {
        return name;
    }

    static {
        xmlMap = new HashMap();
        for (Strand s : values())
            xmlMap.put(s.xmlRepresentation, s);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy