fcsparse 0.1.0 → 0.2.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/LICENSE +19 -0
- data/README.md +31 -0
- data/bin/fcsparse +27 -0
- data/doc/FCSParse.html +565 -0
- data/doc/FCSParse/FCSEvent.html +1040 -0
- data/doc/FCSParse/FCSFile.html +994 -0
- data/doc/FCSParse/FCSParam.html +602 -0
- data/doc/_index.html +122 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +328 -0
- data/doc/file_list.html +52 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +122 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +220 -0
- data/doc/top-level-namespace.html +112 -0
- data/fcsparse.gemspec +20 -0
- data/lib/fcsparse.rb +0 -5
- data/lib/fcsparse/version.rb +26 -0
- metadata +46 -41
@@ -0,0 +1,994 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: FCSParse::FCSFile
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.2.1
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (F)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../FCSParse.html" title="FCSParse (module)">FCSParse</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">FCSFile</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: FCSParse::FCSFile
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Object</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">FCSParse::FCSFile</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<dt class="r2 last">Defined in:</dt>
|
97
|
+
<dd class="r2 last">lib/fcsparse.rb</dd>
|
98
|
+
|
99
|
+
</dl>
|
100
|
+
<div class="clear"></div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>A class representing an FCS-encoded file. Has methods to parse the data,
|
106
|
+
manage it, and convert it to human-readable format.</p>
|
107
|
+
|
108
|
+
<p>Currently reads FCS v3.x files. Files must have data encoded in list mode,
|
109
|
+
and data points must be in float or double format (this will change
|
110
|
+
eventually to support all formats in the specification).</p>
|
111
|
+
|
112
|
+
<p>Analysis sections of the file are ignored.</p>
|
113
|
+
|
114
|
+
<p>Data can be written to delimited text files, and metadata to plain text
|
115
|
+
files, or the objects containing the data can be used by other code to
|
116
|
+
process the data further.</p>
|
117
|
+
|
118
|
+
|
119
|
+
</div>
|
120
|
+
</div>
|
121
|
+
<div class="tags">
|
122
|
+
|
123
|
+
<p class="tag_title">Author:</p>
|
124
|
+
<ul class="author">
|
125
|
+
|
126
|
+
<li>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
<div class='inline'>
|
133
|
+
<p>Colin J. Fuller</p>
|
134
|
+
</div>
|
135
|
+
|
136
|
+
</li>
|
137
|
+
|
138
|
+
</ul>
|
139
|
+
|
140
|
+
</div>
|
141
|
+
<h2>Constant Summary</h2>
|
142
|
+
|
143
|
+
<dl class="constants">
|
144
|
+
|
145
|
+
<dt id="MetadataExtension-constant" class="">MetadataExtension =
|
146
|
+
|
147
|
+
</dt>
|
148
|
+
<dd><pre class="code"><span class='string val'>".meta.txt"</span>
|
149
|
+
</pre></dd>
|
150
|
+
|
151
|
+
<dt id="DataExtension-constant" class="">DataExtension =
|
152
|
+
|
153
|
+
</dt>
|
154
|
+
<dd><pre class="code"><span class='string val'>".data.csv"</span>
|
155
|
+
</pre></dd>
|
156
|
+
|
157
|
+
<dt id="DataDelimiter-constant" class="">DataDelimiter =
|
158
|
+
|
159
|
+
</dt>
|
160
|
+
<dd><pre class="code"><span class='rubyid_FCSEvent constant id'>FCSEvent</span><span class='colon2 op'>::</span><span class='rubyid_DefaultDelimiter constant id'>DefaultDelimiter</span>
|
161
|
+
</pre></dd>
|
162
|
+
|
163
|
+
<dt id="SupportedVersions-constant" class="">SupportedVersions =
|
164
|
+
|
165
|
+
</dt>
|
166
|
+
<dd><pre class="code"><span class='lbrack token'>[</span><span class='string val'>"FCS3.0"</span><span class='comma token'>,</span> <span class='string val'>"FCS3.1"</span><span class='rbrack token'>]</span>
|
167
|
+
</pre></dd>
|
168
|
+
|
169
|
+
</dl>
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
176
|
+
<ul class="summary">
|
177
|
+
|
178
|
+
<li class="public ">
|
179
|
+
<span class="summary_signature">
|
180
|
+
|
181
|
+
<a href="#events-instance_method" title="#events (instance method)">- (Object) <strong>events</strong> </a>
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
</span>
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
<span class="summary_desc"><div class='inline'>
|
199
|
+
<p>Returns the value of attribute events.</p>
|
200
|
+
</div></span>
|
201
|
+
|
202
|
+
</li>
|
203
|
+
|
204
|
+
|
205
|
+
<li class="public ">
|
206
|
+
<span class="summary_signature">
|
207
|
+
|
208
|
+
<a href="#filename-instance_method" title="#filename (instance method)">- (Object) <strong>filename</strong> </a>
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
</span>
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
<span class="summary_desc"><div class='inline'>
|
226
|
+
<p>Returns the value of attribute filename.</p>
|
227
|
+
</div></span>
|
228
|
+
|
229
|
+
</li>
|
230
|
+
|
231
|
+
|
232
|
+
</ul>
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
<h2>
|
239
|
+
Class Method Summary
|
240
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
241
|
+
</h2>
|
242
|
+
|
243
|
+
<ul class="summary">
|
244
|
+
|
245
|
+
<li class="public ">
|
246
|
+
<span class="summary_signature">
|
247
|
+
|
248
|
+
<a href="#new_from_file-class_method" title="new_from_file (class method)">+ (FCSFile) <strong>new_from_file</strong>(filename) </a>
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
</span>
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
<span class="summary_desc"><div class='inline'>
|
263
|
+
<p>Generates a new FCSFile object from the specified file.</p>
|
264
|
+
</div></span>
|
265
|
+
|
266
|
+
</li>
|
267
|
+
|
268
|
+
|
269
|
+
</ul>
|
270
|
+
|
271
|
+
<h2>
|
272
|
+
Instance Method Summary
|
273
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
274
|
+
</h2>
|
275
|
+
|
276
|
+
<ul class="summary">
|
277
|
+
|
278
|
+
<li class="public ">
|
279
|
+
<span class="summary_signature">
|
280
|
+
|
281
|
+
<a href="#get_metadata_string-instance_method" title="#get_metadata_string (instance method)">- (String) <strong>get_metadata_string</strong> </a>
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
</span>
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
<span class="summary_desc"><div class='inline'>
|
296
|
+
<p>Gets the metadata (that is all the information in the text block of the fcs
|
297
|
+
file) as a string, where there is one key, value pair per line, separated
|
298
|
+
by the characters “ => ”.</p>
|
299
|
+
</div></span>
|
300
|
+
|
301
|
+
</li>
|
302
|
+
|
303
|
+
|
304
|
+
<li class="public ">
|
305
|
+
<span class="summary_signature">
|
306
|
+
|
307
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (FCSFile) <strong>initialize</strong>(file_string) </a>
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
</span>
|
312
|
+
|
313
|
+
|
314
|
+
<span class="note title constructor">constructor</span>
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
<span class="summary_desc"><div class='inline'>
|
324
|
+
<p>Generates a new FCSFile from the specified FCS-encoded data string.</p>
|
325
|
+
</div></span>
|
326
|
+
|
327
|
+
</li>
|
328
|
+
|
329
|
+
|
330
|
+
<li class="public ">
|
331
|
+
<span class="summary_signature">
|
332
|
+
|
333
|
+
<a href="#parse-instance_method" title="#parse (instance method)">- (Object) <strong>parse</strong> </a>
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
</span>
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
<span class="summary_desc"><div class='inline'>
|
348
|
+
<p>Parses the raw data loaded in the FCSFile to metadata, events, and
|
349
|
+
parameters.</p>
|
350
|
+
</div></span>
|
351
|
+
|
352
|
+
</li>
|
353
|
+
|
354
|
+
|
355
|
+
<li class="public ">
|
356
|
+
<span class="summary_signature">
|
357
|
+
|
358
|
+
<a href="#print_metadata-instance_method" title="#print_metadata (instance method)">- (Object) <strong>print_metadata</strong> </a>
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
</span>
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
<span class="summary_desc"><div class='inline'>
|
373
|
+
<p>Prints the metadata string returned by <span class='object_link'><a href="#get_metadata_string-instance_method" title="FCSParse::FCSFile#get_metadata_string (method)">#get_metadata_string</a></span>.</p>
|
374
|
+
</div></span>
|
375
|
+
|
376
|
+
</li>
|
377
|
+
|
378
|
+
|
379
|
+
<li class="public ">
|
380
|
+
<span class="summary_signature">
|
381
|
+
|
382
|
+
<a href="#write_metadata_and_data-instance_method" title="#write_metadata_and_data (instance method)">- (Object) <strong>write_metadata_and_data</strong>(write_header_row = true) </a>
|
383
|
+
|
384
|
+
|
385
|
+
|
386
|
+
</span>
|
387
|
+
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
<span class="summary_desc"><div class='inline'>
|
397
|
+
<p>Writes the metadata and data from the FCS-formatted file to disk in human
|
398
|
+
readable format.</p>
|
399
|
+
</div></span>
|
400
|
+
|
401
|
+
</li>
|
402
|
+
|
403
|
+
|
404
|
+
</ul>
|
405
|
+
|
406
|
+
|
407
|
+
<div id="constructor_details" class="method_details_list">
|
408
|
+
<h2>Constructor Details</h2>
|
409
|
+
|
410
|
+
<div class="method_details first">
|
411
|
+
<h3 class="signature first" id="initialize-instance_method">
|
412
|
+
|
413
|
+
- (<tt><span class='object_link'><a href="" title="FCSParse::FCSFile (class)">FCSFile</a></span></tt>) <strong>initialize</strong>(file_string)
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
</h3><div class="docstring">
|
420
|
+
<div class="discussion">
|
421
|
+
|
422
|
+
<p>Generates a new FCSFile from the specified FCS-encoded data string.</p>
|
423
|
+
|
424
|
+
|
425
|
+
</div>
|
426
|
+
</div>
|
427
|
+
<div class="tags">
|
428
|
+
<p class="tag_title">Parameters:</p>
|
429
|
+
<ul class="param">
|
430
|
+
|
431
|
+
<li>
|
432
|
+
|
433
|
+
<span class='name'>file_string</span>
|
434
|
+
|
435
|
+
|
436
|
+
<span class='type'>(<tt>String</tt>)</span>
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
—
|
441
|
+
<div class='inline'>
|
442
|
+
<p>a String containing an FCS-encoded dataset.</p>
|
443
|
+
</div>
|
444
|
+
|
445
|
+
</li>
|
446
|
+
|
447
|
+
</ul>
|
448
|
+
|
449
|
+
|
450
|
+
</div><table class="source_code">
|
451
|
+
<tr>
|
452
|
+
<td>
|
453
|
+
<pre class="lines">
|
454
|
+
|
455
|
+
|
456
|
+
87
|
457
|
+
88
|
458
|
+
89
|
459
|
+
90</pre>
|
460
|
+
</td>
|
461
|
+
<td>
|
462
|
+
<pre class="code"><span class="info file"># File 'lib/fcsparse.rb', line 87</span>
|
463
|
+
|
464
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='rubyid_file_string identifier id'>file_string</span><span class='rparen token'>)</span>
|
465
|
+
<span class='rubyid_@data ivar id'>@data</span> <span class='assign token'>=</span> <span class='rubyid_file_string identifier id'>file_string</span>
|
466
|
+
<span class='rubyid_@keywords ivar id'>@keywords</span> <span class='assign token'>=</span> <span class='rubyid_Hash constant id'>Hash</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span>
|
467
|
+
<span class='rubyid_end end kw'>end</span>
|
468
|
+
</pre>
|
469
|
+
</td>
|
470
|
+
</tr>
|
471
|
+
</table>
|
472
|
+
</div>
|
473
|
+
|
474
|
+
</div>
|
475
|
+
|
476
|
+
<div id="instance_attr_details" class="attr_details">
|
477
|
+
<h2>Instance Attribute Details</h2>
|
478
|
+
|
479
|
+
|
480
|
+
<span id="events=-instance_method"></span>
|
481
|
+
<div class="method_details first">
|
482
|
+
<h3 class="signature first" id="events-instance_method">
|
483
|
+
|
484
|
+
- (<tt>Object</tt>) <strong>events</strong>
|
485
|
+
|
486
|
+
|
487
|
+
|
488
|
+
|
489
|
+
|
490
|
+
</h3><div class="docstring">
|
491
|
+
<div class="discussion">
|
492
|
+
|
493
|
+
<p>Returns the value of attribute events</p>
|
494
|
+
|
495
|
+
|
496
|
+
</div>
|
497
|
+
</div>
|
498
|
+
<div class="tags">
|
499
|
+
|
500
|
+
|
501
|
+
</div><table class="source_code">
|
502
|
+
<tr>
|
503
|
+
<td>
|
504
|
+
<pre class="lines">
|
505
|
+
|
506
|
+
|
507
|
+
58
|
508
|
+
59
|
509
|
+
60</pre>
|
510
|
+
</td>
|
511
|
+
<td>
|
512
|
+
<pre class="code"><span class="info file"># File 'lib/fcsparse.rb', line 58</span>
|
513
|
+
|
514
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_events identifier id'>events</span>
|
515
|
+
<span class='rubyid_@events ivar id'>@events</span>
|
516
|
+
<span class='rubyid_end end kw'>end</span>
|
517
|
+
</pre>
|
518
|
+
</td>
|
519
|
+
</tr>
|
520
|
+
</table>
|
521
|
+
</div>
|
522
|
+
|
523
|
+
|
524
|
+
<span id="filename=-instance_method"></span>
|
525
|
+
<div class="method_details ">
|
526
|
+
<h3 class="signature " id="filename-instance_method">
|
527
|
+
|
528
|
+
- (<tt>Object</tt>) <strong>filename</strong>
|
529
|
+
|
530
|
+
|
531
|
+
|
532
|
+
|
533
|
+
|
534
|
+
</h3><div class="docstring">
|
535
|
+
<div class="discussion">
|
536
|
+
|
537
|
+
<p>Returns the value of attribute filename</p>
|
538
|
+
|
539
|
+
|
540
|
+
</div>
|
541
|
+
</div>
|
542
|
+
<div class="tags">
|
543
|
+
|
544
|
+
|
545
|
+
</div><table class="source_code">
|
546
|
+
<tr>
|
547
|
+
<td>
|
548
|
+
<pre class="lines">
|
549
|
+
|
550
|
+
|
551
|
+
58
|
552
|
+
59
|
553
|
+
60</pre>
|
554
|
+
</td>
|
555
|
+
<td>
|
556
|
+
<pre class="code"><span class="info file"># File 'lib/fcsparse.rb', line 58</span>
|
557
|
+
|
558
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_filename identifier id'>filename</span>
|
559
|
+
<span class='rubyid_@filename ivar id'>@filename</span>
|
560
|
+
<span class='rubyid_end end kw'>end</span>
|
561
|
+
</pre>
|
562
|
+
</td>
|
563
|
+
</tr>
|
564
|
+
</table>
|
565
|
+
</div>
|
566
|
+
|
567
|
+
</div>
|
568
|
+
|
569
|
+
|
570
|
+
<div id="class_method_details" class="method_details_list">
|
571
|
+
<h2>Class Method Details</h2>
|
572
|
+
|
573
|
+
|
574
|
+
<div class="method_details first">
|
575
|
+
<h3 class="signature first" id="new_from_file-class_method">
|
576
|
+
|
577
|
+
+ (<tt><span class='object_link'><a href="" title="FCSParse::FCSFile (class)">FCSFile</a></span></tt>) <strong>new_from_file</strong>(filename)
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
|
582
|
+
|
583
|
+
</h3><div class="docstring">
|
584
|
+
<div class="discussion">
|
585
|
+
|
586
|
+
<p>Generates a new FCSFile object from the specified file.</p>
|
587
|
+
|
588
|
+
<p>Calling this will read the entire file into memory but will not parse it.</p>
|
589
|
+
|
590
|
+
|
591
|
+
</div>
|
592
|
+
</div>
|
593
|
+
<div class="tags">
|
594
|
+
<p class="tag_title">Parameters:</p>
|
595
|
+
<ul class="param">
|
596
|
+
|
597
|
+
<li>
|
598
|
+
|
599
|
+
<span class='name'>filename</span>
|
600
|
+
|
601
|
+
|
602
|
+
<span class='type'>(<tt>String</tt>)</span>
|
603
|
+
|
604
|
+
|
605
|
+
|
606
|
+
—
|
607
|
+
<div class='inline'>
|
608
|
+
<p>the filename of the FCS-encoded file (with path as required to locate it)</p>
|
609
|
+
</div>
|
610
|
+
|
611
|
+
</li>
|
612
|
+
|
613
|
+
</ul>
|
614
|
+
|
615
|
+
<p class="tag_title">Returns:</p>
|
616
|
+
<ul class="return">
|
617
|
+
|
618
|
+
<li>
|
619
|
+
|
620
|
+
|
621
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="FCSParse::FCSFile (class)">FCSFile</a></span></tt>)</span>
|
622
|
+
|
623
|
+
|
624
|
+
|
625
|
+
—
|
626
|
+
<div class='inline'>
|
627
|
+
<p>a new FCSFile object initialized with the contents of the file.</p>
|
628
|
+
</div>
|
629
|
+
|
630
|
+
</li>
|
631
|
+
|
632
|
+
</ul>
|
633
|
+
|
634
|
+
</div><table class="source_code">
|
635
|
+
<tr>
|
636
|
+
<td>
|
637
|
+
<pre class="lines">
|
638
|
+
|
639
|
+
|
640
|
+
69
|
641
|
+
70
|
642
|
+
71
|
643
|
+
72
|
644
|
+
73
|
645
|
+
74
|
646
|
+
75
|
647
|
+
76
|
648
|
+
77
|
649
|
+
78
|
650
|
+
79
|
651
|
+
80
|
652
|
+
81</pre>
|
653
|
+
</td>
|
654
|
+
<td>
|
655
|
+
<pre class="code"><span class="info file"># File 'lib/fcsparse.rb', line 69</span>
|
656
|
+
|
657
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_new_from_file identifier id'>new_from_file</span><span class='lparen token'>(</span><span class='rubyid_filename identifier id'>filename</span><span class='rparen token'>)</span>
|
658
|
+
|
659
|
+
<span class='rubyid_fcsfile identifier id'>fcsfile</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span>
|
660
|
+
|
661
|
+
<span class='rubyid_File constant id'>File</span><span class='dot token'>.</span><span class='rubyid_open identifier id'>open</span><span class='lparen token'>(</span><span class='rubyid_filename identifier id'>filename</span><span class='rparen token'>)</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_f identifier id'>f</span><span class='bitor op'>|</span>
|
662
|
+
<span class='rubyid_fcsfile identifier id'>fcsfile</span> <span class='assign token'>=</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_f identifier id'>f</span><span class='dot token'>.</span><span class='rubyid_read identifier id'>read</span><span class='rparen token'>)</span>
|
663
|
+
<span class='rubyid_end end kw'>end</span>
|
664
|
+
|
665
|
+
<span class='rubyid_fcsfile identifier id'>fcsfile</span><span class='dot token'>.</span><span class='rubyid_filename identifier id'>filename</span> <span class='assign token'>=</span> <span class='rubyid_filename identifier id'>filename</span>
|
666
|
+
|
667
|
+
<span class='rubyid_fcsfile identifier id'>fcsfile</span>
|
668
|
+
|
669
|
+
<span class='rubyid_end end kw'>end</span>
|
670
|
+
</pre>
|
671
|
+
</td>
|
672
|
+
</tr>
|
673
|
+
</table>
|
674
|
+
</div>
|
675
|
+
|
676
|
+
</div>
|
677
|
+
|
678
|
+
<div id="instance_method_details" class="method_details_list">
|
679
|
+
<h2>Instance Method Details</h2>
|
680
|
+
|
681
|
+
|
682
|
+
<div class="method_details first">
|
683
|
+
<h3 class="signature first" id="get_metadata_string-instance_method">
|
684
|
+
|
685
|
+
- (<tt>String</tt>) <strong>get_metadata_string</strong>
|
686
|
+
|
687
|
+
|
688
|
+
|
689
|
+
|
690
|
+
|
691
|
+
</h3><div class="docstring">
|
692
|
+
<div class="discussion">
|
693
|
+
|
694
|
+
<p>Gets the metadata (that is all the information in the text block of the fcs
|
695
|
+
file) as a string, where there is one key, value pair per line, separated
|
696
|
+
by the characters “ => ”</p>
|
697
|
+
|
698
|
+
|
699
|
+
</div>
|
700
|
+
</div>
|
701
|
+
<div class="tags">
|
702
|
+
|
703
|
+
<p class="tag_title">Returns:</p>
|
704
|
+
<ul class="return">
|
705
|
+
|
706
|
+
<li>
|
707
|
+
|
708
|
+
|
709
|
+
<span class='type'>(<tt>String</tt>)</span>
|
710
|
+
|
711
|
+
|
712
|
+
|
713
|
+
—
|
714
|
+
<div class='inline'>
|
715
|
+
<p>a String containing all the metadata</p>
|
716
|
+
</div>
|
717
|
+
|
718
|
+
</li>
|
719
|
+
|
720
|
+
</ul>
|
721
|
+
|
722
|
+
</div><table class="source_code">
|
723
|
+
<tr>
|
724
|
+
<td>
|
725
|
+
<pre class="lines">
|
726
|
+
|
727
|
+
|
728
|
+
252
|
729
|
+
253
|
730
|
+
254
|
731
|
+
255
|
732
|
+
256
|
733
|
+
257
|
734
|
+
258</pre>
|
735
|
+
</td>
|
736
|
+
<td>
|
737
|
+
<pre class="code"><span class="info file"># File 'lib/fcsparse.rb', line 252</span>
|
738
|
+
|
739
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_get_metadata_string identifier id'>get_metadata_string</span>
|
740
|
+
<span class='rubyid_str identifier id'>str</span> <span class='assign token'>=</span> <span class='string val'>""</span>
|
741
|
+
<span class='rubyid_@keywords ivar id'>@keywords</span><span class='dot token'>.</span><span class='rubyid_keys identifier id'>keys</span><span class='dot token'>.</span><span class='rubyid_map identifier id'>map</span><span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='rubyid_e identifier id'>e</span><span class='bitor op'>|</span> <span class='rubyid_e identifier id'>e</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span><span class='rbrace token'>}</span><span class='dot token'>.</span><span class='rubyid_sort identifier id'>sort</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_k identifier id'>k</span><span class='bitor op'>|</span>
|
742
|
+
<span class='rubyid_str identifier id'>str</span> <span class='lshft op'><<</span> <span class='rubyid_k identifier id'>k</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span> <span class='plus op'>+</span> <span class='string val'>" => "</span> <span class='plus op'>+</span> <span class='rubyid_@keywords ivar id'>@keywords</span><span class='lbrack token'>[</span><span class='rubyid_k identifier id'>k</span><span class='dot token'>.</span><span class='rubyid_to_sym identifier id'>to_sym</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span> <span class='plus op'>+</span> <span class='string val'>"\n"</span>
|
743
|
+
<span class='rubyid_end end kw'>end</span>
|
744
|
+
<span class='rubyid_str identifier id'>str</span>
|
745
|
+
<span class='rubyid_end end kw'>end</span>
|
746
|
+
</pre>
|
747
|
+
</td>
|
748
|
+
</tr>
|
749
|
+
</table>
|
750
|
+
</div>
|
751
|
+
|
752
|
+
<div class="method_details ">
|
753
|
+
<h3 class="signature " id="parse-instance_method">
|
754
|
+
|
755
|
+
- (<tt>Object</tt>) <strong>parse</strong>
|
756
|
+
|
757
|
+
|
758
|
+
|
759
|
+
|
760
|
+
|
761
|
+
</h3><div class="docstring">
|
762
|
+
<div class="discussion">
|
763
|
+
|
764
|
+
<p>Parses the raw data loaded in the FCSFile to metadata, events, and
|
765
|
+
parameters.</p>
|
766
|
+
|
767
|
+
<p>Erases the raw data from the FCSFile object after parsing is complete.</p>
|
768
|
+
|
769
|
+
|
770
|
+
</div>
|
771
|
+
</div>
|
772
|
+
<div class="tags">
|
773
|
+
|
774
|
+
|
775
|
+
</div><table class="source_code">
|
776
|
+
<tr>
|
777
|
+
<td>
|
778
|
+
<pre class="lines">
|
779
|
+
|
780
|
+
|
781
|
+
324
|
782
|
+
325
|
783
|
+
326
|
784
|
+
327
|
785
|
+
328
|
786
|
+
329</pre>
|
787
|
+
</td>
|
788
|
+
<td>
|
789
|
+
<pre class="code"><span class="info file"># File 'lib/fcsparse.rb', line 324</span>
|
790
|
+
|
791
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_parse identifier id'>parse</span>
|
792
|
+
<span class='rubyid_read_header identifier id'>read_header</span>
|
793
|
+
<span class='rubyid_parse_text_segment identifier id'>parse_text_segment</span>
|
794
|
+
<span class='rubyid_parse_data_segment identifier id'>parse_data_segment</span>
|
795
|
+
<span class='rubyid_@data ivar id'>@data</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span>
|
796
|
+
<span class='rubyid_end end kw'>end</span>
|
797
|
+
</pre>
|
798
|
+
</td>
|
799
|
+
</tr>
|
800
|
+
</table>
|
801
|
+
</div>
|
802
|
+
|
803
|
+
<div class="method_details ">
|
804
|
+
<h3 class="signature " id="print_metadata-instance_method">
|
805
|
+
|
806
|
+
- (<tt>Object</tt>) <strong>print_metadata</strong>
|
807
|
+
|
808
|
+
|
809
|
+
|
810
|
+
|
811
|
+
|
812
|
+
</h3><div class="docstring">
|
813
|
+
<div class="discussion">
|
814
|
+
|
815
|
+
<p>Prints the metadata string returned by <span class='object_link'><a href="#get_metadata_string-instance_method" title="FCSParse::FCSFile#get_metadata_string (method)">#get_metadata_string</a></span>.</p>
|
816
|
+
|
817
|
+
|
818
|
+
</div>
|
819
|
+
</div>
|
820
|
+
<div class="tags">
|
821
|
+
|
822
|
+
|
823
|
+
</div><table class="source_code">
|
824
|
+
<tr>
|
825
|
+
<td>
|
826
|
+
<pre class="lines">
|
827
|
+
|
828
|
+
|
829
|
+
263
|
830
|
+
264
|
831
|
+
265
|
832
|
+
266
|
833
|
+
267
|
834
|
+
268
|
835
|
+
269</pre>
|
836
|
+
</td>
|
837
|
+
<td>
|
838
|
+
<pre class="code"><span class="info file"># File 'lib/fcsparse.rb', line 263</span>
|
839
|
+
|
840
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_print_metadata identifier id'>print_metadata</span>
|
841
|
+
|
842
|
+
<span class='rubyid_puts identifier id'>puts</span> <span class='rubyid_get_metadata_string identifier id'>get_metadata_string</span>
|
843
|
+
|
844
|
+
<span class='rubyid_nil nil kw'>nil</span>
|
845
|
+
|
846
|
+
<span class='rubyid_end end kw'>end</span>
|
847
|
+
</pre>
|
848
|
+
</td>
|
849
|
+
</tr>
|
850
|
+
</table>
|
851
|
+
</div>
|
852
|
+
|
853
|
+
<div class="method_details ">
|
854
|
+
<h3 class="signature " id="write_metadata_and_data-instance_method">
|
855
|
+
|
856
|
+
- (<tt>Object</tt>) <strong>write_metadata_and_data</strong>(write_header_row = true)
|
857
|
+
|
858
|
+
|
859
|
+
|
860
|
+
|
861
|
+
|
862
|
+
</h3><div class="docstring">
|
863
|
+
<div class="discussion">
|
864
|
+
|
865
|
+
<p>Writes the metadata and data from the FCS-formatted file to disk in human
|
866
|
+
readable format.</p>
|
867
|
+
|
868
|
+
<p>The metadata is written as a text file (formatted by
|
869
|
+
<span class='object_link'><a href="#get_metadata_string-instance_method" title="FCSParse::FCSFile#get_metadata_string (method)">#get_metadata_string</a></span>), in the same location as the input FCS file and
|
870
|
+
with the same name except for an extra extension specified in
|
871
|
+
<span class='object_link'><a href="#MetadataExtension-constant" title="FCSParse::FCSFile::MetadataExtension (constant)">MetadataExtension</a></span>.</p>
|
872
|
+
|
873
|
+
<p>The data, delimited by the data delimiter specified as
|
874
|
+
<span class='object_link'><a href="#DataDelimiter-constant" title="FCSParse::FCSFile::DataDelimiter (constant)">DataDelimiter</a></span>, one row per event, is written to a text file in
|
875
|
+
the same location as the input FCS file and with the same name except for
|
876
|
+
an extra extension specified in <span class='object_link'><a href="#DataExtension-constant" title="FCSParse::FCSFile::DataExtension (constant)">DataExtension</a></span>.</p>
|
877
|
+
|
878
|
+
<p>the data file should have a header row with the name of each column’s
|
879
|
+
parameter. Defaults to true.</p>
|
880
|
+
|
881
|
+
|
882
|
+
</div>
|
883
|
+
</div>
|
884
|
+
<div class="tags">
|
885
|
+
<p class="tag_title">Parameters:</p>
|
886
|
+
<ul class="param">
|
887
|
+
|
888
|
+
<li>
|
889
|
+
|
890
|
+
<span class='name'>write_header_row</span>
|
891
|
+
|
892
|
+
|
893
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
894
|
+
|
895
|
+
|
896
|
+
<em class="default">(defaults to: <tt>true</tt>)</em>
|
897
|
+
|
898
|
+
|
899
|
+
—
|
900
|
+
<div class='inline'>
|
901
|
+
<p>an optional parameter specifying whether</p>
|
902
|
+
</div>
|
903
|
+
|
904
|
+
</li>
|
905
|
+
|
906
|
+
</ul>
|
907
|
+
|
908
|
+
|
909
|
+
</div><table class="source_code">
|
910
|
+
<tr>
|
911
|
+
<td>
|
912
|
+
<pre class="lines">
|
913
|
+
|
914
|
+
|
915
|
+
289
|
916
|
+
290
|
917
|
+
291
|
918
|
+
292
|
919
|
+
293
|
920
|
+
294
|
921
|
+
295
|
922
|
+
296
|
923
|
+
297
|
924
|
+
298
|
925
|
+
299
|
926
|
+
300
|
927
|
+
301
|
928
|
+
302
|
929
|
+
303
|
930
|
+
304
|
931
|
+
305
|
932
|
+
306
|
933
|
+
307
|
934
|
+
308
|
935
|
+
309
|
936
|
+
310
|
937
|
+
311
|
938
|
+
312
|
939
|
+
313
|
940
|
+
314
|
941
|
+
315
|
942
|
+
316
|
943
|
+
317</pre>
|
944
|
+
</td>
|
945
|
+
<td>
|
946
|
+
<pre class="code"><span class="info file"># File 'lib/fcsparse.rb', line 289</span>
|
947
|
+
|
948
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_write_metadata_and_data identifier id'>write_metadata_and_data</span><span class='lparen token'>(</span><span class='rubyid_write_header_row identifier id'>write_header_row</span> <span class='assign token'>=</span> <span class='rubyid_true true kw'>true</span><span class='rparen token'>)</span>
|
949
|
+
|
950
|
+
<span class='rubyid_meta_filename identifier id'>meta_filename</span> <span class='assign token'>=</span> <span class='rubyid_@filename ivar id'>@filename</span> <span class='plus op'>+</span> <span class='rubyid_MetadataExtension constant id'>MetadataExtension</span>
|
951
|
+
|
952
|
+
<span class='rubyid_data_filename identifier id'>data_filename</span> <span class='assign token'>=</span> <span class='rubyid_@filename ivar id'>@filename</span> <span class='plus op'>+</span> <span class='rubyid_DataExtension constant id'>DataExtension</span>
|
953
|
+
|
954
|
+
<span class='rubyid_File constant id'>File</span><span class='dot token'>.</span><span class='rubyid_open identifier id'>open</span><span class='lparen token'>(</span><span class='rubyid_meta_filename identifier id'>meta_filename</span><span class='comma token'>,</span> <span class='string val'>"w"</span><span class='rparen token'>)</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_f identifier id'>f</span><span class='bitor op'>|</span>
|
955
|
+
|
956
|
+
<span class='rubyid_f identifier id'>f</span><span class='dot token'>.</span><span class='rubyid_write identifier id'>write</span><span class='lparen token'>(</span><span class='rubyid_get_metadata_string identifier id'>get_metadata_string</span><span class='rparen token'>)</span>
|
957
|
+
|
958
|
+
<span class='rubyid_end end kw'>end</span>
|
959
|
+
|
960
|
+
<span class='rubyid_File constant id'>File</span><span class='dot token'>.</span><span class='rubyid_open identifier id'>open</span><span class='lparen token'>(</span><span class='rubyid_data_filename identifier id'>data_filename</span><span class='comma token'>,</span> <span class='string val'>"w"</span><span class='rparen token'>)</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_f identifier id'>f</span><span class='bitor op'>|</span>
|
961
|
+
|
962
|
+
<span class='rubyid_if if kw'>if</span> <span class='rubyid_write_header_row identifier id'>write_header_row</span> <span class='rubyid_then then kw'>then</span>
|
963
|
+
<span class='rubyid_f identifier id'>f</span><span class='dot token'>.</span><span class='rubyid_puts identifier id'>puts</span><span class='lparen token'>(</span><span class='rubyid_@events ivar id'>@events</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='rubyid_names_to_s_delim identifier id'>names_to_s_delim</span><span class='lparen token'>(</span><span class='rubyid_DataDelimiter constant id'>DataDelimiter</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
|
964
|
+
<span class='rubyid_end end kw'>end</span>
|
965
|
+
|
966
|
+
<span class='rubyid_@events ivar id'>@events</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_e identifier id'>e</span><span class='bitor op'>|</span>
|
967
|
+
|
968
|
+
<span class='rubyid_f identifier id'>f</span><span class='dot token'>.</span><span class='rubyid_puts identifier id'>puts</span><span class='lparen token'>(</span><span class='rubyid_e identifier id'>e</span><span class='dot token'>.</span><span class='rubyid_to_s_delim identifier id'>to_s_delim</span><span class='lparen token'>(</span><span class='rubyid_DataDelimiter constant id'>DataDelimiter</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
|
969
|
+
|
970
|
+
<span class='rubyid_end end kw'>end</span>
|
971
|
+
|
972
|
+
<span class='rubyid_end end kw'>end</span>
|
973
|
+
|
974
|
+
<span class='rubyid_nil nil kw'>nil</span>
|
975
|
+
|
976
|
+
<span class='rubyid_end end kw'>end</span>
|
977
|
+
</pre>
|
978
|
+
</td>
|
979
|
+
</tr>
|
980
|
+
</table>
|
981
|
+
</div>
|
982
|
+
|
983
|
+
</div>
|
984
|
+
|
985
|
+
</div>
|
986
|
+
|
987
|
+
<div id="footer">
|
988
|
+
Generated on Wed Jun 20 16:53:15 2012 by
|
989
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
990
|
+
0.8.2.1 (ruby-1.8.7).
|
991
|
+
</div>
|
992
|
+
|
993
|
+
</body>
|
994
|
+
</html>
|