Skip to content

Commit

Permalink
warn on unmappable chromosome
Browse files Browse the repository at this point in the history
  • Loading branch information
brentp committed Oct 28, 2019
1 parent 2f64330 commit 8f15d3f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions genomefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,18 @@ func readChromosomMappings(fname string) map[string]string {
log.Fatalf("[gsort] unable to open chromosome maping file: %s", fname)
}

warned := false
for {
line, err := rdr.ReadString('\n')
if len(line) > 0 {
toks := strings.Split(strings.TrimSpace(line), "\t")
if len(toks) == 1 {
toks = append(toks, "[unknown]"+toks[0])
if !warned {
log.Printf("[gsort] warning unmappable chromosome: %s.", toks[0])
warned = true
}
}
result[toks[0]] = toks[1]
}
if err == io.EOF {
Expand Down

0 comments on commit 8f15d3f

Please sign in to comment.