2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.datamodel;
23 import jalview.util.MapList;
26 * A specialisation of DBRefEntry used to hold the chromosomal coordinates for a
27 * (typically gene) sequence
29 * <li>field <code>source</code> is used to hold a species id e.g. human</li>
30 * <li>field <code>version</code> is used to hold assembly id e.g GRCh38</li>
31 * <li>field <code>accession</code> is used to hold the chromosome id</li>
32 * <li>field <code>map</code> is used to hold the mapping from sequence to
33 * chromosome coordinates</li>
39 public class GeneLocus extends DBRefEntry implements GeneLociI
42 * Constructor adapts species, assembly, chromosome to DBRefEntry source,
43 * version, accession, respectively, and saves the mapping of sequence to
44 * chromosomal coordinates
51 public GeneLocus(String speciesId, String assemblyId, String chromosomeId,
54 super(speciesId, assemblyId, chromosomeId, mapping);
64 public GeneLocus(String speciesId, String assemblyId, String chromosomeId)
66 this(speciesId, assemblyId, chromosomeId, null);
70 public boolean equals(Object o)
72 return o instanceof GeneLocus && super.equals(o);
76 public MapList getMapping()
78 return map == null ? null : map.getMap();
82 * Answers the species identifier e.g. "human", stored as field
83 * <code>source</code> of DBRefEntry
86 public String getSpeciesId()
92 * Answers the genome assembly id e.g. "GRCh38", stored as field
93 * <code>version</code> of DBRefEntry
96 public String getAssemblyId()
102 * Answers the chromosome identifier e.g. "X", stored as field
103 * <code>accession</code> of DBRefEntry
106 public String getChromosomeId()
108 return getAccessionId();