Package ca.ualberta.stothard.cgview
Class CgviewFactoryTab
java.lang.Object
ca.ualberta.stothard.cgview.CgviewFactoryTab
- All Implemented Interfaces:
CgviewConstants
This class reads a tab-delimited feature file and creates a Cgview object.
- Author:
- Paul Stothard
-
Field Summary
Fields inherited from interface ca.ualberta.stothard.cgview.CgviewConstants
BASES, BOUNDS_BUTTON, BOUNDS_FEATURE, BOUNDS_RULER, CENTISOMES, DECORATION_CLOCKWISE_ARROW, DECORATION_COUNTERCLOCKWISE_ARROW, DECORATION_HIDDEN, DECORATION_STANDARD, DIRECT_STRAND, INNER_LABELS_AUTO, INNER_LABELS_NO_SHOW, INNER_LABELS_SHOW, LABEL, LABEL_FORCE, LABEL_NONE, LABEL_ZOOMED, LEGEND_DRAW_ZOOMED, LEGEND_ITEM_ALIGN_CENTER, LEGEND_ITEM_ALIGN_LEFT, LEGEND_ITEM_ALIGN_RIGHT, LEGEND_LOWER_CENTER, LEGEND_LOWER_LEFT, LEGEND_LOWER_RIGHT, LEGEND_MIDDLE_CENTER, LEGEND_MIDDLE_LEFT, LEGEND_MIDDLE_LEFT_OF_CENTER, LEGEND_MIDDLE_RIGHT, LEGEND_MIDDLE_RIGHT_OF_CENTER, LEGEND_NO_DRAW_ZOOMED, LEGEND_UPPER_CENTER, LEGEND_UPPER_LEFT, LEGEND_UPPER_RIGHT, POSITIONS_AUTO, POSITIONS_NO_SHOW, POSITIONS_SHOW, REVERSE_STRAND, SWATCH_NO_SHOW, SWATCH_SHOW
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addFeature
(String strand, int slot, int start, int stop, float opacity, float thickness, float radius, String type, String label, String mouseover, String hyperlink) Add a feature to this map.createCgviewFromFile
(String filename) Generates a Cgview object from an tab-delimited feature file.createCgviewFromURL
(URL url) Generates a Cgview object from an tab-delimited feature file.void
setHeight
(int height) Sets the height of the map.void
setLabelFontSize
(int size) Sets the font size of feature labels.void
setLegendFontSize
(int size) Sets the font size of legends.void
setMapItemSizeAdjustment
(float adjustment) void
setReadDimension
(boolean readDimension) Sets whether or not canvas dimension information should be read from the input file.void
setRulerFontSize
(int size) Sets the font size of the sequence ruler.void
setShowWarning
(boolean showWarning) Sets whether or not a warning is shown.void
setTickDensity
(double density) Sets the tick density.void
setWidth
(int width) Sets the width of the map.
-
Constructor Details
-
CgviewFactoryTab
public CgviewFactoryTab()Constructs a new CgviewFactoryTab object.
-
-
Method Details
-
createCgviewFromFile
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
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, score_II, misc, 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.
-
setShowWarning
public void setShowWarning(boolean showWarning) Sets whether or not a warning is shown.- Parameters:
showWarning
- whether or not a warning is shown.
-
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.
-