Merge branch 'develop' into features/JAL-1793VCF
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 10 Oct 2017 07:35:30 +0000 (08:35 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 10 Oct 2017 07:35:30 +0000 (08:35 +0100)
1  2 
src/jalview/datamodel/Sequence.java

@@@ -89,7 -89,7 +89,7 @@@ public class Sequence extends ASequenc
     */
    int index = -1;
  
-   private SequenceFeatures sequenceFeatureStore;
+   private SequenceFeaturesI sequenceFeatureStore;
  
    /*
     * A cursor holding the approximate current view position to the sequence,
    }
  
    /**
 -   * DOCUMENT ME!
 +   * Sets the sequence description, and also parses out any special formats of
 +   * interest
     * 
     * @param desc
 -   *          DOCUMENT ME!
     */
    @Override
    public void setDescription(String desc)
      this.description = desc;
    }
  
 +  @Override
 +  public void setGeneLoci(String speciesId, String assemblyId,
 +          String chromosomeId, MapList map)
 +  {
 +    addDBRef(new DBRefEntry(speciesId, assemblyId, DBRefEntry.CHROMOSOME
 +            + ":" + chromosomeId, new Mapping(map)));
 +  }
 +
    /**
 -   * DOCUMENT ME!
 +   * Returns the gene loci mapping for the sequence (may be null)
     * 
 -   * @return DOCUMENT ME!
 +   * @return
 +   */
 +  @Override
 +  public GeneLociI getGeneLoci()
 +  {
 +    DBRefEntry[] refs = getDBRefs();
 +    if (refs != null)
 +    {
 +      for (final DBRefEntry ref : refs)
 +      {
 +        if (ref.isChromosome())
 +        {
 +          return new GeneLociI()
 +          {
 +            @Override
 +            public String getSpeciesId()
 +            {
 +              return ref.getSource();
 +            }
 +
 +            @Override
 +            public String getAssemblyId()
 +            {
 +              return ref.getVersion();
 +            }
 +
 +            @Override
 +            public String getChromosomeId()
 +            {
 +              // strip of "chromosome:" prefix to chrId
 +              return ref.getAccessionId().substring(
 +                      DBRefEntry.CHROMOSOME.length() + 1);
 +            }
 +
 +            @Override
 +            public MapList getMap()
 +            {
 +              return ref.getMap().getMap();
 +            }
 +          };
 +        }
 +      }
 +    }
 +    return null;
 +  }
 +
 +  /**
 +   * Answers the description
 +   * 
 +   * @return
     */
    @Override
    public String getDescription()