Skip to content

Commit

Permalink
allow passing an index to --sample to get i'th index from VCF
Browse files Browse the repository at this point in the history
  • Loading branch information
brentp committed Sep 13, 2018
1 parent 4aa6a02 commit acc55b1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/duphold.nim
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ Options:
-b --bam <path> path to indexed BAM/CRAM
-f --fasta <path> indexed fasta reference.
-t --threads <int> number of decompression threads. [default: 4]
-s --sample <string> optional VCF sample to annotate
-s --sample <string> optional VCF sample name or index to annotate
-o --output <string> output VCF/BCF (default is VCF to stdout) [default: -]
-h --help show help
""")
Expand Down Expand Up @@ -303,7 +303,10 @@ Options:
if $args["--sample"] != "nil":
sample_i = vcf.samples.find($args["--sample"])
if sample_i < 0:
quit "sample:" & $args["--sample"] & "not found in vcf"
try:
sample_i = parseInt($args["--sample"])
except:
quit "sample:" & $args["--sample"] & "not found in vcf"

open(bam, $args["--bam"], index=true, threads=parseInt($args["--threads"]), fai=($args["--fasta"]))
if bam == nil:
Expand Down

0 comments on commit acc55b1

Please sign in to comment.