std::string GenomicRegionCollection<T>::AsBEDString(const BamHeader& h) const {
  
  if (m_grv->size() ==  0)
    return std::string(); 

  std::stringstream ss;
  //for (auto& i : *m_grv)
  for (typename std::vector<T>::const_iterator i = m_grv->begin(); i != m_grv->end(); ++i)
    ss << i->ChrName(h) << "\t" << i->pos1 << "\t" << i->pos2 << "\t" << i->strand << std::endl;

  return ss.str();

}