package jalview.datamodel; import jalview.util.MapList; /** * A data bean to model one or more contiguous regions on one chromosome */ public class GeneLoci { /* * implemented as an adapter over DBRefEntry with * source -> species id * version -> reference * accession -> chromosome */ private DBRefEntry loci; boolean forwardStrand; /** * Constructor * * @param taxon * @param ref * @param chrId * @param map * @param forward */ public GeneLoci(String taxon, String ref, String chrId, MapList map, boolean forward) { loci = new DBRefEntry(taxon, ref, chrId, new Mapping(map)); forwardStrand = forward; } /** * Answers the identifier for the species * * @return */ public String getSpecies() { return loci.getSource(); } /** * Answers the identifier for the genomic reference assembly */ public String getReference() { return loci.getVersion(); } /** * Answers the chromosome identifier * * @return */ public String getChromosome() { return loci.getAccessionId(); } /** * Answers the mapping from sequence positions (in sequence start..end * coordinates) to the corresponding loci in the chromosome (in reference * assembly coordinates, base 1) * * @return */ public MapList getMapping() { return loci.getMap().getMap(); } public boolean isForwardStrand() { return forwardStrand; } }