Skip to content

Fai example

Brent Pedersen edited this page Apr 26, 2019 · 1 revision
import hts

var fai:Fai
if not fai.open("/data/human/g1k_v37_decoy.fa"):
  quit "couldn't open fasta"

for i in 0..<fai.len:
  var chrom_name = fai[i]
  var chrom_len = fai.chrom_len(chrom_name)

  #var full_sequence = fai.get(chrom_name)
  var sub_seq = fai.get(chrom_name, 10000, 10100)
  echo chrom_name, " ", chrom_len, " ", sub_seq
Clone this wiki locally