<commit_before>// read genome files
package ggd_utils

import (
	"bytes"
	"io"
	"regexp"
	"strconv"

	"github.com/brentp/xopen"
)

type GenomeFile struct {
	Lengths map[string]int
	Order   map[string]int
	path    string
}

// Less checks if one chromosome occurs before the other.
func (g *GenomeFile) Less(a, b string) bool {
	return g.Order[a] <= g.Order[b]
}

func ReadGenomeFile(path string) (*GenomeFile, error) {

	rdr, err := xopen.Ropen(path)
	if err != nil {
		return nil, err<commit_msg>godoc<commit_after>// read genome files
package ggd_utils

import (
	"bytes"
	"io"
	"regexp"
	"strconv"

	"github.com/brentp/xopen"
)

// GenomeFile has the Lengths and Orders of the chromosomes.
type GenomeFile struct {
	Lengths map[string]int
	Order   map[string]int
	path    string
}

// Less checks if one chromosome occurs before the other.
func (g *GenomeFile) Less(a, b string) bool {
	return g.Order[a] <= g.Order[b]
}

// ReadGenomeFile returns a GenomeFile struct
func ReadGenomeFile(path string) (*GenomeFile, error) {

	rdr, err := xopen.Ropen(path)
	if err != nil {
		return nil, err
{'fraction_non_alphanumeric': 0.11802378774016468, 'fraction_numerical': 0.0, 'mean_word_length': 3.9279279279279278, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '52438', 'n_tokens_mistral': 422, 'n_tokens_neox': 402, 'n_words': 121}