Class: BioInterchange::FALDO

Inherits:
Object
  • Object
show all
Defined in:
lib/biointerchange/faldo.rb

Class Method Summary collapse

Class Method Details

.afterObject

This predicate is used when you want to describe a non-inclusive range. Only used in the in between position to say it is after a nucleotide, but before the next one. (biohackathon.org/resource/faldo#after)



68
69
70
# File 'lib/biointerchange/faldo.rb', line 68

def self.after
  return RDF::URI.new('http://biohackathon.org/resource/faldo#after')
end

.BagOfRegionsObject

Used to describe a location that consists out of a number of Regions but where the order is not known. e.g. the odly named order keyword in a INSDC fle. (biohackathon.org/resource/faldo#BagOfRegions)



8
9
10
# File 'lib/biointerchange/faldo.rb', line 8

def self.BagOfRegions
  return RDF::URI.new('http://biohackathon.org/resource/faldo#BagOfRegions')
end

.beforeObject

This used to indicate that the feature is found before the exact position. Use to indicate, for example, a cleavage site. The cleavage happens between two amino acids before one and after the other. (biohackathon.org/resource/faldo#before)



62
63
64
# File 'lib/biointerchange/faldo.rb', line 62

def self.before
  return RDF::URI.new('http://biohackathon.org/resource/faldo#before')
end

.beginObject

The inclusive begin position of a position. Also known as start. (biohackathon.org/resource/faldo#begin)



92
93
94
# File 'lib/biointerchange/faldo.rb', line 92

def self.begin
  return RDF::URI.new('http://biohackathon.org/resource/faldo#begin')
end

.Both_strandsObject

The ‘both strands position’ means that the region spans both strands instead of one. In GFF3 displayed as 0. This does not mean that the position is one or the other strand, but that is best described as being on both. (biohackathon.org/resource/faldo#BothStrandsPosition)



32
33
34
# File 'lib/biointerchange/faldo.rb', line 32

def self.Both_strands
  return RDF::URI.new('http://biohackathon.org/resource/faldo#BothStrandsPosition')
end

.CollectionOfRegionsObject

Sometimes a location of a feature is defined by a collection of regions e.g. INSDC join and order. One should always try to model the semantics more accuratly these are fallback options to encode legacy data. (biohackathon.org/resource/faldo#CollectionOfRegions)



14
15
16
# File 'lib/biointerchange/faldo.rb', line 14

def self.CollectionOfRegions
  return RDF::URI.new('http://biohackathon.org/resource/faldo#CollectionOfRegions')
end

.endObject

The inclusive end of the position. (biohackathon.org/resource/faldo#end)



98
99
100
# File 'lib/biointerchange/faldo.rb', line 98

def self.end
  return RDF::URI.new('http://biohackathon.org/resource/faldo#end')
end

.Exact_positionObject

Use when you exactly know the position. (biohackathon.org/resource/faldo#ExactPosition)



56
57
58
# File 'lib/biointerchange/faldo.rb', line 56

def self.Exact_position
  return RDF::URI.new('http://biohackathon.org/resource/faldo#ExactPosition')
end

.Fuzzy_positionObject

Use this class to indicate that you lack exact position data. (biohackathon.org/resource/faldo#FuzzyPosition)



86
87
88
# File 'lib/biointerchange/faldo.rb', line 86

def self.Fuzzy_position
  return RDF::URI.new('http://biohackathon.org/resource/faldo#FuzzyPosition')
end

.has_parent?(uri, parent) ⇒ Boolean

Recursively tries to determine the parent for a given URI.

uri

URI that is tested for whether it has the given parent URI.

parent

Parent URI.

Returns:

  • (Boolean)


235
236
237
238
239
240
241
242
243
# File 'lib/biointerchange/faldo.rb', line 235

def self.has_parent?(uri, parent)
  if @@parent_properties.has_key?(uri) then
    if @@parent_properties[uri] == parent then
      return true
    end
    return has_parent?(@@parent_properties[uri], parent)
  end
  return false
end

.In_between_positionsObject

This denotes that a feature is in between two other positions that are both known exactly and next to each other. An example is a restriction enzyme cutting site. The cut is after one nucleotide position and before another nucleotide position (hence, in between). (biohackathon.org/resource/faldo#InBetweenPosition)



44
45
46
# File 'lib/biointerchange/faldo.rb', line 44

def self.In_between_positions
  return RDF::URI.new('http://biohackathon.org/resource/faldo#InBetweenPosition')
end

.Indeterminate_position_within_a_rangeObject

Use when you have an idea of the range in which you can find the position, but you cannot be sure about the exact position. (biohackathon.org/resource/faldo#InRangePosition)



80
81
82
# File 'lib/biointerchange/faldo.rb', line 80

def self.Indeterminate_position_within_a_range
  return RDF::URI.new('http://biohackathon.org/resource/faldo#InRangePosition')
end

.is_class?(uri) ⇒ Boolean

Determines whether the given URI is a class.

uri

URI that is tested for being a class

Returns:

  • (Boolean)


170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/biointerchange/faldo.rb', line 170

def self.is_class?(uri)
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#BagOfRegions') then
    return true
  end
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#CollectionOfRegions') then
    return true
  end
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#ForwardStrandPosition') then
    return true
  end
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#StrandedPosition') then
    return true
  end
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#BothStrandsPosition') then
    return true
  end
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#ReverseStrandPosition') then
    return true
  end
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#InBetweenPosition') then
    return true
  end
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#Position') then
    return true
  end
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#ExactPosition') then
    return true
  end
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#OneOfPosition') then
    return true
  end
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#InRangePosition') then
    return true
  end
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#FuzzyPosition') then
    return true
  end
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#Region') then
    return true
  end
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#ListOfRegions') then
    return true
  end
  return false
end

.is_datatype_property?(uri) ⇒ Boolean

Determines whether the given URI is a datatype property.

uri

URI that is tested for being a datatype property

Returns:

  • (Boolean)


160
161
162
163
164
165
# File 'lib/biointerchange/faldo.rb', line 160

def self.is_datatype_property?(uri)
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#position') then
    return true
  end
  return false
end

.is_named_individual?(uri) ⇒ Boolean

Determines whether the given URI is a named individual.

uri

URI that is tested for being a named individual

Returns:

  • (Boolean)


219
220
221
# File 'lib/biointerchange/faldo.rb', line 219

def self.is_named_individual?(uri)
  return false
end

.is_object_property?(uri) ⇒ Boolean

Determines whether the given URI is an object property.

uri

URI that is tested for being an object property

Returns:

  • (Boolean)


135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/biointerchange/faldo.rb', line 135

def self.is_object_property?(uri)
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#before') then
    return true
  end
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#after') then
    return true
  end
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#begin') then
    return true
  end
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#end') then
    return true
  end
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#reference') then
    return true
  end
  if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#location') then
    return true
  end
  return false
end

.ListOfRegionsObject

As an ordered list of regions (but the list might not be complete) (biohackathon.org/resource/faldo#ListOfRegions)



122
123
124
# File 'lib/biointerchange/faldo.rb', line 122

def self.ListOfRegions
  return RDF::URI.new('http://biohackathon.org/resource/faldo#ListOfRegions')
end

.locationObject

This is the link between the concept whose location you are annotating the and its range or position. For example, when annotating the region that describes an exon, the exon would be the subject and the region would be the object of the triple or: ‘active site’ ‘location’ [is] ‘position 3’. (biohackathon.org/resource/faldo#location)



128
129
130
# File 'lib/biointerchange/faldo.rb', line 128

def self.location
  return RDF::URI.new('http://biohackathon.org/resource/faldo#location')
end

.Negative_strandObject

The position is on the reverse (complement, 3’ to 5’) strand of the sequence. Shown as ‘-’ in GTF and GFF3. (biohackathon.org/resource/faldo#ReverseStrandPosition)



38
39
40
# File 'lib/biointerchange/faldo.rb', line 38

def self.Negative_strand
  return RDF::URI.new('http://biohackathon.org/resource/faldo#ReverseStrandPosition')
end

.One_of_positionsObject

The position must be one of the more detailed positions listed by the location predicate. (biohackathon.org/resource/faldo#OneOfPosition)



74
75
76
# File 'lib/biointerchange/faldo.rb', line 74

def self.One_of_positions
  return RDF::URI.new('http://biohackathon.org/resource/faldo#OneOfPosition')
end

.PositionObject

Superclass to group the general concept of a position on a sequence. The sequence is designated via the reference predicate. (biohackathon.org/resource/faldo#Position)



50
51
52
# File 'lib/biointerchange/faldo.rb', line 50

def self.Position
  return RDF::URI.new('http://biohackathon.org/resource/faldo#Position')
end

.positionObject

A position on the first amino acid or nucleotide of a sequence has the value 1, i.e. Python style array indexing as opposed to Java/C indexes. (biohackathon.org/resource/faldo#position)



110
111
112
# File 'lib/biointerchange/faldo.rb', line 110

def self.position
  return RDF::URI.new('http://biohackathon.org/resource/faldo#position')
end

.Positive_strandObject

The position is on the forward (positive, 5’ to 3’) strand. Shown as a ‘+’ in GFF3 and GTF. (biohackathon.org/resource/faldo#ForwardStrandPosition)



20
21
22
# File 'lib/biointerchange/faldo.rb', line 20

def self.Positive_strand
  return RDF::URI.new('http://biohackathon.org/resource/faldo#ForwardStrandPosition')
end

.referenceObject

The reference is the resource that determines where the position value offsets into. For example, it points to a contig or a genome assembly. (biohackathon.org/resource/faldo#reference)



116
117
118
# File 'lib/biointerchange/faldo.rb', line 116

def self.reference
  return RDF::URI.new('http://biohackathon.org/resource/faldo#reference')
end

.RegionObject

A region describes a length of sequence – with a start position and end position – that represents a feature on a Sequence. i.e. a gene (biohackathon.org/resource/faldo#Region)



104
105
106
# File 'lib/biointerchange/faldo.rb', line 104

def self.Region
  return RDF::URI.new('http://biohackathon.org/resource/faldo#Region')
end

.Stranded_positionObject

Part of the coordinate system denoting on which strand the feature can be found. If you do not yet know which stand the feature is on, you should tag the position with just this class. If you know more you should use one of the subclasses. This means a region descibred with a ‘.’ in GFF3. A GFF3 unstranded position does not have this type in FALDO – those are just a ‘position’. (biohackathon.org/resource/faldo#StrandedPosition)



26
27
28
# File 'lib/biointerchange/faldo.rb', line 26

def self.Stranded_position
  return RDF::URI.new('http://biohackathon.org/resource/faldo#StrandedPosition')
end

.with_parent(uris, parent) ⇒ Object

Returns only those URIs that fall under a designated parent URI.

uris

Set of URIs that are tested whether they have the given parent URI.

parent

Parent URI.



227
228
229
# File 'lib/biointerchange/faldo.rb', line 227

def self.with_parent(uris, parent)
  return uris.select { |uri| has_parent?(uri, parent) }
end