Skip to content

Commit

Permalink
Merge commit 'refs/pull/111/head' of github.com:wtsi-npg/p4 into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
dkj committed Jul 31, 2015
2 parents 75d5a8f + 9b877d0 commit de3f52d
Show file tree
Hide file tree
Showing 11 changed files with 1,960 additions and 124 deletions.
7 changes: 7 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
CHANGES LOG
-----------

release 0.17
- human split with no target align (secondary stage) template introduced
- initial work for stage one (bcl, adapter, phiX and spatial filter to split processing) using templates
- bammarkduplicates reintroduced for unaligned file because downstream qc processing relies on presence of markdups_metrics file
- library cram merging: merge_aligned.json and merge_final_output_prep.json
- remove potential deadlock by using non-blocking open of STDIN

release 0.16.4
- add extra branch to teepot command in to stream seqchksum output downstream (instead of using a file as an internal node)

Expand Down
12 changes: 8 additions & 4 deletions bin/viv.pl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use File::Slurp;
use JSON;
use POSIX;
use Fcntl;
use File::Temp qw/ tempdir /;
use Getopt::Std;
use Readonly;
Expand Down Expand Up @@ -303,18 +304,21 @@ sub _fork_off {
$0 .= q{ (pending }.$node->{'id'}.qq{: $cmd)}; #rename process so fork can be easily identified whilst open waits on fifo
open STDERR, q(>), $node->{'id'}.q(.).$$.q(.err) or croak "Failed to reset STDERR, pid $$ with cmd: $cmd";
select(STDERR);$|=1;
print STDERR "Process $$ for cmd $cmd:\n";
print STDERR ' fileno(STDERR,'.(fileno STDERR).")\n";
if(not $node->{use_STDIN}) { $node->{'STDIN'} ||= '/dev/null'; }
if($node->{'STDIN'}) {
open STDIN, q(<), $node->{'STDIN'} or croak "Failed to reset STDIN, pid $$ with cmd: $cmd";
sysopen STDIN, $node->{'STDIN'}, O_RDONLY|O_NONBLOCK or croak "Failed to reset STDIN, pid $$ with cmd: $cmd\n$!";
fcntl STDIN, F_SETFL, (fcntl STDIN,F_GETFL,0 or croak "fcntl F_GETFL fail $!")&~O_NONBLOCK or croak "fcntl F_SETFL fail $!" ;
}
print STDERR ' fileno(STDIN,'.(fileno STDIN).') reading from '.($node->{'STDIN'}?$node->{'STDIN'}:'stdin') ."\n";
if(not $node->{use_STDOUT}) { $node->{'STDOUT'} ||= '/dev/null'; }
if($node->{'STDOUT'}) {
open STDOUT, q(>), $node->{'STDOUT'} or croak "Failed to reset STDOUT, pid $$ with cmd: $cmd";
}
print STDERR "Process $$ for cmd $cmd:\n";
print STDERR ' fileno(STDIN,'.(fileno STDIN).') reading from '.($node->{'STDIN'}?$node->{'STDIN'}:'stdin') ."\n";
print STDERR ' fileno(STDOUT,'.(fileno STDOUT).') writing to '.($node->{'STDOUT'}?$node->{'STDOUT'}:'stdout') ."\n";
print STDERR ' fileno(STDERR,'.(fileno STDERR).")\n";
print STDERR ' select waiting on STDIN' ."\n";
my$rin="";vec($rin,fileno(STDIN),1)=1; select($rin,undef,undef,undef);
print STDERR " execing....\n";
exec @cmd or croak qq[Failed to exec cmd: ], join " ", @cmd;
}
Expand Down
4 changes: 2 additions & 2 deletions bin/vtfp.pl
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ sub subst_walk {
}
}
elsif(ref $elem eq q[ARRAY]) {
for my $i (0 .. $#{$elem}) {
for my $i (reverse (0 .. $#{$elem})) {
# if one of the elements is a subst_param hash,
if(ref $elem->[$i] eq q[HASH] and my $param_name = $elem->[$i]->{subst}) {
# value for a "subst" key must always be the name of a parameter
Expand Down Expand Up @@ -476,7 +476,7 @@ sub fetch_subst_value {
$logger->($VLFATAL, q[subst_constructor vals attribute must be array, param_name: ], $param_name);
}

for my $i (0..$#$vals) {
for my $i (reverse (0..$#$vals)) {
if(ref $vals->[$i] eq q[HASH] and $vals->[$i]->{subst}) {
$vals->[$i] = fetch_subst_value($vals->[$i]->{subst}, $param_store, $subst_requests);
if(ref $vals->[$i] eq q[ARRAY]) {
Expand Down
Loading

0 comments on commit de3f52d

Please sign in to comment.