Top Level Namespace

Defined Under Namespace

Modules: Bio, BioMaf

Constant Summary collapse

PRINTERS =
{
  'flat' => :FlatPrinter,
  'stack' => :CallStackPrinter
}

Instance Method Summary collapse

Instance Method Details

#apply_options(options, tiler) ⇒ Object



21
22
23
24
25
# File 'bin/maf_tile', line 21

def apply_options(options, tiler)
  tiler.reference = options.ref if options.ref
  tiler.species = options.species
  tiler.species_map = options.species_map
end

#build_index(maf, index) ⇒ Object



18
19
20
21
22
23
24
# File 'bin/maf_index', line 18

def build_index(maf, index)
  parser = Bio::MAF::Parser.new(maf,
                                :chunk_reader => $options.reader,
                                :parse_extended => false)
  idx = Bio::MAF::KyotoIndex.build(parser, index)
  idx.close
end

#desc(seq) ⇒ Object



7
8
9
# File 'bin/find_overlaps', line 7

def desc(seq)
  "#{seq.source}:#{seq.start}-#{seq.end}"
end

#parse_interval(line) ⇒ Object



9
10
11
12
13
14
# File 'bin/maf_tile', line 9

def parse_interval(line)
  src, r_start_s, r_end_s, _ = line.split(nil, 4)
  r_start = r_start_s.to_i
  r_end = r_end_s.to_i
  return Bio::GenomicInterval.zero_based(src, r_start, r_end)
end

#target_for(base, interval, &blk) ⇒ Object



16
17
18
19
# File 'bin/maf_tile', line 16

def target_for(base, interval, &blk)
  path = "#{base}_#{interval.zero_start}-#{interval.zero_end}.fa"
  File.open(path, 'w', &blk)
end