bio-svgenes 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.DS_Store +0 -0
- data/VERSION +1 -1
- data/bio-svgenes.gemspec +59 -4
- data/doc/.DS_Store +0 -0
- data/doc/Bio.html +141 -0
- data/doc/Bio/.DS_Store +0 -0
- data/doc/Bio/Graphics.html +147 -0
- data/doc/Bio/Graphics/Glyph.html +1061 -0
- data/doc/Bio/Graphics/MiniFeature.html +342 -0
- data/doc/Bio/Graphics/Page.html +1200 -0
- data/doc/Bio/Graphics/Primitive.html +278 -0
- data/doc/Bio/Graphics/SVGEE.html +471 -0
- data/doc/Bio/Graphics/Track.html +506 -0
- data/doc/LICENSE_txt.html +118 -0
- data/doc/created.rid +9 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +94 -0
- data/doc/js/darkfish.js +155 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/rdoc.css +595 -0
- data/doc/table_of_contents.html +162 -0
- data/test/gene.gff +4 -0
- data/test/json_config.json +17 -0
- data/test/test_glyph.rb +33 -0
- data/test/test_mini_feature.rb +37 -0
- data/test/test_page.rb +127 -0
- data/test/test_primitive.rb +45 -0
- data/test/test_svgee.rb +73 -0
- data/test/test_track.rb +53 -0
- data/test/test_transcripts.gff +4 -0
- metadata +94 -14
data/.DS_Store
CHANGED
|
Binary file
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.3.0
|
data/bio-svgenes.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = "bio-svgenes"
|
|
8
|
-
s.version = "0.
|
|
8
|
+
s.version = "0.3.0"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Dan MacLean"]
|
|
12
|
-
s.date = "2013-
|
|
12
|
+
s.date = "2013-03-04"
|
|
13
13
|
s.description = "This bio-gem facilitates the creation of pretty, publication quality SVG images from feature data."
|
|
14
14
|
s.email = "maclean.daniel@gmail.com"
|
|
15
15
|
s.extra_rdoc_files = [
|
|
@@ -26,6 +26,52 @@ Gem::Specification.new do |s|
|
|
|
26
26
|
"Rakefile",
|
|
27
27
|
"VERSION",
|
|
28
28
|
"bio-svgenes.gemspec",
|
|
29
|
+
"doc/.DS_Store",
|
|
30
|
+
"doc/Bio.html",
|
|
31
|
+
"doc/Bio/.DS_Store",
|
|
32
|
+
"doc/Bio/Graphics.html",
|
|
33
|
+
"doc/Bio/Graphics/Glyph.html",
|
|
34
|
+
"doc/Bio/Graphics/MiniFeature.html",
|
|
35
|
+
"doc/Bio/Graphics/Page.html",
|
|
36
|
+
"doc/Bio/Graphics/Primitive.html",
|
|
37
|
+
"doc/Bio/Graphics/SVGEE.html",
|
|
38
|
+
"doc/Bio/Graphics/Track.html",
|
|
39
|
+
"doc/LICENSE_txt.html",
|
|
40
|
+
"doc/created.rid",
|
|
41
|
+
"doc/images/add.png",
|
|
42
|
+
"doc/images/arrow_up.png",
|
|
43
|
+
"doc/images/brick.png",
|
|
44
|
+
"doc/images/brick_link.png",
|
|
45
|
+
"doc/images/bug.png",
|
|
46
|
+
"doc/images/bullet_black.png",
|
|
47
|
+
"doc/images/bullet_toggle_minus.png",
|
|
48
|
+
"doc/images/bullet_toggle_plus.png",
|
|
49
|
+
"doc/images/date.png",
|
|
50
|
+
"doc/images/delete.png",
|
|
51
|
+
"doc/images/find.png",
|
|
52
|
+
"doc/images/loadingAnimation.gif",
|
|
53
|
+
"doc/images/macFFBgHack.png",
|
|
54
|
+
"doc/images/package.png",
|
|
55
|
+
"doc/images/page_green.png",
|
|
56
|
+
"doc/images/page_white_text.png",
|
|
57
|
+
"doc/images/page_white_width.png",
|
|
58
|
+
"doc/images/plugin.png",
|
|
59
|
+
"doc/images/ruby.png",
|
|
60
|
+
"doc/images/tag_blue.png",
|
|
61
|
+
"doc/images/tag_green.png",
|
|
62
|
+
"doc/images/transparent.png",
|
|
63
|
+
"doc/images/wrench.png",
|
|
64
|
+
"doc/images/wrench_orange.png",
|
|
65
|
+
"doc/images/zoom.png",
|
|
66
|
+
"doc/index.html",
|
|
67
|
+
"doc/js/darkfish.js",
|
|
68
|
+
"doc/js/jquery.js",
|
|
69
|
+
"doc/js/navigation.js",
|
|
70
|
+
"doc/js/search.js",
|
|
71
|
+
"doc/js/search_index.js",
|
|
72
|
+
"doc/js/searcher.js",
|
|
73
|
+
"doc/rdoc.css",
|
|
74
|
+
"doc/table_of_contents.html",
|
|
29
75
|
"examples/.DS_Store",
|
|
30
76
|
"examples/annotate_snps.rb",
|
|
31
77
|
"examples/data.txt",
|
|
@@ -49,13 +95,22 @@ Gem::Specification.new do |s|
|
|
|
49
95
|
"lib/bio/graphics/primitive.rb",
|
|
50
96
|
"lib/bio/graphics/svgee.rb",
|
|
51
97
|
"lib/bio/graphics/track.rb",
|
|
98
|
+
"test/gene.gff",
|
|
52
99
|
"test/helper.rb",
|
|
53
|
-
"test/
|
|
100
|
+
"test/json_config.json",
|
|
101
|
+
"test/test_bio-svgenes.rb",
|
|
102
|
+
"test/test_glyph.rb",
|
|
103
|
+
"test/test_mini_feature.rb",
|
|
104
|
+
"test/test_page.rb",
|
|
105
|
+
"test/test_primitive.rb",
|
|
106
|
+
"test/test_svgee.rb",
|
|
107
|
+
"test/test_track.rb",
|
|
108
|
+
"test/test_transcripts.gff"
|
|
54
109
|
]
|
|
55
110
|
s.homepage = "http://github.com/danmaclean/bioruby-svgenes"
|
|
56
111
|
s.licenses = ["MIT"]
|
|
57
112
|
s.require_paths = ["lib"]
|
|
58
|
-
s.rubygems_version = "1.8.
|
|
113
|
+
s.rubygems_version = "1.8.25"
|
|
59
114
|
s.summary = "Create pretty SVG-format images of features, gene models and data tracks"
|
|
60
115
|
|
|
61
116
|
if s.respond_to? :specification_version then
|
data/doc/.DS_Store
ADDED
|
Binary file
|
data/doc/Bio.html
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
|
6
|
+
|
|
7
|
+
<title>module Bio - RDoc Documentation</title>
|
|
8
|
+
|
|
9
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
|
10
|
+
|
|
11
|
+
<script type="text/javascript">
|
|
12
|
+
var rdoc_rel_prefix = "./";
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
|
16
|
+
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
|
17
|
+
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
|
18
|
+
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
|
19
|
+
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
|
20
|
+
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<body id="top" class="module">
|
|
24
|
+
<nav id="metadata">
|
|
25
|
+
<nav id="home-section" class="section">
|
|
26
|
+
<h3 class="section-header">
|
|
27
|
+
<a href="./index.html">Home</a>
|
|
28
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
|
29
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
|
30
|
+
</h3>
|
|
31
|
+
</nav>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
36
|
+
<h3 class="section-header">
|
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
39
|
+
</h3>
|
|
40
|
+
</form>
|
|
41
|
+
|
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
|
43
|
+
</nav>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
<div id="file-metadata">
|
|
49
|
+
<nav id="file-list-section" class="section">
|
|
50
|
+
<h3 class="section-header">Defined In</h3>
|
|
51
|
+
<ul>
|
|
52
|
+
<li>lib/bio/graphics/glyph.rb
|
|
53
|
+
<li>lib/bio/graphics/mini_feature.rb
|
|
54
|
+
<li>lib/bio/graphics/page.rb
|
|
55
|
+
<li>lib/bio/graphics/primitive.rb
|
|
56
|
+
<li>lib/bio/graphics/svgee.rb
|
|
57
|
+
<li>lib/bio/graphics/track.rb
|
|
58
|
+
</ul>
|
|
59
|
+
</nav>
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div id="class-metadata">
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div id="project-metadata">
|
|
73
|
+
<nav id="fileindex-section" class="section project-section">
|
|
74
|
+
<h3 class="section-header">Pages</h3>
|
|
75
|
+
|
|
76
|
+
<ul>
|
|
77
|
+
|
|
78
|
+
<li class="file"><a href="./LICENSE_txt.html">LICENSE</a>
|
|
79
|
+
|
|
80
|
+
</ul>
|
|
81
|
+
</nav>
|
|
82
|
+
|
|
83
|
+
<nav id="classindex-section" class="section project-section">
|
|
84
|
+
<h3 class="section-header">Class and Module Index</h3>
|
|
85
|
+
|
|
86
|
+
<ul class="link-list">
|
|
87
|
+
|
|
88
|
+
<li><a href="./Bio.html">Bio</a>
|
|
89
|
+
|
|
90
|
+
<li><a href="./Bio/Graphics.html">Bio::Graphics</a>
|
|
91
|
+
|
|
92
|
+
<li><a href="./Bio/Graphics/Glyph.html">Bio::Graphics::Glyph</a>
|
|
93
|
+
|
|
94
|
+
<li><a href="./Bio/Graphics/MiniFeature.html">Bio::Graphics::MiniFeature</a>
|
|
95
|
+
|
|
96
|
+
<li><a href="./Bio/Graphics/Page.html">Bio::Graphics::Page</a>
|
|
97
|
+
|
|
98
|
+
<li><a href="./Bio/Graphics/Primitive.html">Bio::Graphics::Primitive</a>
|
|
99
|
+
|
|
100
|
+
<li><a href="./Bio/Graphics/SVGEE.html">Bio::Graphics::SVGEE</a>
|
|
101
|
+
|
|
102
|
+
<li><a href="./Bio/Graphics/Track.html">Bio::Graphics::Track</a>
|
|
103
|
+
|
|
104
|
+
</ul>
|
|
105
|
+
</nav>
|
|
106
|
+
|
|
107
|
+
</div>
|
|
108
|
+
</nav>
|
|
109
|
+
|
|
110
|
+
<div id="documentation">
|
|
111
|
+
<h1 class="module">module Bio</h1>
|
|
112
|
+
|
|
113
|
+
<div id="description" class="description">
|
|
114
|
+
|
|
115
|
+
</div><!-- description -->
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
<!-- Methods -->
|
|
130
|
+
|
|
131
|
+
</section><!-- 5Buntitled-5D -->
|
|
132
|
+
|
|
133
|
+
</div><!-- documentation -->
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
<footer id="validator-badges">
|
|
137
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
|
138
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.rc.2.1.
|
|
139
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
|
140
|
+
</footer>
|
|
141
|
+
|
data/doc/Bio/.DS_Store
ADDED
|
Binary file
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
|
6
|
+
|
|
7
|
+
<title>class Bio::Graphics - RDoc Documentation</title>
|
|
8
|
+
|
|
9
|
+
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">
|
|
10
|
+
|
|
11
|
+
<script type="text/javascript">
|
|
12
|
+
var rdoc_rel_prefix = "../";
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
|
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
|
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
|
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
|
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<body id="top" class="class">
|
|
24
|
+
<nav id="metadata">
|
|
25
|
+
<nav id="home-section" class="section">
|
|
26
|
+
<h3 class="section-header">
|
|
27
|
+
<a href="../index.html">Home</a>
|
|
28
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
|
29
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
|
30
|
+
</h3>
|
|
31
|
+
</nav>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
36
|
+
<h3 class="section-header">
|
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
39
|
+
</h3>
|
|
40
|
+
</form>
|
|
41
|
+
|
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
|
43
|
+
</nav>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
<div id="file-metadata">
|
|
49
|
+
<nav id="file-list-section" class="section">
|
|
50
|
+
<h3 class="section-header">Defined In</h3>
|
|
51
|
+
<ul>
|
|
52
|
+
<li>lib/bio/graphics/glyph.rb
|
|
53
|
+
<li>lib/bio/graphics/mini_feature.rb
|
|
54
|
+
<li>lib/bio/graphics/page.rb
|
|
55
|
+
<li>lib/bio/graphics/primitive.rb
|
|
56
|
+
<li>lib/bio/graphics/svgee.rb
|
|
57
|
+
<li>lib/bio/graphics/track.rb
|
|
58
|
+
</ul>
|
|
59
|
+
</nav>
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div id="class-metadata">
|
|
65
|
+
|
|
66
|
+
<nav id="parent-class-section" class="section">
|
|
67
|
+
<h3 class="section-header">Parent</h3>
|
|
68
|
+
|
|
69
|
+
<p class="link">Object
|
|
70
|
+
|
|
71
|
+
</nav>
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<div id="project-metadata">
|
|
79
|
+
<nav id="fileindex-section" class="section project-section">
|
|
80
|
+
<h3 class="section-header">Pages</h3>
|
|
81
|
+
|
|
82
|
+
<ul>
|
|
83
|
+
|
|
84
|
+
<li class="file"><a href="../LICENSE_txt.html">LICENSE</a>
|
|
85
|
+
|
|
86
|
+
</ul>
|
|
87
|
+
</nav>
|
|
88
|
+
|
|
89
|
+
<nav id="classindex-section" class="section project-section">
|
|
90
|
+
<h3 class="section-header">Class and Module Index</h3>
|
|
91
|
+
|
|
92
|
+
<ul class="link-list">
|
|
93
|
+
|
|
94
|
+
<li><a href="../Bio.html">Bio</a>
|
|
95
|
+
|
|
96
|
+
<li><a href="../Bio/Graphics.html">Bio::Graphics</a>
|
|
97
|
+
|
|
98
|
+
<li><a href="../Bio/Graphics/Glyph.html">Bio::Graphics::Glyph</a>
|
|
99
|
+
|
|
100
|
+
<li><a href="../Bio/Graphics/MiniFeature.html">Bio::Graphics::MiniFeature</a>
|
|
101
|
+
|
|
102
|
+
<li><a href="../Bio/Graphics/Page.html">Bio::Graphics::Page</a>
|
|
103
|
+
|
|
104
|
+
<li><a href="../Bio/Graphics/Primitive.html">Bio::Graphics::Primitive</a>
|
|
105
|
+
|
|
106
|
+
<li><a href="../Bio/Graphics/SVGEE.html">Bio::Graphics::SVGEE</a>
|
|
107
|
+
|
|
108
|
+
<li><a href="../Bio/Graphics/Track.html">Bio::Graphics::Track</a>
|
|
109
|
+
|
|
110
|
+
</ul>
|
|
111
|
+
</nav>
|
|
112
|
+
|
|
113
|
+
</div>
|
|
114
|
+
</nav>
|
|
115
|
+
|
|
116
|
+
<div id="documentation">
|
|
117
|
+
<h1 class="class">class Bio::Graphics</h1>
|
|
118
|
+
|
|
119
|
+
<div id="description" class="description">
|
|
120
|
+
|
|
121
|
+
</div><!-- description -->
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
<!-- Methods -->
|
|
136
|
+
|
|
137
|
+
</section><!-- 5Buntitled-5D -->
|
|
138
|
+
|
|
139
|
+
</div><!-- documentation -->
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
<footer id="validator-badges">
|
|
143
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
|
144
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.rc.2.1.
|
|
145
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
|
146
|
+
</footer>
|
|
147
|
+
|
|
@@ -0,0 +1,1061 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
|
6
|
+
|
|
7
|
+
<title>class Bio::Graphics::Glyph - RDoc Documentation</title>
|
|
8
|
+
|
|
9
|
+
<link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet">
|
|
10
|
+
|
|
11
|
+
<script type="text/javascript">
|
|
12
|
+
var rdoc_rel_prefix = "../../";
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../../js/navigation.js"></script>
|
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../../js/search_index.js"></script>
|
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../../js/search.js"></script>
|
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../../js/searcher.js"></script>
|
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../../js/darkfish.js"></script>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<body id="top" class="class">
|
|
24
|
+
<nav id="metadata">
|
|
25
|
+
<nav id="home-section" class="section">
|
|
26
|
+
<h3 class="section-header">
|
|
27
|
+
<a href="../../index.html">Home</a>
|
|
28
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
|
29
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
|
30
|
+
</h3>
|
|
31
|
+
</nav>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
36
|
+
<h3 class="section-header">
|
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
39
|
+
</h3>
|
|
40
|
+
</form>
|
|
41
|
+
|
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
|
43
|
+
</nav>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
<div id="file-metadata">
|
|
49
|
+
<nav id="file-list-section" class="section">
|
|
50
|
+
<h3 class="section-header">Defined In</h3>
|
|
51
|
+
<ul>
|
|
52
|
+
<li>lib/bio/graphics/glyph.rb
|
|
53
|
+
</ul>
|
|
54
|
+
</nav>
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div id="class-metadata">
|
|
60
|
+
|
|
61
|
+
<nav id="parent-class-section" class="section">
|
|
62
|
+
<h3 class="section-header">Parent</h3>
|
|
63
|
+
|
|
64
|
+
<p class="link">Object
|
|
65
|
+
|
|
66
|
+
</nav>
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
<!-- Method Quickref -->
|
|
71
|
+
<nav id="method-list-section" class="section">
|
|
72
|
+
<h3 class="section-header">Methods</h3>
|
|
73
|
+
|
|
74
|
+
<ul class="link-list">
|
|
75
|
+
|
|
76
|
+
<li ><a href="#method-c-circle">::circle</a>
|
|
77
|
+
|
|
78
|
+
<li ><a href="#method-c-directed">::directed</a>
|
|
79
|
+
|
|
80
|
+
<li ><a href="#method-c-down_triangle">::down_triangle</a>
|
|
81
|
+
|
|
82
|
+
<li ><a href="#method-c-generic">::generic</a>
|
|
83
|
+
|
|
84
|
+
<li ><a href="#method-c-gradient">::gradient</a>
|
|
85
|
+
|
|
86
|
+
<li ><a href="#method-c-gradients">::gradients</a>
|
|
87
|
+
|
|
88
|
+
<li ><a href="#method-c-label">::label</a>
|
|
89
|
+
|
|
90
|
+
<li ><a href="#method-c-scale">::scale</a>
|
|
91
|
+
|
|
92
|
+
<li ><a href="#method-c-span">::span</a>
|
|
93
|
+
|
|
94
|
+
<li ><a href="#method-c-transcript">::transcript</a>
|
|
95
|
+
|
|
96
|
+
<li ><a href="#method-c-up_triangle">::up_triangle</a>
|
|
97
|
+
|
|
98
|
+
</ul>
|
|
99
|
+
</nav>
|
|
100
|
+
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<div id="project-metadata">
|
|
104
|
+
<nav id="fileindex-section" class="section project-section">
|
|
105
|
+
<h3 class="section-header">Pages</h3>
|
|
106
|
+
|
|
107
|
+
<ul>
|
|
108
|
+
|
|
109
|
+
<li class="file"><a href="../../LICENSE_txt.html">LICENSE</a>
|
|
110
|
+
|
|
111
|
+
</ul>
|
|
112
|
+
</nav>
|
|
113
|
+
|
|
114
|
+
<nav id="classindex-section" class="section project-section">
|
|
115
|
+
<h3 class="section-header">Class and Module Index</h3>
|
|
116
|
+
|
|
117
|
+
<ul class="link-list">
|
|
118
|
+
|
|
119
|
+
<li><a href="../../Bio.html">Bio</a>
|
|
120
|
+
|
|
121
|
+
<li><a href="../../Bio/Graphics.html">Bio::Graphics</a>
|
|
122
|
+
|
|
123
|
+
<li><a href="../../Bio/Graphics/Glyph.html">Bio::Graphics::Glyph</a>
|
|
124
|
+
|
|
125
|
+
<li><a href="../../Bio/Graphics/MiniFeature.html">Bio::Graphics::MiniFeature</a>
|
|
126
|
+
|
|
127
|
+
<li><a href="../../Bio/Graphics/Page.html">Bio::Graphics::Page</a>
|
|
128
|
+
|
|
129
|
+
<li><a href="../../Bio/Graphics/Primitive.html">Bio::Graphics::Primitive</a>
|
|
130
|
+
|
|
131
|
+
<li><a href="../../Bio/Graphics/SVGEE.html">Bio::Graphics::SVGEE</a>
|
|
132
|
+
|
|
133
|
+
<li><a href="../../Bio/Graphics/Track.html">Bio::Graphics::Track</a>
|
|
134
|
+
|
|
135
|
+
</ul>
|
|
136
|
+
</nav>
|
|
137
|
+
|
|
138
|
+
</div>
|
|
139
|
+
</nav>
|
|
140
|
+
|
|
141
|
+
<div id="documentation">
|
|
142
|
+
<h1 class="class">class Bio::Graphics::Glyph</h1>
|
|
143
|
+
|
|
144
|
+
<div id="description" class="description">
|
|
145
|
+
|
|
146
|
+
<p>A <a href="Glyph.html">Glyph</a> is an array of <a
|
|
147
|
+
href="Primitive.html">Primitive</a> objects, holding information about the
|
|
148
|
+
type of <a href="Glyph.html">Glyph</a> being created. Each different type
|
|
149
|
+
of <a href="Glyph.html">Glyph</a> has different arguments, pertaining to
|
|
150
|
+
how the <a href="Glyph.html">Glyph</a> will be drawn and the parameters
|
|
151
|
+
provided to <a href="SVGEE.html">SVGEE</a>.</p>
|
|
152
|
+
|
|
153
|
+
</div><!-- description -->
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
<!-- Attributes -->
|
|
167
|
+
<section id="attribute-method-details" class="method-section section">
|
|
168
|
+
<h3 class="section-header">Attributes</h3>
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
<div id="attribute-i-glyphs" class="method-detail">
|
|
172
|
+
<div class="method-heading attribute-method-heading">
|
|
173
|
+
<span class="method-name">glyphs</span><span
|
|
174
|
+
class="attribute-access-type">[R]</span>
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
<div class="method-description">
|
|
178
|
+
|
|
179
|
+
<p>The different type of Glyphs are:</p>
|
|
180
|
+
<ul><li>
|
|
181
|
+
<p>generic</p>
|
|
182
|
+
</li><li>
|
|
183
|
+
<p>circle</p>
|
|
184
|
+
</li><li>
|
|
185
|
+
<p>directed</p>
|
|
186
|
+
</li><li>
|
|
187
|
+
<p>down_triangle</p>
|
|
188
|
+
</li><li>
|
|
189
|
+
<p>up_triangle</p>
|
|
190
|
+
</li><li>
|
|
191
|
+
<p>span</p>
|
|
192
|
+
</li><li>
|
|
193
|
+
<p>transcript</p>
|
|
194
|
+
</li><li>
|
|
195
|
+
<p>scale</p>
|
|
196
|
+
</li><li>
|
|
197
|
+
<p>label</p>
|
|
198
|
+
</li><li>
|
|
199
|
+
<p>histogram</p>
|
|
200
|
+
</li></ul>
|
|
201
|
+
|
|
202
|
+
</div>
|
|
203
|
+
</div>
|
|
204
|
+
|
|
205
|
+
</section><!-- attribute-method-details -->
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
<!-- Methods -->
|
|
209
|
+
|
|
210
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
|
211
|
+
<h3 class="section-header">Public Class Methods</h3>
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
<div id="method-c-circle" class="method-detail ">
|
|
215
|
+
|
|
216
|
+
<div class="method-heading">
|
|
217
|
+
<span class="method-name">circle</span><span
|
|
218
|
+
class="method-args">(args)</span>
|
|
219
|
+
|
|
220
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
221
|
+
|
|
222
|
+
</div>
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
<div class="method-description">
|
|
226
|
+
|
|
227
|
+
<p>Creates a circular <a href="Glyph.html">Glyph</a></p>
|
|
228
|
+
|
|
229
|
+
<p><code>args</code></p>
|
|
230
|
+
<ul><li>
|
|
231
|
+
<p>radius = the radius of the circle (10)</p>
|
|
232
|
+
</li><li>
|
|
233
|
+
<p>fill_color = the fill colour of the <a href="Glyph.html">Glyph</a>
|
|
234
|
+
(‘red’)</p>
|
|
235
|
+
</li><li>
|
|
236
|
+
<p>stroke = the outline colour of the <a href="Glyph.html">Glyph</a>
|
|
237
|
+
(“black”)</p>
|
|
238
|
+
</li><li>
|
|
239
|
+
<p>stroke_width = The width of the outline stroke (1)</p>
|
|
240
|
+
</li><li>
|
|
241
|
+
<p>style = the opacity of the fill color</p>
|
|
242
|
+
</li><li>
|
|
243
|
+
<p>x = x-axis centre of the circle</p>
|
|
244
|
+
</li><li>
|
|
245
|
+
<p>y = y-axis centre of the circle</p>
|
|
246
|
+
</li></ul>
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
<div class="method-source-code" id="circle-source">
|
|
252
|
+
<pre><span class="ruby-comment"># File lib/bio/graphics/glyph.rb, line 60</span>
|
|
253
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">circle</span>(<span class="ruby-identifier">args</span>)
|
|
254
|
+
<span class="ruby-identifier">args</span> = {
|
|
255
|
+
<span class="ruby-value">:radius</span> =<span class="ruby-operator">></span> <span class="ruby-value">10</span>,
|
|
256
|
+
<span class="ruby-value">:fill_color</span> =<span class="ruby-operator">></span> <span class="ruby-string">'red'</span>,
|
|
257
|
+
<span class="ruby-value">:stroke</span> =<span class="ruby-operator">></span> <span class="ruby-string">"black"</span>,
|
|
258
|
+
<span class="ruby-value">:stroke_width</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>,
|
|
259
|
+
<span class="ruby-value">:style</span> =<span class="ruby-operator">></span> <span class="ruby-string">""</span>}.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">args</span>)
|
|
260
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-value">:x_center</span>] = <span class="ruby-identifier">args</span>[<span class="ruby-value">:x</span>]
|
|
261
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-value">:y_center</span>] = <span class="ruby-identifier">args</span>[<span class="ruby-value">:y</span>]
|
|
262
|
+
[<span class="ruby-value">:x</span>, <span class="ruby-value">:y</span>].<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">e</span>)}
|
|
263
|
+
[<span class="ruby-constant">Bio</span><span class="ruby-operator">::</span><span class="ruby-constant">Graphics</span><span class="ruby-operator">::</span><span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:circle</span>, <span class="ruby-identifier">args</span>)]
|
|
264
|
+
<span class="ruby-keyword">end</span></pre>
|
|
265
|
+
</div><!-- circle-source -->
|
|
266
|
+
|
|
267
|
+
</div>
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
</div><!-- circle-method -->
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
<div id="method-c-directed" class="method-detail ">
|
|
276
|
+
|
|
277
|
+
<div class="method-heading">
|
|
278
|
+
<span class="method-name">directed</span><span
|
|
279
|
+
class="method-args">(args)</span>
|
|
280
|
+
|
|
281
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
282
|
+
|
|
283
|
+
</div>
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
<div class="method-description">
|
|
287
|
+
|
|
288
|
+
<p>Creates a polygon <a href="Glyph.html">Glyph</a> to indicate the direction
|
|
289
|
+
in which the <a href="Glyph.html">Glyph</a> is pointing <code>args</code></p>
|
|
290
|
+
<ul><li>
|
|
291
|
+
<p>width = the width of the feature</p>
|
|
292
|
+
</li><li>
|
|
293
|
+
<p>fill_color = the fill colour of the <a href="Glyph.html">Glyph</a>
|
|
294
|
+
(‘red’)</p>
|
|
295
|
+
</li><li>
|
|
296
|
+
<p>stroke = the outline colour of the <a href="Glyph.html">Glyph</a>
|
|
297
|
+
(“black”)</p>
|
|
298
|
+
</li><li>
|
|
299
|
+
<p>stroke_width = The width of the outline stroke (1)</p>
|
|
300
|
+
</li><li>
|
|
301
|
+
<p>style = the opacity of the fill color</p>
|
|
302
|
+
</li><li>
|
|
303
|
+
<p>strand = the strand on which the <a href="Glyph.html">Glyph</a> is located.
|
|
304
|
+
May be ‘+’ or ‘-’</p>
|
|
305
|
+
</li><li>
|
|
306
|
+
<p>points = the x and y axis points used to calculate the shape of the polygon</p>
|
|
307
|
+
</li><li>
|
|
308
|
+
<p>x = the co-ordinates of the <a href="Glyph.html">Glyph</a> for the x-axis</p>
|
|
309
|
+
</li><li>
|
|
310
|
+
<p>y = the co-ordinates of the <a href="Glyph.html">Glyph</a> for the y-axis</p>
|
|
311
|
+
</li></ul>
|
|
312
|
+
|
|
313
|
+
<p>The points of the polygon are calculated form the <code>x</code> and
|
|
314
|
+
<code>y</code> co-ordinates</p>
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
<div class="method-source-code" id="directed-source">
|
|
320
|
+
<pre><span class="ruby-comment"># File lib/bio/graphics/glyph.rb, line 85</span>
|
|
321
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">directed</span>(<span class="ruby-identifier">args</span>) <span class="ruby-comment">#:x, :y, :width :fill, :stroke :stroke_width, :style, :height</span>
|
|
322
|
+
<span class="ruby-identifier">args</span> = {
|
|
323
|
+
|
|
324
|
+
<span class="ruby-value">:height</span> =<span class="ruby-operator">></span> <span class="ruby-value">10</span>,
|
|
325
|
+
<span class="ruby-value">:fill_color</span> =<span class="ruby-operator">></span> <span class="ruby-string">'red'</span>,
|
|
326
|
+
<span class="ruby-value">:stroke</span> =<span class="ruby-operator">></span> <span class="ruby-string">"black"</span>,
|
|
327
|
+
<span class="ruby-value">:stroke_width</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>,
|
|
328
|
+
<span class="ruby-value">:style</span> =<span class="ruby-operator">></span> <span class="ruby-string">"fill-opacity:0.4;"</span>}.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">args</span>)
|
|
329
|
+
|
|
330
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:strand</span>] <span class="ruby-operator">==</span> <span class="ruby-string">'-'</span>
|
|
331
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-value">:points</span>] = <span class="ruby-node">"#{args[:x]},#{args[:y]} #{args[:x] + args[:width]},#{args[:y]} #{args[:x] + args[:width]},#{args[:y] + args[:height] } #{args[:x]},#{args[:y] + (args[:height])} #{args[:x] - (args[:height] * 0.2)},#{args[:y] + (args[:height]/2)}"</span>
|
|
332
|
+
<span class="ruby-keyword">else</span>
|
|
333
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-value">:points</span>] = <span class="ruby-node">"#{args[:x]},#{args[:y]} #{args[:x] + args[:width] - (args[:height] * 0.2)},#{args[:y]} #{args[:x] + args[:width]},#{args[:y] + (args[:height]/2) } #{args[:x] + args[:width] - (args[:height] * 0.2)},#{args[:y] + args[:height]} #{args[:x]},#{args[:y] + args[:height]}"</span>
|
|
334
|
+
|
|
335
|
+
<span class="ruby-keyword">end</span>
|
|
336
|
+
[<span class="ruby-constant">Bio</span><span class="ruby-operator">::</span><span class="ruby-constant">Graphics</span><span class="ruby-operator">::</span><span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:polygon</span>, <span class="ruby-identifier">args</span>)]
|
|
337
|
+
<span class="ruby-keyword">end</span></pre>
|
|
338
|
+
</div><!-- directed-source -->
|
|
339
|
+
|
|
340
|
+
</div>
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
</div><!-- directed-method -->
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
<div id="method-c-down_triangle" class="method-detail ">
|
|
349
|
+
|
|
350
|
+
<div class="method-heading">
|
|
351
|
+
<span class="method-name">down_triangle</span><span
|
|
352
|
+
class="method-args">(args)</span>
|
|
353
|
+
|
|
354
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
355
|
+
|
|
356
|
+
</div>
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
<div class="method-description">
|
|
360
|
+
|
|
361
|
+
<p>Creates a polygon <a href="Glyph.html">Glyph</a> for a downward-pointing
|
|
362
|
+
triangle <code>args</code></p>
|
|
363
|
+
<ul><li>
|
|
364
|
+
<p>height = the height of the <a href="Glyph.html">Glyph</a> (10)</p>
|
|
365
|
+
</li><li>
|
|
366
|
+
<p>fill_color = the fill colour of the <a href="Glyph.html">Glyph</a>
|
|
367
|
+
(‘red’)</p>
|
|
368
|
+
</li><li>
|
|
369
|
+
<p>stroke = the outline colour of the <a href="Glyph.html">Glyph</a>
|
|
370
|
+
(“black”)</p>
|
|
371
|
+
</li><li>
|
|
372
|
+
<p>stroke_width = The width of the outline stroke (1)</p>
|
|
373
|
+
</li><li>
|
|
374
|
+
<p>style = the opacity of the fill color (“fill-opacity:0.4;”)</p>
|
|
375
|
+
</li><li>
|
|
376
|
+
<p>x = the co-ordinates of the <a href="Glyph.html">Glyph</a> for the x-axis</p>
|
|
377
|
+
</li><li>
|
|
378
|
+
<p>y = the co-ordinates of the <a href="Glyph.html">Glyph</a> for the y-axis</p>
|
|
379
|
+
</li></ul>
|
|
380
|
+
|
|
381
|
+
<p>The points of the triangle are calculated form the <code>x</code> and
|
|
382
|
+
<code>y</code> co-ordinates</p>
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
<div class="method-source-code" id="down_triangle-source">
|
|
388
|
+
<pre><span class="ruby-comment"># File lib/bio/graphics/glyph.rb, line 113</span>
|
|
389
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">down_triangle</span>(<span class="ruby-identifier">args</span>) <span class="ruby-comment">#:x, :y, :width :fill, :stroke :stroke_width, :style, :height</span>
|
|
390
|
+
<span class="ruby-identifier">args</span> = {
|
|
391
|
+
|
|
392
|
+
<span class="ruby-value">:height</span> =<span class="ruby-operator">></span> <span class="ruby-value">10</span>,
|
|
393
|
+
<span class="ruby-value">:fill_color</span> =<span class="ruby-operator">></span> <span class="ruby-string">'red'</span>,
|
|
394
|
+
<span class="ruby-value">:stroke</span> =<span class="ruby-operator">></span> <span class="ruby-string">"black"</span>,
|
|
395
|
+
<span class="ruby-value">:stroke_width</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>,
|
|
396
|
+
<span class="ruby-value">:style</span> =<span class="ruby-operator">></span> <span class="ruby-string">"fill-opacity:0.4;"</span>}.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">args</span>)
|
|
397
|
+
|
|
398
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-value">:points</span>] = <span class="ruby-node">"#{args[:x]},#{args[:y]} #{args[:x] + args[:width]},#{args[:y]} #{ args[:x] + (args[:width]/2) },#{(args[:y] + args[:height]) }"</span>
|
|
399
|
+
[<span class="ruby-constant">Bio</span><span class="ruby-operator">::</span><span class="ruby-constant">Graphics</span><span class="ruby-operator">::</span><span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:polygon</span>, <span class="ruby-identifier">args</span>)]
|
|
400
|
+
<span class="ruby-keyword">end</span></pre>
|
|
401
|
+
</div><!-- down_triangle-source -->
|
|
402
|
+
|
|
403
|
+
</div>
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
</div><!-- down_triangle-method -->
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
<div id="method-c-generic" class="method-detail ">
|
|
412
|
+
|
|
413
|
+
<div class="method-heading">
|
|
414
|
+
<span class="method-name">generic</span><span
|
|
415
|
+
class="method-args">(args)</span>
|
|
416
|
+
|
|
417
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
418
|
+
|
|
419
|
+
</div>
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
<div class="method-description">
|
|
423
|
+
|
|
424
|
+
<p>Creates a generic glyph, which is a rectangle</p>
|
|
425
|
+
|
|
426
|
+
<p><code>args</code></p>
|
|
427
|
+
<ul><li>
|
|
428
|
+
<p>height = the height of the <a href="Glyph.html">Glyph</a> (10)</p>
|
|
429
|
+
</li><li>
|
|
430
|
+
<p>fill_color = the fill colour of the <a href="Glyph.html">Glyph</a>
|
|
431
|
+
(‘red’)</p>
|
|
432
|
+
</li><li>
|
|
433
|
+
<p>stroke = the outline colour of the <a href="Glyph.html">Glyph</a>
|
|
434
|
+
(“black”)</p>
|
|
435
|
+
</li><li>
|
|
436
|
+
<p>stroke_width = The width of the outline stroke (1)</p>
|
|
437
|
+
</li><li>
|
|
438
|
+
<p>x_round = x-axis radius of the ellipse used to round off the corners of the
|
|
439
|
+
rectangle (1)</p>
|
|
440
|
+
</li><li>
|
|
441
|
+
<p>y_round = y-axis radius of the ellipse used to round off the corners of the
|
|
442
|
+
rectangle (1)</p>
|
|
443
|
+
</li><li>
|
|
444
|
+
<p>style = the opacity of the fill color (“fill-opacity:0.4;”)</p>
|
|
445
|
+
</li><li>
|
|
446
|
+
<p>x = the co-ordinates of the <a href="Glyph.html">Glyph</a> for the x-axis</p>
|
|
447
|
+
</li><li>
|
|
448
|
+
<p>y = the co-ordinates of the <a href="Glyph.html">Glyph</a> for the y-axis</p>
|
|
449
|
+
</li></ul>
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
<div class="method-source-code" id="generic-source">
|
|
455
|
+
<pre><span class="ruby-comment"># File lib/bio/graphics/glyph.rb, line 37</span>
|
|
456
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">generic</span>(<span class="ruby-identifier">args</span>) <span class="ruby-comment">#:x, :y, :width :fill, :stroke :stroke_width, :style, :height, </span>
|
|
457
|
+
<span class="ruby-identifier">args</span> = {
|
|
458
|
+
<span class="ruby-value">:height</span> =<span class="ruby-operator">></span> <span class="ruby-value">10</span>,
|
|
459
|
+
<span class="ruby-value">:fill_color</span> =<span class="ruby-operator">></span> <span class="ruby-string">'red'</span>,
|
|
460
|
+
<span class="ruby-value">:stroke</span> =<span class="ruby-operator">></span> <span class="ruby-string">"black"</span>,
|
|
461
|
+
<span class="ruby-value">:stroke_width</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>,
|
|
462
|
+
<span class="ruby-value">:x_round</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>,
|
|
463
|
+
<span class="ruby-value">:y_round</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>,
|
|
464
|
+
<span class="ruby-value">:style</span> =<span class="ruby-operator">></span> <span class="ruby-string">"fill-opacity:0.4;"</span>}.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">args</span>)
|
|
465
|
+
[<span class="ruby-constant">Bio</span><span class="ruby-operator">::</span><span class="ruby-constant">Graphics</span><span class="ruby-operator">::</span><span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:rectangle</span>, <span class="ruby-identifier">args</span>)]
|
|
466
|
+
<span class="ruby-keyword">end</span></pre>
|
|
467
|
+
</div><!-- generic-source -->
|
|
468
|
+
|
|
469
|
+
</div>
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
</div><!-- generic-method -->
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
<div id="method-c-gradient" class="method-detail ">
|
|
478
|
+
|
|
479
|
+
<div class="method-heading">
|
|
480
|
+
<span class="method-name">gradient</span><span
|
|
481
|
+
class="method-args">(gradient)</span>
|
|
482
|
+
|
|
483
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
484
|
+
|
|
485
|
+
</div>
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
<div class="method-description">
|
|
489
|
+
|
|
490
|
+
<p>Sets the the type (linear or radial) and colour of gradient for a
|
|
491
|
+
pre-defined gradient along with the pertinent parameters for that type</p>
|
|
492
|
+
|
|
493
|
+
<p><code>args</code></p>
|
|
494
|
+
<ul><li>
|
|
495
|
+
<p>gradient = a pre-defined gradient</p>
|
|
496
|
+
</li></ul>
|
|
497
|
+
|
|
498
|
+
<p>The types of gradient are:</p>
|
|
499
|
+
<ul><li>
|
|
500
|
+
<p>red_white_h</p>
|
|
501
|
+
</li><li>
|
|
502
|
+
<p>green_white_h</p>
|
|
503
|
+
</li><li>
|
|
504
|
+
<p>blue_white_h</p>
|
|
505
|
+
</li><li>
|
|
506
|
+
<p>yellow_white_h</p>
|
|
507
|
+
</li><li>
|
|
508
|
+
<p>red_white_radial</p>
|
|
509
|
+
</li><li>
|
|
510
|
+
<p>green_white_radial</p>
|
|
511
|
+
</li><li>
|
|
512
|
+
<p>blue_white_radial</p>
|
|
513
|
+
</li><li>
|
|
514
|
+
<p>yellow_white_radial</p>
|
|
515
|
+
</li></ul>
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
<div class="method-source-code" id="gradient-source">
|
|
521
|
+
<pre><span class="ruby-comment"># File lib/bio/graphics/glyph.rb, line 367</span>
|
|
522
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">gradient</span>(<span class="ruby-identifier">gradient</span>)
|
|
523
|
+
<span class="ruby-identifier">type</span>, <span class="ruby-identifier">color</span> = <span class="ruby-keyword">case</span> <span class="ruby-identifier">gradient</span>
|
|
524
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:red_white_h</span>
|
|
525
|
+
[<span class="ruby-value">:linear</span>, <span class="ruby-string">"red"</span>]
|
|
526
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:green_white_h</span>
|
|
527
|
+
[<span class="ruby-value">:linear</span>, <span class="ruby-string">"green"</span>]
|
|
528
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:blue_white_h</span>
|
|
529
|
+
[<span class="ruby-value">:linear</span>, <span class="ruby-string">"blue"</span>]
|
|
530
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:yellow_white_h</span>
|
|
531
|
+
[<span class="ruby-value">:linear</span>, <span class="ruby-string">"yellow"</span>]
|
|
532
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:red_white_radial</span>
|
|
533
|
+
[<span class="ruby-value">:radial</span>, <span class="ruby-string">"red"</span>]
|
|
534
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:green_white_radial</span>
|
|
535
|
+
[<span class="ruby-value">:radial</span>, <span class="ruby-string">"green"</span>]
|
|
536
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:blue_white_radial</span>
|
|
537
|
+
[<span class="ruby-value">:radial</span>, <span class="ruby-string">"blue"</span>]
|
|
538
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:yellow_white_radial</span>
|
|
539
|
+
[<span class="ruby-value">:radial</span>, <span class="ruby-string">"yellow"</span>]
|
|
540
|
+
<span class="ruby-keyword">end</span>
|
|
541
|
+
|
|
542
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">type</span>
|
|
543
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:linear</span>
|
|
544
|
+
{<span class="ruby-value">:type</span> =<span class="ruby-operator">></span> <span class="ruby-value">:linear</span>,
|
|
545
|
+
<span class="ruby-value">:id</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">gradient</span>,
|
|
546
|
+
<span class="ruby-value">:x1</span> =<span class="ruby-operator">></span> <span class="ruby-value">0</span>, <span class="ruby-value">:y1</span> =<span class="ruby-operator">></span> <span class="ruby-value">0</span>,
|
|
547
|
+
<span class="ruby-value">:x2</span> =<span class="ruby-operator">></span> <span class="ruby-value">0</span>, <span class="ruby-value">:y2</span> =<span class="ruby-operator">></span> <span class="ruby-value">100</span>,
|
|
548
|
+
<span class="ruby-value">:stops</span> =<span class="ruby-operator">></span> [
|
|
549
|
+
{
|
|
550
|
+
<span class="ruby-value">:color</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">color</span>,
|
|
551
|
+
<span class="ruby-value">:offset</span> =<span class="ruby-operator">></span> <span class="ruby-value">0</span>,
|
|
552
|
+
<span class="ruby-value">:opacity=</span><span class="ruby-operator">></span> <span class="ruby-value">1</span>
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
<span class="ruby-value">:color</span> =<span class="ruby-operator">></span> <span class="ruby-string">"white"</span>,
|
|
556
|
+
<span class="ruby-value">:offset</span> =<span class="ruby-operator">></span> <span class="ruby-value">100</span>,
|
|
557
|
+
<span class="ruby-value">:opacity=</span><span class="ruby-operator">></span> <span class="ruby-value">1</span>
|
|
558
|
+
}
|
|
559
|
+
]
|
|
560
|
+
}
|
|
561
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:radial</span>
|
|
562
|
+
{
|
|
563
|
+
<span class="ruby-value">:type</span> =<span class="ruby-operator">></span> <span class="ruby-value">:radial</span>,
|
|
564
|
+
<span class="ruby-value">:id</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">gradient</span>,
|
|
565
|
+
<span class="ruby-value">:cx</span> =<span class="ruby-operator">></span> <span class="ruby-value">50</span>, <span class="ruby-value">:cy</span> =<span class="ruby-operator">></span> <span class="ruby-value">50</span>,
|
|
566
|
+
<span class="ruby-value">:r</span> =<span class="ruby-operator">></span> <span class="ruby-value">50</span>, <span class="ruby-value">:fx</span> =<span class="ruby-operator">></span> <span class="ruby-value">50</span>, <span class="ruby-value">:fy</span> =<span class="ruby-operator">></span> <span class="ruby-value">50</span>,
|
|
567
|
+
<span class="ruby-value">:stops</span> =<span class="ruby-operator">></span> [
|
|
568
|
+
{<span class="ruby-value">:offset</span> =<span class="ruby-operator">></span> <span class="ruby-value">0</span>,
|
|
569
|
+
<span class="ruby-value">:color</span> =<span class="ruby-operator">></span> <span class="ruby-string">"white"</span>,
|
|
570
|
+
<span class="ruby-value">:opacity</span> =<span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
<span class="ruby-value">:offset</span> =<span class="ruby-operator">></span> <span class="ruby-value">100</span>,
|
|
574
|
+
<span class="ruby-value">:color</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">color</span>,
|
|
575
|
+
<span class="ruby-value">:opacity</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>
|
|
576
|
+
}
|
|
577
|
+
]
|
|
578
|
+
}
|
|
579
|
+
<span class="ruby-keyword">end</span>
|
|
580
|
+
|
|
581
|
+
<span class="ruby-keyword">end</span></pre>
|
|
582
|
+
</div><!-- gradient-source -->
|
|
583
|
+
|
|
584
|
+
</div>
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
</div><!-- gradient-method -->
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
<div id="method-c-gradients" class="method-detail ">
|
|
593
|
+
|
|
594
|
+
<div class="method-heading">
|
|
595
|
+
<span class="method-name">gradients</span><span
|
|
596
|
+
class="method-args">()</span>
|
|
597
|
+
|
|
598
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
599
|
+
|
|
600
|
+
</div>
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
<div class="method-description">
|
|
604
|
+
|
|
605
|
+
<p>The list of pre-defined gradients</p>
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
<div class="method-source-code" id="gradients-source">
|
|
611
|
+
<pre><span class="ruby-comment"># File lib/bio/graphics/glyph.rb, line 348</span>
|
|
612
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">gradients</span> <span class="ruby-comment">#needs to know which of its gradients are predefined</span>
|
|
613
|
+
[<span class="ruby-value">:red_white_h</span>, <span class="ruby-value">:green_white_h</span>, <span class="ruby-value">:blue_white_h</span>, <span class="ruby-value">:yellow_white_h</span>, <span class="ruby-value">:red_white_radial</span>, <span class="ruby-value">:green_white_radial</span>, <span class="ruby-value">:blue_white_radial</span>, <span class="ruby-value">:yellow_white_radial</span> ]
|
|
614
|
+
<span class="ruby-keyword">end</span></pre>
|
|
615
|
+
</div><!-- gradients-source -->
|
|
616
|
+
|
|
617
|
+
</div>
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
</div><!-- gradients-method -->
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
<div id="method-c-label" class="method-detail ">
|
|
626
|
+
|
|
627
|
+
<div class="method-heading">
|
|
628
|
+
<span class="method-name">label</span><span
|
|
629
|
+
class="method-args">(args)</span>
|
|
630
|
+
|
|
631
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
632
|
+
|
|
633
|
+
</div>
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
<div class="method-description">
|
|
637
|
+
|
|
638
|
+
<p>Creates a label <a href="Glyph.html">Glyph</a> to write text</p>
|
|
639
|
+
|
|
640
|
+
<p><code>args</code></p>
|
|
641
|
+
<ul><li>
|
|
642
|
+
<p>text = the text to write</p>
|
|
643
|
+
</li><li>
|
|
644
|
+
<p>fill = the colour of the text (“black”)</p>
|
|
645
|
+
</li><li>
|
|
646
|
+
<p>style = the style of writing (“font-family:monospace;”)</p>
|
|
647
|
+
</li><li>
|
|
648
|
+
<p>x = the co-ordinates of the <a href="Glyph.html">Glyph</a> for the x-axis</p>
|
|
649
|
+
</li><li>
|
|
650
|
+
<p>y = the co-ordinates of the <a href="Glyph.html">Glyph</a> for the y-axis</p>
|
|
651
|
+
</li></ul>
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
<div class="method-source-code" id="label-source">
|
|
657
|
+
<pre><span class="ruby-comment"># File lib/bio/graphics/glyph.rb, line 339</span>
|
|
658
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">label</span>(<span class="ruby-identifier">args</span>)
|
|
659
|
+
[<span class="ruby-constant">Bio</span><span class="ruby-operator">::</span><span class="ruby-constant">Graphics</span><span class="ruby-operator">::</span><span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:text</span>,
|
|
660
|
+
<span class="ruby-value">:text</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:text</span>],
|
|
661
|
+
<span class="ruby-value">:x</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:x</span>],
|
|
662
|
+
<span class="ruby-value">:y</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:y</span>],
|
|
663
|
+
<span class="ruby-value">:fill</span> =<span class="ruby-operator">></span> <span class="ruby-string">"black"</span>,
|
|
664
|
+
<span class="ruby-value">:style</span> =<span class="ruby-operator">></span> <span class="ruby-string">"font-family:monospace;"</span>)]
|
|
665
|
+
<span class="ruby-keyword">end</span></pre>
|
|
666
|
+
</div><!-- label-source -->
|
|
667
|
+
|
|
668
|
+
</div>
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
</div><!-- label-method -->
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
<div id="method-c-scale" class="method-detail ">
|
|
677
|
+
|
|
678
|
+
<div class="method-heading">
|
|
679
|
+
<span class="method-name">scale</span><span
|
|
680
|
+
class="method-args">(args)</span>
|
|
681
|
+
|
|
682
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
683
|
+
|
|
684
|
+
</div>
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
<div class="method-description">
|
|
688
|
+
|
|
689
|
+
<p>Creates the scale across the top of the SVG page</p>
|
|
690
|
+
|
|
691
|
+
<p><code>args</code></p>
|
|
692
|
+
<ul><li>
|
|
693
|
+
<p>start = the start of the scale</p>
|
|
694
|
+
</li><li>
|
|
695
|
+
<p>stop = the end of the scale</p>
|
|
696
|
+
</li><li>
|
|
697
|
+
<p>number_of_intervals = the number of tick-marks on the scale to show the
|
|
698
|
+
current position</p>
|
|
699
|
+
</li><li>
|
|
700
|
+
<p>page_width = the width of the page</p>
|
|
701
|
+
</li></ul>
|
|
702
|
+
|
|
703
|
+
<p><code>returns</code></p>
|
|
704
|
+
<ul><li>
|
|
705
|
+
<p>An <a href="http://www.ruby-doc.org/core-2.0/Array.html">Array</a> of <a
|
|
706
|
+
href="Primitive.html">Primitive</a> objects (of type ‘line’,
|
|
707
|
+
‘rectangle’ and ‘text’)</p>
|
|
708
|
+
</li></ul>
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
<div class="method-source-code" id="scale-source">
|
|
714
|
+
<pre><span class="ruby-comment"># File lib/bio/graphics/glyph.rb, line 294</span>
|
|
715
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">scale</span>(<span class="ruby-identifier">args</span>)
|
|
716
|
+
<span class="ruby-identifier">first_mark</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">:start</span>]
|
|
717
|
+
<span class="ruby-identifier">last_mark</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">:stop</span>]
|
|
718
|
+
<span class="ruby-comment">#(num.to_f / @nt_per_px_x.to_f)</span>
|
|
719
|
+
<span class="ruby-identifier">full_dist</span> = <span class="ruby-identifier">last_mark</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">first_mark</span>
|
|
720
|
+
<span class="ruby-identifier">interval_width</span> = <span class="ruby-identifier">full_dist</span> <span class="ruby-operator">/</span> (<span class="ruby-identifier">args</span>[<span class="ruby-value">:number_of_intervals</span>] <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
<span class="ruby-identifier">a</span> = [<span class="ruby-constant">Bio</span><span class="ruby-operator">::</span><span class="ruby-constant">Graphics</span><span class="ruby-operator">::</span><span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:line</span>,
|
|
724
|
+
<span class="ruby-value">:stroke</span> =<span class="ruby-operator">></span> <span class="ruby-string">'black'</span>,
|
|
725
|
+
<span class="ruby-value">:stroke_width</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>,
|
|
726
|
+
<span class="ruby-value">:x1</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>, <span class="ruby-value">:x2</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:page_width</span>],<span class="ruby-comment"># * 1.1, </span>
|
|
727
|
+
<span class="ruby-value">:y1</span> =<span class="ruby-operator">></span> <span class="ruby-string">"20"</span>, <span class="ruby-value">:y2</span> =<span class="ruby-operator">></span> <span class="ruby-string">"20"</span> )]
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
<span class="ruby-identifier">marks</span> = (<span class="ruby-identifier">first_mark</span><span class="ruby-operator">..</span><span class="ruby-identifier">last_mark</span>).<span class="ruby-identifier">step</span>(<span class="ruby-identifier">interval_width</span>).<span class="ruby-identifier">to_a</span>
|
|
731
|
+
|
|
732
|
+
<span class="ruby-identifier">px_per_nt</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">:page_width</span>].<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">full_dist</span>.<span class="ruby-identifier">to_f</span>
|
|
733
|
+
<span class="ruby-identifier">marks</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">mark</span><span class="ruby-operator">|</span>
|
|
734
|
+
<span class="ruby-identifier">x</span> = (<span class="ruby-identifier">mark</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">first_mark</span> ).<span class="ruby-identifier">to_f</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">px_per_nt</span>
|
|
735
|
+
<span class="ruby-identifier">a</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Bio</span><span class="ruby-operator">::</span><span class="ruby-constant">Graphics</span><span class="ruby-operator">::</span><span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:rectangle</span>,
|
|
736
|
+
<span class="ruby-value">:x</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">x</span>,
|
|
737
|
+
<span class="ruby-value">:y</span> =<span class="ruby-operator">></span> <span class="ruby-value">20</span>,
|
|
738
|
+
<span class="ruby-value">:stroke</span> =<span class="ruby-operator">></span> <span class="ruby-string">'black'</span>,
|
|
739
|
+
<span class="ruby-value">:stroke_width</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>,
|
|
740
|
+
<span class="ruby-value">:width</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>,
|
|
741
|
+
<span class="ruby-value">:height</span> =<span class="ruby-operator">></span> <span class="ruby-value">5</span> )
|
|
742
|
+
|
|
743
|
+
<span class="ruby-identifier">a</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Bio</span><span class="ruby-operator">::</span><span class="ruby-constant">Graphics</span><span class="ruby-operator">::</span><span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:text</span>,
|
|
744
|
+
<span class="ruby-value">:x</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">x</span>,
|
|
745
|
+
<span class="ruby-value">:y</span> =<span class="ruby-operator">></span> <span class="ruby-value">40</span>, <span class="ruby-value">:fill</span> =<span class="ruby-operator">></span> <span class="ruby-string">'black'</span>,
|
|
746
|
+
<span class="ruby-value">:text</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">mark</span>,
|
|
747
|
+
<span class="ruby-value">:style</span> =<span class="ruby-operator">></span> <span class="ruby-string">"font-family:Arial;font-style:italic"</span>)
|
|
748
|
+
<span class="ruby-keyword">end</span>
|
|
749
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">a</span>
|
|
750
|
+
<span class="ruby-keyword">end</span></pre>
|
|
751
|
+
</div><!-- scale-source -->
|
|
752
|
+
|
|
753
|
+
</div>
|
|
754
|
+
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
|
|
758
|
+
</div><!-- scale-method -->
|
|
759
|
+
|
|
760
|
+
|
|
761
|
+
<div id="method-c-span" class="method-detail ">
|
|
762
|
+
|
|
763
|
+
<div class="method-heading">
|
|
764
|
+
<span class="method-name">span</span><span
|
|
765
|
+
class="method-args">(args)</span>
|
|
766
|
+
|
|
767
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
768
|
+
|
|
769
|
+
</div>
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
<div class="method-description">
|
|
773
|
+
|
|
774
|
+
<p>Creates a span glyph, which is a line</p>
|
|
775
|
+
|
|
776
|
+
<p><code>args</code></p>
|
|
777
|
+
<ul><li>
|
|
778
|
+
<p>height = the height of the <a href="Glyph.html">Glyph</a> (10)</p>
|
|
779
|
+
</li><li>
|
|
780
|
+
<p>fill_color = the fill colour of the <a href="Glyph.html">Glyph</a>
|
|
781
|
+
(‘red’)</p>
|
|
782
|
+
</li><li>
|
|
783
|
+
<p>stroke = the outline colour of the <a href="Glyph.html">Glyph</a>
|
|
784
|
+
(“black”)</p>
|
|
785
|
+
</li><li>
|
|
786
|
+
<p>stroke_width = The width of the outline stroke (1)</p>
|
|
787
|
+
</li><li>
|
|
788
|
+
<p>style = the opacity of the fill color (“fill-opacity:0.4;”)</p>
|
|
789
|
+
</li><li>
|
|
790
|
+
<p>x = the co-ordinates of the <a href="Glyph.html">Glyph</a> for the x-axis</p>
|
|
791
|
+
</li><li>
|
|
792
|
+
<p>y = the co-ordinates of the <a href="Glyph.html">Glyph</a> for the y-axis</p>
|
|
793
|
+
</li></ul>
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
|
|
798
|
+
<div class="method-source-code" id="span-source">
|
|
799
|
+
<pre><span class="ruby-comment"># File lib/bio/graphics/glyph.rb, line 156</span>
|
|
800
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">span</span>(<span class="ruby-identifier">args</span>)
|
|
801
|
+
<span class="ruby-identifier">args</span> = {
|
|
802
|
+
<span class="ruby-value">:height</span> =<span class="ruby-operator">></span> <span class="ruby-value">10</span>,
|
|
803
|
+
<span class="ruby-value">:fill_color</span> =<span class="ruby-operator">></span> <span class="ruby-string">'red'</span>,
|
|
804
|
+
<span class="ruby-value">:stroke</span> =<span class="ruby-operator">></span> <span class="ruby-string">"black"</span>,
|
|
805
|
+
<span class="ruby-value">:stroke_width</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>,
|
|
806
|
+
<span class="ruby-value">:style</span> =<span class="ruby-operator">></span> <span class="ruby-string">"fill-opacity:1;"</span>
|
|
807
|
+
}.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">args</span>)
|
|
808
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-value">:x1</span>] = <span class="ruby-identifier">args</span>[<span class="ruby-value">:x</span>]
|
|
809
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-value">:x2</span>] = <span class="ruby-identifier">args</span>[<span class="ruby-value">:x</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:width</span>]
|
|
810
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-value">:y1</span>] = <span class="ruby-identifier">args</span>[<span class="ruby-value">:y</span>]
|
|
811
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-value">:y2</span>] = <span class="ruby-identifier">args</span>[<span class="ruby-value">:y</span>]
|
|
812
|
+
[<span class="ruby-constant">Bio</span><span class="ruby-operator">::</span><span class="ruby-constant">Graphics</span><span class="ruby-operator">::</span><span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:line</span>, <span class="ruby-identifier">args</span>)]
|
|
813
|
+
<span class="ruby-keyword">end</span></pre>
|
|
814
|
+
</div><!-- span-source -->
|
|
815
|
+
|
|
816
|
+
</div>
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
|
|
821
|
+
</div><!-- span-method -->
|
|
822
|
+
|
|
823
|
+
|
|
824
|
+
<div id="method-c-transcript" class="method-detail ">
|
|
825
|
+
|
|
826
|
+
<div class="method-heading">
|
|
827
|
+
<span class="method-name">transcript</span><span
|
|
828
|
+
class="method-args">(args)</span>
|
|
829
|
+
|
|
830
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
831
|
+
|
|
832
|
+
</div>
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
<div class="method-description">
|
|
836
|
+
|
|
837
|
+
<p>Creates a transcript glyph, which is a number of different types of <a
|
|
838
|
+
href="Glyph.html">Glyph</a>, depending on the features within the
|
|
839
|
+
transcript</p>
|
|
840
|
+
|
|
841
|
+
<p><code>args</code></p>
|
|
842
|
+
<ul><li>
|
|
843
|
+
<p>height = the height of the <a href="Glyph.html">Glyph</a> (10)</p>
|
|
844
|
+
</li><li>
|
|
845
|
+
<p>utr_fill_color = the fill colour of the <a href="Glyph.html">Glyph</a>
|
|
846
|
+
(‘black’)</p>
|
|
847
|
+
</li><li>
|
|
848
|
+
<p>utr_stroke = the outline colour of the <a href="Glyph.html">Glyph</a>
|
|
849
|
+
(“black”)</p>
|
|
850
|
+
</li><li>
|
|
851
|
+
<p>utr_stroke_width = The width of the outline stroke (1)</p>
|
|
852
|
+
</li><li>
|
|
853
|
+
<p>exon_fill_color = the fill colour of the <a href="Glyph.html">Glyph</a>
|
|
854
|
+
(‘red’)</p>
|
|
855
|
+
</li><li>
|
|
856
|
+
<p>exon_stroke = the outline colour of the <a href="Glyph.html">Glyph</a>
|
|
857
|
+
(“black”)</p>
|
|
858
|
+
</li><li>
|
|
859
|
+
<p>exon_stroke_width = The width of the outline stroke (1)</p>
|
|
860
|
+
</li><li>
|
|
861
|
+
<p>line_color = the colour for any line Glyphs</p>
|
|
862
|
+
</li><li>
|
|
863
|
+
<p>line_width = the width for any line Glyphs</p>
|
|
864
|
+
</li><li>
|
|
865
|
+
<p>exon_style = the opacity of the fill color for exons
|
|
866
|
+
(“fill-opacity:0.4;”)</p>
|
|
867
|
+
</li><li>
|
|
868
|
+
<p>utr_style = the opacity of the fill color for utrs</p>
|
|
869
|
+
</li><li>
|
|
870
|
+
<p>line_style = the opacity of the fill color for lines</p>
|
|
871
|
+
</li><li>
|
|
872
|
+
<p>block_gaps = ****I’m not sure what these are****</p>
|
|
873
|
+
</li><li>
|
|
874
|
+
<p>gap_marker = ****I’m not sure what these are****</p>
|
|
875
|
+
</li><li>
|
|
876
|
+
<p>x = the co-ordinates of the <a href="Glyph.html">Glyph</a> for the x-axis</p>
|
|
877
|
+
</li><li>
|
|
878
|
+
<p>y = the co-ordinates of the <a href="Glyph.html">Glyph</a> for the y-axis</p>
|
|
879
|
+
</li></ul>
|
|
880
|
+
|
|
881
|
+
|
|
882
|
+
|
|
883
|
+
|
|
884
|
+
<div class="method-source-code" id="transcript-source">
|
|
885
|
+
<pre><span class="ruby-comment"># File lib/bio/graphics/glyph.rb, line 190</span>
|
|
886
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">transcript</span>(<span class="ruby-identifier">args</span>)
|
|
887
|
+
<span class="ruby-identifier">args</span> = {
|
|
888
|
+
<span class="ruby-value">:height</span> =<span class="ruby-operator">></span> <span class="ruby-value">10</span>,
|
|
889
|
+
<span class="ruby-value">:utr_fill_color</span> =<span class="ruby-operator">></span> <span class="ruby-string">'black'</span>,
|
|
890
|
+
<span class="ruby-value">:utr_stroke</span> =<span class="ruby-operator">></span> <span class="ruby-string">"black"</span>,
|
|
891
|
+
<span class="ruby-value">:utr_stroke_width</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>,
|
|
892
|
+
<span class="ruby-value">:exon_fill_color</span> =<span class="ruby-operator">></span> <span class="ruby-string">'red'</span>,
|
|
893
|
+
<span class="ruby-value">:exon_stroke</span> =<span class="ruby-operator">></span> <span class="ruby-string">"black"</span>,
|
|
894
|
+
<span class="ruby-value">:exon_stroke_width</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>,
|
|
895
|
+
<span class="ruby-value">:line_color</span> =<span class="ruby-operator">></span> <span class="ruby-string">'black'</span>,
|
|
896
|
+
<span class="ruby-value">:line_width</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>,
|
|
897
|
+
<span class="ruby-value">:exon_style</span> =<span class="ruby-operator">></span> <span class="ruby-string">"fill-opacity:0.4;"</span>,
|
|
898
|
+
<span class="ruby-value">:utr_style</span> =<span class="ruby-operator">></span> <span class="ruby-string">""</span>,
|
|
899
|
+
<span class="ruby-value">:line_style</span> =<span class="ruby-operator">></span> <span class="ruby-string">""</span>,
|
|
900
|
+
<span class="ruby-value">:block_gaps</span> =<span class="ruby-operator">></span> <span class="ruby-string">""</span>,
|
|
901
|
+
<span class="ruby-value">:gap_marker</span> =<span class="ruby-operator">></span> <span class="ruby-string">""</span>
|
|
902
|
+
}.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">args</span>)
|
|
903
|
+
|
|
904
|
+
<span class="ruby-identifier">composite</span> = []
|
|
905
|
+
|
|
906
|
+
<span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:utrs</span>].<span class="ruby-identifier">empty?</span> <span class="ruby-comment">##draw the utr as terminal element...##terminal utr is the one with the point on...</span>
|
|
907
|
+
<span class="ruby-identifier">x</span>,<span class="ruby-identifier">width</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">:strand</span>] <span class="ruby-operator">==</span> <span class="ruby-string">'-'</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:utrs</span>].<span class="ruby-identifier">shift</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:utrs</span>].<span class="ruby-identifier">pop</span>
|
|
908
|
+
<span class="ruby-identifier">composite</span> <span class="ruby-operator">+=</span> <span class="ruby-constant">Glyph</span>.<span class="ruby-identifier">directed</span>(<span class="ruby-value">:x</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">x</span>,
|
|
909
|
+
<span class="ruby-value">:y</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:y</span>],
|
|
910
|
+
<span class="ruby-value">:width</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">width</span>,
|
|
911
|
+
<span class="ruby-value">:strand</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:strand</span>],
|
|
912
|
+
<span class="ruby-value">:height</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:height</span>],
|
|
913
|
+
<span class="ruby-value">:fill_color</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:utr_fill_color</span>],
|
|
914
|
+
<span class="ruby-value">:stroke</span> =<span class="ruby-operator">></span><span class="ruby-identifier">args</span>[<span class="ruby-value">:utr_stroke</span>],
|
|
915
|
+
<span class="ruby-value">:stroke_width</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:utr_stroke_width</span>],
|
|
916
|
+
<span class="ruby-value">:style</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:utr_style</span>] )
|
|
917
|
+
<span class="ruby-comment">##draw the other(s!) </span>
|
|
918
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-value">:utrs</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">utr</span><span class="ruby-operator">|</span>
|
|
919
|
+
<span class="ruby-identifier">composite</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Bio</span><span class="ruby-operator">::</span><span class="ruby-constant">Graphics</span><span class="ruby-operator">::</span><span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:rectangle</span>, {
|
|
920
|
+
<span class="ruby-value">:x</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">utr</span>.<span class="ruby-identifier">first</span>,
|
|
921
|
+
<span class="ruby-value">:width</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">utr</span>.<span class="ruby-identifier">last</span>,
|
|
922
|
+
<span class="ruby-value">:y</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:y</span>],
|
|
923
|
+
<span class="ruby-value">:height</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:height</span>],
|
|
924
|
+
<span class="ruby-value">:fill_color</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:utr_fill_color</span>],
|
|
925
|
+
<span class="ruby-value">:stroke</span> =<span class="ruby-operator">></span><span class="ruby-identifier">args</span>[<span class="ruby-value">:utr_stroke</span>],
|
|
926
|
+
<span class="ruby-value">:stroke_width</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:utr_stroke_width</span>],
|
|
927
|
+
<span class="ruby-value">:style</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:utr_style</span>]} )
|
|
928
|
+
<span class="ruby-keyword">end</span>
|
|
929
|
+
<span class="ruby-keyword">else</span> <span class="ruby-comment">## draw the terminal exon as terminal element </span>
|
|
930
|
+
<span class="ruby-identifier">points</span> = <span class="ruby-keyword">nil</span>
|
|
931
|
+
<span class="ruby-identifier">x</span>,<span class="ruby-identifier">width</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">:strand</span>] <span class="ruby-operator">==</span> <span class="ruby-string">'-'</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:exons</span>].<span class="ruby-identifier">shift</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:exons</span>].<span class="ruby-identifier">pop</span>
|
|
932
|
+
<span class="ruby-identifier">composite</span> <span class="ruby-operator">+=</span> <span class="ruby-constant">Glyph</span>.<span class="ruby-identifier">directed</span>(<span class="ruby-value">:x</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">x</span>,
|
|
933
|
+
<span class="ruby-value">:y</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:y</span>],
|
|
934
|
+
<span class="ruby-value">:width</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">width</span>,
|
|
935
|
+
<span class="ruby-value">:strand</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:strand</span>],
|
|
936
|
+
<span class="ruby-value">:height</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:height</span>],
|
|
937
|
+
<span class="ruby-value">:fill_color</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:exon_fill_color</span>],
|
|
938
|
+
<span class="ruby-value">:stroke</span> =<span class="ruby-operator">></span><span class="ruby-identifier">args</span>[<span class="ruby-value">:exon_stroke</span>],
|
|
939
|
+
<span class="ruby-value">:stroke_width</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:exon_stroke_width</span>],
|
|
940
|
+
<span class="ruby-value">:style</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:exon_style</span>] )
|
|
941
|
+
<span class="ruby-keyword">end</span>
|
|
942
|
+
<span class="ruby-comment">#draw any remaining exons</span>
|
|
943
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-value">:exons</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">exon</span><span class="ruby-operator">|</span>
|
|
944
|
+
<span class="ruby-identifier">composite</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Bio</span><span class="ruby-operator">::</span><span class="ruby-constant">Graphics</span><span class="ruby-operator">::</span><span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:rectangle</span>, {
|
|
945
|
+
<span class="ruby-value">:x</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">exon</span>[<span class="ruby-value">0</span>],
|
|
946
|
+
<span class="ruby-value">:width</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">exon</span>[<span class="ruby-value">1</span>],
|
|
947
|
+
<span class="ruby-value">:y</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:y</span>],
|
|
948
|
+
<span class="ruby-value">:height</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:height</span>],
|
|
949
|
+
<span class="ruby-value">:fill_color</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:exon_fill_color</span>],
|
|
950
|
+
<span class="ruby-value">:stroke</span> =<span class="ruby-operator">></span><span class="ruby-identifier">args</span>[<span class="ruby-value">:exon_stroke</span>],
|
|
951
|
+
<span class="ruby-value">:stroke_width</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:exon_stroke_width</span>],
|
|
952
|
+
<span class="ruby-value">:style</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:exon_style</span>]} )
|
|
953
|
+
<span class="ruby-keyword">end</span>
|
|
954
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:gap_marker</span>] <span class="ruby-operator">==</span> <span class="ruby-string">"angled"</span> <span class="ruby-keyword">and</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:block_gaps</span>].<span class="ruby-identifier">empty?</span>
|
|
955
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-value">:block_gaps</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">gap</span><span class="ruby-operator">|</span>
|
|
956
|
+
<span class="ruby-identifier">points</span> = <span class="ruby-node">"#{gap.first},#{args[:y] + (args[:height]/2) } #{gap.first + (gap.last/2)},#{args[:y]} #{gap.first + gap.last},#{args[:y] + (args[:height]/2)}"</span>
|
|
957
|
+
<span class="ruby-identifier">composite</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Bio</span><span class="ruby-operator">::</span><span class="ruby-constant">Graphics</span><span class="ruby-operator">::</span><span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:polyline</span>, {
|
|
958
|
+
<span class="ruby-value">:points</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">points</span>,
|
|
959
|
+
<span class="ruby-value">:stroke</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:line_color</span>],
|
|
960
|
+
<span class="ruby-value">:stroke_width</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:line_width</span>],
|
|
961
|
+
<span class="ruby-value">:fill</span> =<span class="ruby-operator">></span> <span class="ruby-string">"none"</span>,
|
|
962
|
+
<span class="ruby-value">:line_style</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:line_style</span>]})
|
|
963
|
+
<span class="ruby-keyword">end</span>
|
|
964
|
+
<span class="ruby-keyword">else</span>
|
|
965
|
+
<span class="ruby-comment">#add line</span>
|
|
966
|
+
<span class="ruby-identifier">composite</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Bio</span><span class="ruby-operator">::</span><span class="ruby-constant">Graphics</span><span class="ruby-operator">::</span><span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:line</span>, {
|
|
967
|
+
<span class="ruby-value">:x1</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:x</span>],
|
|
968
|
+
<span class="ruby-value">:x2</span> =<span class="ruby-operator">></span> <span class="ruby-node">"#{args[:x] + args[:width]}"</span>,
|
|
969
|
+
<span class="ruby-value">:y1</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:y</span>] <span class="ruby-operator">+</span> (<span class="ruby-identifier">args</span>[<span class="ruby-value">:height</span>]<span class="ruby-operator">/</span><span class="ruby-value">2</span>),
|
|
970
|
+
<span class="ruby-value">:y2</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:y</span>] <span class="ruby-operator">+</span> (<span class="ruby-identifier">args</span>[<span class="ruby-value">:height</span>]<span class="ruby-operator">/</span><span class="ruby-value">2</span>),
|
|
971
|
+
<span class="ruby-value">:stroke</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:line_color</span>],
|
|
972
|
+
<span class="ruby-value">:stroke_width</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:line_width</span>],
|
|
973
|
+
<span class="ruby-value">:line_style</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:line_style</span>]})
|
|
974
|
+
|
|
975
|
+
<span class="ruby-keyword">end</span>
|
|
976
|
+
<span class="ruby-identifier">composite</span>
|
|
977
|
+
<span class="ruby-keyword">end</span></pre>
|
|
978
|
+
</div><!-- transcript-source -->
|
|
979
|
+
|
|
980
|
+
</div>
|
|
981
|
+
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
</div><!-- transcript-method -->
|
|
986
|
+
|
|
987
|
+
|
|
988
|
+
<div id="method-c-up_triangle" class="method-detail ">
|
|
989
|
+
|
|
990
|
+
<div class="method-heading">
|
|
991
|
+
<span class="method-name">up_triangle</span><span
|
|
992
|
+
class="method-args">(args)</span>
|
|
993
|
+
|
|
994
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
995
|
+
|
|
996
|
+
</div>
|
|
997
|
+
|
|
998
|
+
|
|
999
|
+
<div class="method-description">
|
|
1000
|
+
|
|
1001
|
+
<p>Creates a polygon <a href="Glyph.html">Glyph</a> for an upward-pointing
|
|
1002
|
+
triangle <code>args</code></p>
|
|
1003
|
+
<ul><li>
|
|
1004
|
+
<p>height = the height of the <a href="Glyph.html">Glyph</a> (10)</p>
|
|
1005
|
+
</li><li>
|
|
1006
|
+
<p>fill_color = the fill colour of the <a href="Glyph.html">Glyph</a>
|
|
1007
|
+
(‘red’)</p>
|
|
1008
|
+
</li><li>
|
|
1009
|
+
<p>stroke = the outline colour of the <a href="Glyph.html">Glyph</a>
|
|
1010
|
+
(“black”)</p>
|
|
1011
|
+
</li><li>
|
|
1012
|
+
<p>stroke_width = The width of the outline stroke (1)</p>
|
|
1013
|
+
</li><li>
|
|
1014
|
+
<p>style = the opacity of the fill color (“fill-opacity:0.4;”)</p>
|
|
1015
|
+
</li><li>
|
|
1016
|
+
<p>x = the co-ordinates of the <a href="Glyph.html">Glyph</a> for the x-axis</p>
|
|
1017
|
+
</li><li>
|
|
1018
|
+
<p>y = the co-ordinates of the <a href="Glyph.html">Glyph</a> for the y-axis</p>
|
|
1019
|
+
</li></ul>
|
|
1020
|
+
|
|
1021
|
+
<p>The points of the triangle are calculated form the <code>x</code> and
|
|
1022
|
+
<code>y</code> co-ordinates</p>
|
|
1023
|
+
|
|
1024
|
+
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
<div class="method-source-code" id="up_triangle-source">
|
|
1028
|
+
<pre><span class="ruby-comment"># File lib/bio/graphics/glyph.rb, line 136</span>
|
|
1029
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">up_triangle</span>(<span class="ruby-identifier">args</span>) <span class="ruby-comment">#:x, :y, :width :fill, :stroke :stroke_width, :style, :height</span>
|
|
1030
|
+
<span class="ruby-identifier">args</span> = {
|
|
1031
|
+
<span class="ruby-value">:height</span> =<span class="ruby-operator">></span> <span class="ruby-value">10</span>,
|
|
1032
|
+
<span class="ruby-value">:fill_color</span> =<span class="ruby-operator">></span> <span class="ruby-string">'red'</span>,
|
|
1033
|
+
<span class="ruby-value">:stroke</span> =<span class="ruby-operator">></span> <span class="ruby-string">"black"</span>,
|
|
1034
|
+
<span class="ruby-value">:stroke_width</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>,
|
|
1035
|
+
<span class="ruby-value">:style</span> =<span class="ruby-operator">></span> <span class="ruby-string">"fill-opacity:0.4;"</span>}.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">args</span>)
|
|
1036
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-value">:points</span>] = <span class="ruby-node">"#{args[:x]},#{args[:y] + args[:height]} #{args[:x] + args[:width]},#{args[:y] + args[:height]} #{ args[:x] + (args[:width]/2) },#{args[:y] }"</span>
|
|
1037
|
+
[<span class="ruby-constant">Bio</span><span class="ruby-operator">::</span><span class="ruby-constant">Graphics</span><span class="ruby-operator">::</span><span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:polygon</span>, <span class="ruby-identifier">args</span>)]
|
|
1038
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1039
|
+
</div><!-- up_triangle-source -->
|
|
1040
|
+
|
|
1041
|
+
</div>
|
|
1042
|
+
|
|
1043
|
+
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
</div><!-- up_triangle-method -->
|
|
1047
|
+
|
|
1048
|
+
|
|
1049
|
+
</section><!-- public-class-method-details -->
|
|
1050
|
+
|
|
1051
|
+
</section><!-- 5Buntitled-5D -->
|
|
1052
|
+
|
|
1053
|
+
</div><!-- documentation -->
|
|
1054
|
+
|
|
1055
|
+
|
|
1056
|
+
<footer id="validator-badges">
|
|
1057
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
|
1058
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.rc.2.1.
|
|
1059
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
|
1060
|
+
</footer>
|
|
1061
|
+
|