Skip to content

Commit

Permalink
larger track height with fewer tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
brentp committed Apr 6, 2020
1 parent 1f1b75e commit 3ddeaf9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions jigv.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type Track* = object
file_type: FileType
path*:string
name*: string
n_tracks*:int

var tracks*: seq[Track]
var index_html: string
Expand Down Expand Up @@ -53,11 +54,14 @@ proc get_type(T:Track): string =
raise newException(ValueError, "unknown file type for " & $T.file_type)

proc height(T:Track): int =
var mult = 1
if T.n_tracks < 3:
mult = 2
if T.path.endsWith(".cram") or T.path.endsWith(".bam"):
return 250
return 250 * mult
case T.file_type
of FileType.CRAM, FileType.BAM:
return 250
return 250 * mult
of FileType.VCF, FileType.BCF:
return 60
else:
Expand Down Expand Up @@ -361,7 +365,7 @@ proc main() =
var first_vcf = -1
for i, f in args.files:
var fs = f.split("#")
var tr = Track(name: extractFileName(f), path: f)
var tr = Track(name: extractFileName(f), path: f, n_tracks:args.files.len)
if fs.len == 2:
tr.path = fs[0]
tr.name = fs[1]
Expand Down

0 comments on commit 3ddeaf9

Please sign in to comment.