Module: GenomicLocus

Includes:
IntervalList::Interval
Included in:
Fasta::Chrom, GTF::Feature, Position, Region, Mutation, Mutation::Record, SegFile::Segment
Defined in:
lib/genomic_locus.rb

Defined Under Namespace

Classes: Position, Region

Instance Method Summary collapse

Methods included from IntervalList::Interval

#above?, #below?, #center, #clone, #contains?, #diff, #dist, #intersect, #overlaps?, #size, #union

Instance Method Details

#default_stopObject



34
35
36
37
# File 'lib/genomic_locus.rb', line 34

def default_stop
  # this should always be correct! Even if there is a dash.
  start + ref.size - 1
end

#locObject



30
31
32
# File 'lib/genomic_locus.rb', line 30

def loc
  @loc ||= "#{short_chrom}:#{start}".to_sym
end

#long_chromObject



43
44
45
# File 'lib/genomic_locus.rb', line 43

def long_chrom
  @long_chrom ||= "chr#{short_chrom}"
end

#rangeObject



39
40
41
# File 'lib/genomic_locus.rb', line 39

def range
  @range ||= "#{short_chrom}:#{start}-#{stop}".to_sym
end

#short_chromObject



47
48
49
# File 'lib/genomic_locus.rb', line 47

def short_chrom
  @short_chrom ||= seqname.sub(/^chr/,'')
end