Skip to content

Commit 8f15d3f

Browse files
committed
warn on unmappable chromosome
1 parent 2f64330 commit 8f15d3f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

genomefile.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,18 @@ func readChromosomMappings(fname string) map[string]string {
3636
log.Fatalf("[gsort] unable to open chromosome maping file: %s", fname)
3737
}
3838

39+
warned := false
3940
for {
4041
line, err := rdr.ReadString('\n')
4142
if len(line) > 0 {
4243
toks := strings.Split(strings.TrimSpace(line), "\t")
44+
if len(toks) == 1 {
45+
toks = append(toks, "[unknown]"+toks[0])
46+
if !warned {
47+
log.Printf("[gsort] warning unmappable chromosome: %s.", toks[0])
48+
warned = true
49+
}
50+
}
4351
result[toks[0]] = toks[1]
4452
}
4553
if err == io.EOF {

0 commit comments

Comments
 (0)