| Module | Ensembl::Core::Sliceable |
| In: |
lib/ensembl/core/activerecord.rb
lib/ensembl/core/transform.rb |
The Sliceable#length method returns the length of the feature (based on seq_region_start and seq_region_end.
| Arguments: | none |
| Returns: | sequence |
The Sliceable#project method is used to transfer coordinates from one coordinate system to another. Suppose you have a feature on a contig in human (let’s say on contig AC000031.6.1.38703) and you want to know the coordinates on the chromosome. This is a projection of coordinates from a higher ranked coordinate system to a lower ranked coordinate system. Projections can also be done from a chromosome to the contig level. However, it might be possible that more than one contig has to be included and that there exist gaps between the contigs. The output of this method therefore is an array of Slice and Gap objects.
At the moment, projections can only be done if the two coordinate systems are linked directly in the ‘assembly’ table.
# Get a contig slice in cow and project to scaffold level
# (i.e. going from a high rank coord system to a lower rank coord
# system)
original_feature = Gene.find(85743)
target_slices = original_feature.project('scaffold')
Arguments:
| Returns: | an array consisting of Slices and, if necessary, Gaps |
The Sliceable#seq method takes the coordinates on a reference, transforms onto the seqlevel coordinate system if necessary, and retrieves the sequence.
| Arguments: | none |
| Returns: | sequence |
The Sliceable#slice method takes the coordinates on a reference and creates a Ensembl::Core::Slice object.
| Arguments: | none |
| Returns: | Ensembl::Core::Slice object |
The Sliceable#start method is a convenience method and returns self.seq_region_start.
| Arguments: | none |
| Returns: | sequence |
The Sliceable#stop method is a convenience method and returns self.seq_region_end.
| Arguments: | none |
| Returns: | sequence |
The Sliceable#strand method is a convenience method and returns self.seq_region_strand.
| Arguments: | none |
| Returns: | sequence |
The transform method is used to transfer coordinates for a feature from one coordinate system to another. It basically creates a clone of the original feature and changes the seq_region, start position, stop position and strand.
Suppose you have a feature on a contig in human (let’s say on contig AC000031.6.1.38703) and you want to know the coordinates on the chromosome. This is a transformation of coordinates from a higher ranked coordinate system to a lower ranked coordinate system. Transformations can also be done from a chromosome to the contig level.
In contrast to the project method of Sliceables, the coordinates of a feature can only transformed to the target coordinate system if there is no ambiguity to which SeqRegion.
For example, gene A can be transferred from the chromosome system to the clone coordinate system, whereas gene B can not.
gene A gene B
|---<=====>--------------------<=====>----------------| chromosome
|-----------| |-------| |---------| clones
|-----------| |-------| |--------|
gene_a.transform('clone') --> gene
gene_b.transform('clone') --> nil
At the moment, transformations can only be done if the two coordinate systems are linked directly in the ‘assembly’ table.
# Get a gene in cow and transform to scaffold level
# (i.e. going from a high rank coord system to a lower rank coord
# system)
# Cow scaffold Chr4.10 lies on Chr4 from 8030345 to 10087277 on the
# reverse strand
source_gene = Gene.find(2408)
target_gene = source_gene.transform('scaffold')
puts source_gene.seq_region.name #--> 4
puts source_gene.seq_region_start #--> 8104409
puts source_gene.seq_region_end #--> 8496477
puts source_gene.seq_region_strand #--> -1
puts target_gene.seq_region.name #--> Chr4.003.10
puts target_gene.seq_region_start #--> 1590800
puts target_gene.seq_region_end #--> 1982868
puts target_gene.seq_region_strand #--> 1
Arguments:
| Returns: | nil or an object of the same class as self |