Class CgviewFactoryPtt

java.lang.Object
ca.ualberta.stothard.cgview.CgviewFactoryPtt
All Implemented Interfaces:
CgviewConstants

public class CgviewFactoryPtt extends Object implements CgviewConstants
This class reads a tab-delimited feature file and creates a Cgview object.
Author:
Paul Stothard
  • Constructor Details

    • CgviewFactoryPtt

      public CgviewFactoryPtt()
      Constructs a new CgviewFactoryPtt object.
  • Method Details

    • createCgviewFromFile

      public Cgview createCgviewFromFile(String filename) throws Exception, IOException
      Generates a Cgview object from an tab-delimited feature file.
      Parameters:
      filename - the file to read.
      Returns:
      the newly created Cgview object.
      Throws:
      Exception
      IOException
    • createCgviewFromURL

      public Cgview createCgviewFromURL(URL url) throws Exception, IOException
      Generates a Cgview object from an tab-delimited feature file.
      Parameters:
      url - the URL of the tab-delimited file to read.
      Returns:
      the newly created Cgview object.
      Throws:
      Exception
      IOException
    • addFeature

      public void addFeature(String strand, int slot, int start, int stop, float opacity, float thickness, float radius, String type, String label, String mouseover, String hyperlink) throws Exception
      Add a feature to this map. Note that the start of the feature should be a smaller number than the stop of the feature, regardless of the strand. The only case where start is larger than the stop is when the feature runs across the start/stop boundary, for example 6899-10 on a 7000bp plasmid.
      Parameters:
      strand - one of the following: forward, reverse.
      slot - one of the following: 1, 2, 3, 4, 5, 6.
      start - the start position of the feature. Must be between 1 and the length of the plasmid.
      stop - the end position of the feature. Must be between 1 and the length of the plasmid.
      opacity - the opacity of the feature.
      thickness - the thickness of the feature.
      radius - the radius of the feature.
      type - one of the following: origin_of_replication, promoter, terminator, regulatory_sequence, unique_restriction_site, restriction_site, open_reading_frame, gene, predicted_gene, sequence_similarity, score, primer.
      label - the label to show or empty String.
      mouseover - the mouseover to show or empty String.
      hyperlink - the label hyperlink or empty String.
      Throws:
      Exception
    • setReadDimension

      public void setReadDimension(boolean readDimension)
      Sets whether or not canvas dimension information should be read from the input file.
      Parameters:
      readDimension - whether or not to read the canvas dimension from the input file.
    • setWidth

      public void setWidth(int width)
      Sets the width of the map. Use this method before calling createCgviewFromURL() or createCgviewFromFile() to specify the default image width.
      Parameters:
      width - the width of the map.
    • setHeight

      public void setHeight(int height)
      Sets the height of the map. Use this method before calling createCgviewFromURL() or createCgviewFromFile() to specify the default image height.
      Parameters:
      height - the height of the map.
    • setMapItemSizeAdjustment

      public void setMapItemSizeAdjustment(float adjustment)
    • setLabelFontSize

      public void setLabelFontSize(int size)
      Sets the font size of feature labels. Use this method before calling createCgviewFromURL() or createCgviewFromFile().
      Parameters:
      size - the font size of feature labels.
    • setRulerFontSize

      public void setRulerFontSize(int size)
      Sets the font size of the sequence ruler. Use this method before calling createCgviewFromURL() or createCgviewFromFile().
      Parameters:
      size - the font size of the sequence ruler.
    • setLegendFontSize

      public void setLegendFontSize(int size)
      Sets the font size of legends. Use this method before calling createCgviewFromURL() or createCgviewFromFile().
      Parameters:
      size - the font size of legends.
    • setTickDensity

      public void setTickDensity(double density)
      Sets the tick density.
      Parameters:
      density - a double between 0.0 and 1.0, with 1.0 being more dense.