Class: Bio::FastQC::Semantics

Inherits:
Object
  • Object
show all
Defined in:
lib/bio/fastqc/semantics.rb

Instance Method Summary collapse

Constructor Details

#initialize(fastqc_object, id: nil, runid: nil, tiny: true) ⇒ Semantics

Returns a new instance of Semantics.



9
10
11
12
13
14
# File 'lib/bio/fastqc/semantics.rb', line 9

def initialize(fastqc_object, id: nil, runid: nil, tiny: true)
  @id = id
  @runid = runid
  @tiny = tiny
  @fastqc_object = fastqc_object
end

Instance Method Details

#adapter_contentObject



498
499
500
# File 'lib/bio/fastqc/semantics.rb', line 498

def adapter_content
  {}
end

#base_stat_class(base) ⇒ Object



137
138
139
140
141
142
143
144
# File 'lib/bio/fastqc/semantics.rb', line 137

def base_stat_class(base)
  case base
  when /-/ # when the base position is range like "50-100"
    "BaseRangeStatistics"
  else
    "ExactBaseStatistics"
  end
end

#encodingObject



164
165
166
167
168
# File 'lib/bio/fastqc/semantics.rb', line 164

def encoding
  {
    "encoding" => @fastqc_object[:encoding],
  }
end

#fastqc_versionObject



146
147
148
149
150
# File 'lib/bio/fastqc/semantics.rb', line 146

def fastqc_version
  {
    "fastqcVersion" => @fastqc_object[:fastqc_version],
  }
end

#file_typeObject



158
159
160
161
162
# File 'lib/bio/fastqc/semantics.rb', line 158

def file_type
  {
    "fileType" => @fastqc_object[:file_type],
  }
end

#filenameObject



152
153
154
155
156
# File 'lib/bio/fastqc/semantics.rb', line 152

def filename
  {
    "filename" => @fastqc_object[:filename],
  }
end

#filtered_sequencesObject



181
182
183
184
185
186
187
188
189
190
# File 'lib/bio/fastqc/semantics.rb', line 181

def filtered_sequences
  {
    "@type" => "filteredSequences",
    "sio:SIO_000221" => { "@id" => "obo:UO_0000244" },
    "sio:SIO_000300" => {
      "@value" => @fastqc_object[:filtered_sequences],
      "@type" => "xsd:integer",
    }
  }
end

#identifier_literalObject



59
60
61
# File 'lib/bio/fastqc/semantics.rb', line 59

def identifier_literal
  @id ? @id : "QNT_" + @fastqc_object[:filename].split(".")[0]
end

#identifier_uriObject



63
64
65
# File 'lib/bio/fastqc/semantics.rb', line 63

def identifier_uri
  "quanto:" + identifier_literal
end

#json_ld_objectObject



43
44
45
46
47
48
49
# File 'lib/bio/fastqc/semantics.rb', line 43

def json_ld_object
  object = [object_core, static_value_modules, object_modules].flatten.inject(&:merge)
  if !@tiny
    object["hasMatrix"] = matrix_modules
  end
  object
end

#jsonld_contextObject

Generate JSON-LD context object



621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
# File 'lib/bio/fastqc/semantics.rb', line 621

def jsonld_context
  # definition of imported terms in @context
  object = turtle_prefixes

  # definition of local ontology terms
  pfx = "sos:"

  # definition of class in @context
  sos_class.each do |term|
    object[term] = {}
    object[term]["@id"] = pfx + term
    object[term]["@type"] = "@id"
  end

  # definition of object properties in @context
  sos_object_properties.each do |term|
    object[term] = {}
    object[term]["@id"] = pfx + term
    object[term]["@type"] = "@id"
  end

  sos_data_properties_string.each do |term|
    object[term] = {}
    object[term]["@id"] = pfx + term
    object[term]["@type"] = "http://www.w3.org/2001/XMLSchema#string"
  end

  sos_data_properties_integer.each do |term|
    object[term] = {}
    object[term]["@id"] = pfx + term
    object[term]["@type"] = "http://www.w3.org/2001/XMLSchema#integer"
  end

  sos_data_properties_float.each do |term|
    object[term] = {}
    object[term]["@id"] = pfx + term
    object[term]["@type"] = "http://www.w3.org/2001/XMLSchema#float"
  end

  object
end

#kmer_contentObject



502
503
504
505
506
507
# File 'lib/bio/fastqc/semantics.rb', line 502

def kmer_content
  {
    "@type" => "KmerContent",
    "hasRow" => kmer_content_rows(@fastqc_object[:kmer_content]),
  }
end

#kmer_content_rows(matrix) ⇒ Object



509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
# File 'lib/bio/fastqc/semantics.rb', line 509

def kmer_content_rows(matrix)
  matrix.map.with_index do |row, i|
    sequence = row[0]
    count = row[1]
    ratio_overall = row[2]
    ratio_max = row[3]
    ratio_max_position = row[4]
    {
      "@type" => "Row",
      "rowIndex" => i,
      "kmerSequence" => sequence,
      "sequenceReadCount" => {
        "@type" => "SequenceReadAmount",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000244" },
        "sio:SIO_000300" => count,
      },
      "observedPerExpectedOverall" => {
        "@type" => "SequenceReadAmount",
        "sio:SIO_000221" => { "@id" => "obo:Ratio" },
        "sio:SIO_000300" => ratio_overall,
      },
      "observedPerExpectedMax" => {
        "@type" => "SequenceReadAmount",
        "sio:SIO_000221" => { "@id" => "obo:Ratio" },
        "sio:SIO_000300" => ratio_max,
      },
      "observedPerExpectedMaxPosition" => ratio_max_position,
    }
  end
end

#matrix_modulesObject



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/bio/fastqc/semantics.rb', line 121

def matrix_modules
  [
    per_base_sequence_quality,
    per_tile_sequence_quality,
    per_sequence_quality_scores,
    per_base_sequence_content,
    per_sequence_gc_content,
    per_base_n_content,
    sequence_length_distribution,
    sequence_duplication_levels,
    overrepresented_sequences,
    adapter_content,
    kmer_content,
  ]
end

#max_lengthObject



551
552
553
554
555
556
557
558
559
560
# File 'lib/bio/fastqc/semantics.rb', line 551

def max_length
  {
    "@type" => "maxSequenceLength",
    "sio:SIO_000221" => { "@id" => "obo:UO_0000244" },
    "sio:SIO_000300" => {
      "@value" => @fastqc_object[:max_length],
      "@type" => "xsd:integer",
    },
  }
end

#mean_sequence_lengthObject



562
563
564
565
566
567
568
569
570
571
# File 'lib/bio/fastqc/semantics.rb', line 562

def mean_sequence_length
  {
    "@type" => "meanSequenceLength",
    "sio:SIO_000221" => { "@id" => "obo:UO_0000244" },
    "sio:SIO_000300" => {
      "@value" => @fastqc_object[:mean_sequence_length],
      "@type" => "xsd:decimal",
    },
  }
end

#median_sequence_lengthObject



573
574
575
576
577
578
579
580
581
582
# File 'lib/bio/fastqc/semantics.rb', line 573

def median_sequence_length
  {
    "@type" => "medianSequenceLength",
    "sio:SIO_000221" => { "@id" => "obo:UO_0000244" },
    "sio:SIO_000300" => {
      "@value" => @fastqc_object[:median_sequence_length],
      "@type" => "xsd:decimal",
    },
  }
end

#min_lengthObject



540
541
542
543
544
545
546
547
548
549
# File 'lib/bio/fastqc/semantics.rb', line 540

def min_length
  {
    "@type" => "minimumSequenceLength",
    "sio:SIO_000221" => { "@id" => "obo:UO_0000244" },
    "sio:SIO_000300" => {
      "@value" => @fastqc_object[:min_length],
      "@type" => "xsd:integer",
    },
  }
end

#object_coreObject



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/bio/fastqc/semantics.rb', line 67

def object_core
  {
    "@context" => jsonld_context,
    "@id" => identifier_uri,
    "@type" => "SequenceStatisticsReport",
    "dcterms:identifier" => identifier_literal,
    "dcterms:contributor" => ["Tazro Ohta", "Shuichi Kawashima"],
    "dcterms:created" => {
      "@value" => Time.now.strftime("%Y-%m-%d"),
      "@type" => "xsd:date"
    },
    "dcterms:license" => {
      "@id" => "http://creativecommons.org/licenses/by-sa/4.0/",
    },
    "dcterms:publisher" => {
      "@id" => "http://dbcls.rois.ac.jp/",
    },
    "pav:version" => rdf_version,
    "foaf:page" => {
      "@id" => "http://quanto.dbcls.jp",
    },
    "rdfs:seeAlso" => {
      "@id" => "http://identifiers.org/insdc.sra/" + sra_identifier,
    },
  }
end

#object_modulesObject



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/bio/fastqc/semantics.rb', line 103

def object_modules
  {
    "sio:SIO_000216" => [
      total_sequences,
      filtered_sequences,
      percent_gc,
      #total_duplicate_percentage,
      min_length,
      max_length,
      overall_mean_quality_score,
      overall_median_quality_score,
      overall_n_content,
      mean_sequence_length,
      median_sequence_length,
    ]
  }
end

#overall_mean_quality_scoreObject



584
585
586
587
588
589
590
591
592
593
# File 'lib/bio/fastqc/semantics.rb', line 584

def overall_mean_quality_score
  {
    "@type" => "meanBaseCallQuality",
    "sio:SIO_000221" => { "@id" => "obo:UO_0000189" },
    "sio:SIO_000300" => {
      "@value" => @fastqc_object[:overall_mean_quality_score],
      "@type" => "xsd:decimal",
    },
  }
end

#overall_median_quality_scoreObject



595
596
597
598
599
600
601
602
603
604
# File 'lib/bio/fastqc/semantics.rb', line 595

def overall_median_quality_score
  {
    "@type" => "medianBaseCallQuality",
    "sio:SIO_000221" => { "@id" => "obo:UO_0000189" },
    "sio:SIO_000300" => {
      "@value" => @fastqc_object[:overall_median_quality_score],
      "@type" => "xsd:decimal",
    },
  }
end

#overall_n_contentObject



606
607
608
609
610
611
612
613
614
615
# File 'lib/bio/fastqc/semantics.rb', line 606

def overall_n_content
  {
    "@type" => "nContent",
    "sio:SIO_000221" => { "@id" => "obo:UO_0000187" },
    "sio:SIO_000300" => {
      "@value" => @fastqc_object[:overall_n_content],
      "@type" => "xsd:decimal",
    },
  }
end

#overrepresented_sequencesObject



466
467
468
469
470
471
# File 'lib/bio/fastqc/semantics.rb', line 466

def overrepresented_sequences
  {
    "@type" => "OverrepresentedSequences",
    "hasRow" => overrepresented_sequences_rows(@fastqc_object[:overrepresented_sequences]),
  }
end

#overrepresented_sequences_rows(matrix) ⇒ Object



473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
# File 'lib/bio/fastqc/semantics.rb', line 473

def overrepresented_sequences_rows(matrix)
  matrix.map.with_index do |row, i|
    sequence = row[0]
    count = row[1]
    percentage = row[2]
    possible_source = row[3]
    {
      "@type" => "Row",
      "rowIndex" => i,
      "overrepresentedSequence" => sequence,
      "sequenceReadCount" => {
        "@type" => "SequenceReadAmount",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000244" },
        "sio:SIO_000300" => count,
      },
      "sequenceReadPercentage" => {
        "@type" => "SequenceReadRatio",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000187" },
        "sio:SIO_000300" => percentage,
      },
      "possibleSourceOfSequence" => possible_source,
    }
  end
end

#per_base_n_contentObject



377
378
379
380
381
382
# File 'lib/bio/fastqc/semantics.rb', line 377

def per_base_n_content
  {
    "@type" => "PerBaseNContent",
    "hasRow" => per_base_n_content_rows(@fastqc_object[:per_base_n_content]),
  }
end

#per_base_n_content_rows(matrix) ⇒ Object



384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/bio/fastqc/semantics.rb', line 384

def per_base_n_content_rows(matrix)
  matrix.map.with_index do |row, i|
    base = row[0]
    n_count = row[1]
    {
      "@type" => [
        "Row",
        base_stat_class(base),
      ],
      "rowIndex" => i,
      "basePosition" => base,
      "nCount" => {
        "@type" => "BaseRatio",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000187" },
        "sio:SIO_000300" => n_count,
      },
    }
  end
end

#per_base_sequence_contentObject



304
305
306
307
308
309
# File 'lib/bio/fastqc/semantics.rb', line 304

def per_base_sequence_content
  {
    "@type" => "PerBaseSequenceContent",
    "hasRow" => per_base_sequence_content_rows(@fastqc_object[:per_base_sequence_content]),
  }
end

#per_base_sequence_content_rows(matrix) ⇒ Object



311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/bio/fastqc/semantics.rb', line 311

def per_base_sequence_content_rows(matrix)
  matrix.map.with_index do |row, i|
    base = row[0]
    guanine = row[1]
    adenine = row[2]
    thymine = row[3]
    chytosine = row[4]
    {
      "@type" => [
        "Row",
        base_stat_class(base),
      ],
      "rowIndex" => i,
      "basePosition" => base,
      "percentGuanine" => {
        "@type" => "BaseRatio",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000187" },
        "sio:SIO_000300" => guanine,
      },
      "percentAdenine" => {
        "@type" => "BaseRatio",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000187" },
        "sio:SIO_000300" => adenine,
      },
      "percentThymine" => {
        "@type" => "BaseRatio",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000187" },
        "sio:SIO_000300" => thymine,
      },
      "percentCytosine" => {
        "@type" => "BaseRatio",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000187" },
        "sio:SIO_000300" => chytosine,
      },
    }
  end
end

#per_base_sequence_qualityObject



214
215
216
217
218
219
# File 'lib/bio/fastqc/semantics.rb', line 214

def per_base_sequence_quality
  {
    "@type" => "PerBaseSequenceQuality",
    "hasRow" => per_base_sequence_quality_rows(@fastqc_object[:per_base_sequence_quality]),
  }
end

#per_base_sequence_quality_rows(matrix) ⇒ Object



221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/bio/fastqc/semantics.rb', line 221

def per_base_sequence_quality_rows(matrix)
  matrix.map.with_index do |row, i|
    base = row[0]
    mean = row[1]
    median = row[2]
    lower_quartile = row[3]
    upper_quartile = row[4]
    tenth_percentile = row[5]
    ninetieth_percentile = row[6]

    {
      "@type" => [
        "Row",
        base_stat_class(base),
      ],
      "rowIndex" => i,
      "basePosition" => base,
      "meanBaseCallQuality" => {
        "@type" => "PhredQualityScore",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000189" },
        "sio:SIO_000300" => mean,
      },
      "medianBaseCallQuality" => {
        "@type" => "PhredQualityScore",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000189" },
        "sio:SIO_000300" => median,
      },
      "baseCallQualityLowerQuartile" => {
        "@type" => "PhredQualityScore",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000189" },
        "sio:SIO_000300" => lower_quartile,
      },
      "baseCallQualityUpperQuartile" => {
        "@type" => "PhredQualityScore",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000189" },
        "sio:SIO_000300" => upper_quartile,
      },
      "baseCallQuality10thPercentile" => {
        "@type" => "PhredQualityScore",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000189" },
        "sio:SIO_000300" => tenth_percentile,
      },
      "baseCallQuality90thPercentile" => {
        "@type" => "PhredQualityScore",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000189" },
        "sio:SIO_000300" => ninetieth_percentile,
      },
    }
  end
end

#per_sequence_gc_contentObject



349
350
351
352
353
354
# File 'lib/bio/fastqc/semantics.rb', line 349

def per_sequence_gc_content
  {
    "@type" => "PerSequenceGCContent",
    "hasRow" => per_sequence_gc_content_rows(@fastqc_object[:per_sequence_gc_content]),
  }
end

#per_sequence_gc_content_rows(matrix) ⇒ Object



356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
# File 'lib/bio/fastqc/semantics.rb', line 356

def per_sequence_gc_content_rows(matrix)
  matrix.map.with_index do |row, i|
    gc_content = row[0]
    count = row[1]
    {
      "@type" => "Row",
      "rowIndex" => i,
      "percentGC" => {
        "@type" => "BaseRatio",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000187" },
        "sio:SIO_000300" => gc_content,
      },
      "sequenceReadCount" => {
        "@type" => "SequenceReadAmount",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000244" },
        "sio:SIO_000300" => count,
      },
    }
  end
end

#per_sequence_quality_scoresObject



276
277
278
279
280
281
# File 'lib/bio/fastqc/semantics.rb', line 276

def per_sequence_quality_scores
  {
    "@type" => "PerSequnceQualityScores",
    "hasRow" => per_sequence_quality_scores_rows(@fastqc_object[:per_sequence_quality_scores]),
  }
end

#per_sequence_quality_scores_rows(matrix) ⇒ Object



283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# File 'lib/bio/fastqc/semantics.rb', line 283

def per_sequence_quality_scores_rows(matrix)
  matrix.map.with_index do |row, i|
    quality = row[0]
    count = row[1]
    {
      "@type" => "Row",
      "rowIndex" => i,
      "baseCallQuality" => {
        "@type" => "PhredQualityScore",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000189" },
        "sio:SIO_000300" => quality,
      },
      "sequenceReadCount" => {
        "@type" => "SequenceReadAmount",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000244" },
        "sio:SIO_000300" => count,
      },
    }
  end
end

#per_tile_sequence_qualityObject



272
273
274
# File 'lib/bio/fastqc/semantics.rb', line 272

def per_tile_sequence_quality
  {}
end

#percent_gcObject



203
204
205
206
207
208
209
210
211
212
# File 'lib/bio/fastqc/semantics.rb', line 203

def percent_gc
  {
    "@type" => "percentGC",
    "sio:SIO_000221" => { "@id" => "obo:UO_0000187" },
    "sio:SIO_000300" => {
      "@value" => @fastqc_object[:percent_gc],
      "@type" => "xsd:decimal",
    }
  }
end

#rdf_versionObject



16
17
18
# File 'lib/bio/fastqc/semantics.rb', line 16

def rdf_version
  "0.2.0"
end

#sequence_duplication_levelsObject



437
438
439
440
441
442
# File 'lib/bio/fastqc/semantics.rb', line 437

def sequence_duplication_levels
  {
    "@type" => "SequenceDuplicationLevels",
    "hasRow" => sequence_duplication_levels_rows(@fastqc_object[:sequence_duplication_levels]),
  }
end

#sequence_duplication_levels_rows(matrix) ⇒ Object



444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
# File 'lib/bio/fastqc/semantics.rb', line 444

def sequence_duplication_levels_rows(matrix)
  matrix.map.with_index do |row, i|
    duplication_level = row[0]
    relative_count = row[1]
    {
      "@type" => "Row",
      "rowIndex" => i,

      "sequenceDuplicationLevel" => {
        "@type" => "SequenceDuplicationLevel",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000189" },
        "sio:SIO_000300" => duplication_level,
      },
      "sequenceReadRelativeCount" => {
        "@type" => "SequenceReadAmount",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000244" },
        "sio:SIO_000300" => relative_count,
      },
    }
  end
end

#sequence_lengthObject



192
193
194
195
196
197
198
199
200
201
# File 'lib/bio/fastqc/semantics.rb', line 192

def sequence_length
  {
    "@type" => "SequenceReadLength",
    "sio:SIO_000221" => { "@id" => "obo:UO_0000244" },
    "sio:SIO_000300" => {
      "@value" => @fastqc_object[:sequence_length],
      "@type" => "xsd:string",
    }
  }
end

#sequence_length_distributionObject



404
405
406
407
408
409
# File 'lib/bio/fastqc/semantics.rb', line 404

def sequence_length_distribution
  {
    "@type" => "SequenceLengthDistribution",
    "hasRow" => sequence_length_distribution_rows(@fastqc_object[:sequence_length_distribution]),
  }
end

#sequence_length_distribution_rows(matrix) ⇒ Object



411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
# File 'lib/bio/fastqc/semantics.rb', line 411

def sequence_length_distribution_rows(matrix)
  matrix.map.with_index do |row, i|
    length = row[0]
    count = row[1]
    {
      "@type" => "Row",
      "rowIndex" => i,

      "sequenceReadLength" => {
        "@type" => "SequenceReadLength",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000244" },
        "sio:SIO_000300" => length,
      },
      "sequenceReadCount" => {
        "@type" => "SequenceReadAmount",
        "sio:SIO_000221" => { "@id" => "obo:UO_0000244" },
        "sio:SIO_000300" => count,
      },
    }
  end
end

#sos_classObject

definition of classes



667
668
669
670
671
672
673
# File 'lib/bio/fastqc/semantics.rb', line 667

def sos_class
  [
    sos_class_general,
    sos_class_fastqc_modules,
    sos_class_for_values,
  ].flatten
end

#sos_class_fastqc_modulesObject



685
686
687
688
689
690
691
692
693
694
695
696
697
698
# File 'lib/bio/fastqc/semantics.rb', line 685

def sos_class_fastqc_modules
  [
    "PerBaseSequenceQuality",
    "PerTileSequenceQuality",
    "PerSequnceQualityScores",
    "PerBaseSequenceContent",
    "PerSequenceGCContent",
    "PerBaseNContent",
    "SequenceLengthDistribution",
    "SequenceDuplicationLevels",
    "OverrepresentedSequences",
    "KmerContent",
  ]
end

#sos_class_for_valuesObject



700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
# File 'lib/bio/fastqc/semantics.rb', line 700

def sos_class_for_values
  [
    "PhredQualityScore",
    "BaseRatio",
    "SequenceReadAmount",
    "SequenceReadRatio",
    "SequenceReadLength",
    "SequenceDuplicationLevel",
    "nContent",
    "percentGC",
    "medianBaseCallQuality",
    "meanBaseCallQuality",
    "totalSequences",
    "filteredSequences",
    "minimumSequenceLength",
    "maxSequenceLength",
    "meanSequenceLength",
    "medianSequenceLength",
  ]
end

#sos_class_generalObject



675
676
677
678
679
680
681
682
683
# File 'lib/bio/fastqc/semantics.rb', line 675

def sos_class_general
  [
    "SequenceStatisticsReport",
    "SequenceStatisticsMatrix",
    "Row",
    "ExactBaseStatistics",
    "BaseRangeStatistics",
  ]
end

#sos_data_properties_floatObject



774
775
776
777
778
779
780
781
782
783
784
785
786
# File 'lib/bio/fastqc/semantics.rb', line 774

def sos_data_properties_float
  [
    "baseCallQuality",
    "baseCallQuality10thPercentile",
    "baseCallQuality90thPercentile",
    "baseCallQualityLowerQuartile",
    "baseCallQualityUpperQuartile",
    "minSequenceLength",
    "maxSequenceLength",
    "meanSequenceLength",
    "medianSequenceLength",
  ]
end

#sos_data_properties_integerObject



768
769
770
771
772
# File 'lib/bio/fastqc/semantics.rb', line 768

def sos_data_properties_integer
  [
    "rowIndex",
  ]
end

#sos_data_properties_stringObject



757
758
759
760
761
762
763
764
765
766
# File 'lib/bio/fastqc/semantics.rb', line 757

def sos_data_properties_string
  [
    "fastqcVersion",
    "filename",
    "fileType",
    "encoding",
    "possibleSourceOfSequence",
    "overrepresentedSequence",
  ]
end

#sos_object_propertiesObject

definition of predicates



725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
# File 'lib/bio/fastqc/semantics.rb', line 725

def sos_object_properties
  [
    "hasMatrix",
    "totalSequences",
    "filteredSequences",
    "sequenceLength",
    "percentGC",
    "hasRow",
    "basePosition",
    "kmerSequence",
    "meanBaseCallQuality",
    "medianBaseCallQuality",
    "nCount",
    "observedPerExpectedMax",
    "observedPerExpectedMaxPosition",
    "observedPerExpectedOverall",
    "percentAdenine",
    "percentCytosine",
    "percentGC",
    "percentGuanine",
    "percentThymine",
    "sequenceDuplicationLevel",
    "sequenceReadCount",
    "sequenceReadLength",
    "sequenceReadPercentage",
    "sequenceReadRelativeCount",
    "overallMeanBaseCallQuality",
    "overallMedianBaseCallQuality",
    "overallNContent",
  ]
end

#sra_identifierObject



55
56
57
# File 'lib/bio/fastqc/semantics.rb', line 55

def sra_identifier
  @runid ? @runid : @fastqc_object[:filename].split(".")[0].split("_")[0]
end

#static_value_modulesObject



94
95
96
97
98
99
100
101
# File 'lib/bio/fastqc/semantics.rb', line 94

def static_value_modules
  [
    fastqc_version,
    filename,
    file_type,
    encoding,
  ]
end

#total_duplicate_percentageObject



433
434
435
# File 'lib/bio/fastqc/semantics.rb', line 433

def total_duplicate_percentage
  {}
end

#total_sequencesObject



170
171
172
173
174
175
176
177
178
179
# File 'lib/bio/fastqc/semantics.rb', line 170

def total_sequences
  {
    "@type" => "totalSequences",
    "sio:SIO_000221" => { "@id" => "obo:UO_0000244" },
    "sio:SIO_000300" => {
      "@value" => @fastqc_object[:total_sequences],
      "@type" => "xsd:integer",
    },
  }
end

#turtleObject



20
21
22
# File 'lib/bio/fastqc/semantics.rb', line 20

def turtle
  turtle_graph.dump(:ttl, prefixes: turtle_prefixes)
end

#turtle_graphObject



24
25
26
# File 'lib/bio/fastqc/semantics.rb', line 24

def turtle_graph
  RDF::Graph.new << JSON::LD::API.toRdf(json_ld_object)
end

#turtle_prefixesObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/bio/fastqc/semantics.rb', line 28

def turtle_prefixes
  {
    "obo" => "http://purl.obolibrary.org/obo/",
    "rdf" => "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    "rdfs" => "http://www.w3.org/2000/01/rdf-schema#",
    "dcterms" => "http://purl.org/dc/terms/",
    "pav" => "http://purl.org/pav/",
    "foaf" => "http://xmlns.com/foaf/0.1/",
    "sos" => "http://purl.jp/bio/10/quanto/ontology/sos#",
    "quanto" => "http://purl.jp/bio/10/quanto/resource/",
    "sio" => "http://semanticscience.org/resource/",
    "xsd" => "http://www.w3.org/2001/XMLSchema#",
  }
end

#uri_baseObject



51
52
53
# File 'lib/bio/fastqc/semantics.rb', line 51

def uri_base
  "http://purl.jp/bio/01/quanto"
end