Skip to content

Commit

Permalink
#206 add PG records to 'view'
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Tarasov committed Sep 10, 2016
1 parent 4117b3f commit b7499b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion sambamba/view.d
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of Sambamba.
Copyright (C) 2012-2014 Artem Tarasov <lomereiter@gmail.com>
Copyright (C) 2012-2016 Artem Tarasov <lomereiter@gmail.com>
Sambamba is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -35,6 +35,7 @@ import sambamba.utils.view.headerserializer;
import sambamba.utils.common.bed;

import bio.core.utils.format;
import utils.version_ : addPG;

import std.stdio;
import std.string;
Expand Down Expand Up @@ -129,6 +130,8 @@ double subsample_frac; // NaN by default
ulong subsampling_seed;
string bed_filename;

string[] unparsed_args;

version(standalone) {
int main(string[] args) {
return view_main(args);
Expand All @@ -142,6 +145,8 @@ int view_main(string[] args) {
subsampling_seed <<= 32;
subsampling_seed += unpredictableSeed;

unparsed_args = args.dup;

try {

getopt(args,
Expand Down Expand Up @@ -221,6 +226,9 @@ int sambambaMain(T)(T _bam, TaskPool pool, string[] args)
else
output_file = File(output_filename, "w+");

if (!header_only) // = some processing is done
addPG("view", unparsed_args, bam.header);

if (header_only && !count_only) {
// write header to stdout
(new HeaderSerializer(stdout, format)).writeln(bam.header);
Expand Down
2 changes: 1 addition & 1 deletion utils/version_.d
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module utils.version_;

immutable string VERSION = "0.6.3";
immutable string VERSION = "0.6.4";

import bio.sam.header;
import std.array : join;
Expand Down

0 comments on commit b7499b0

Please sign in to comment.