Method: Ensembl::Core::Sliceable#slice
- Defined in:
- lib/bio-ensembl/core/activerecord.rb
#slice ⇒ Ensembl::Core::Slice
The Sliceable#slice method takes the coordinates on a reference and creates a Ensembl::Core::Slice object.
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/bio-ensembl/core/activerecord.rb', line 86 def slice start, stop, strand = nil, nil, nil if self.class == Ensembl::Core::Intron or self.class.column_names.include?('seq_region_start') start = self.seq_region_start end if self.class == Ensembl::Core::Intron or self.class.column_names.include?('seq_region_end') stop = self.seq_region_end end if self.class == Ensembl::Core::Intron or self.class.column_names.include?('seq_region_strand') strand = self.seq_region_strand else #FIXME: we shouldn't do this, but can't #project if no strand given strand = 1 end return Ensembl::Core::Slice.new(self.seq_region, start, stop, strand) end |