Skip to content

Commit

Permalink
more clarifications from #96
Browse files Browse the repository at this point in the history
indicate number of autosomal variants.
limit number of X and y chromosomes as we don't need so many
  • Loading branch information
brentp committed Mar 3, 2022
1 parent 6956eff commit 5bfae6f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/somalierpkg/findsites.nim
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ proc findsites_main*() =
var used = newSeqOfCap[Variant](8192)
var usedxy = newSeqOfCap[Variant](8192)
var empty: seq[region]
var xcounts = 0 # prevent too many X
var ycounts = 0 # prevent too many y

for v in saved:
let chrom = $v.v.CHROM
Expand All @@ -268,14 +270,22 @@ proc findsites_main*() =

#discard wtr.write_variant(v.v)
if chrom in ["chrX", "X", "Y", "chrY"]:
if chrom in ["chrX", "X"]
if xcounts > 10000:
continue
xcounts += 1
if chrom in ["chrY", "Y"]:
if ycounts > 5000:
continue
ycounts += 1
usedxy.add(v.v.copy())
else:
vs.add(v.v.start)
used.add(v.v.copy())

added[v.v.CHROM] = vs

stderr.write_line &"sorted and filtered to {used.len} variants. now dropping INFOs and writing"
stderr.write_line &"sorted and filtered to {used.len} autosomal variants. now dropping INFOs and writing"
if used.len.int > uint16.high.int:
used = used[0..<uint16.high.int]

Expand Down

0 comments on commit 5bfae6f

Please sign in to comment.