Skip to content

Commit

Permalink
MT: don't uppercase all
Browse files Browse the repository at this point in the history
  • Loading branch information
brentp committed Apr 9, 2021
1 parent 7be61a8 commit faa1e6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/seqcoverpkg/transcript.nim
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,14 @@ proc `%`*[T](table: TableRef[string, T]): JsonNode =

proc get_chrom(chrom:string, dp:var Cover, fai:Fai): string =
## add or remove "chr" to match chromosome names.
const MTs = ["MT", "CHRM", "CHRMT", "M"]
const MTs = ["MT", "chrM", "chrMT", "M"]
var chroms = dp.chromosomes(fai)
if chrom in chroms: return chrom
if chrom[0] != 'c' and ("chr" & chrom) in chroms:
result = "chr" & chrom
elif chrom[0] == 'c' and chrom.len > 3 and chrom[1] == 'h' and chrom[2] == 'r' and chrom[3..chrom.high] in chroms:
result = chrom[3..chrom.high]
elif chrom.toUpperAscii in MTs: # try all the MT chroms.
elif chrom in MTs: # try all the MT chroms.
for c in MTs:
if c in chroms:
return c
Expand Down

0 comments on commit faa1e6f

Please sign in to comment.