Skip to content

Commit

Permalink
fix pairs file header bug of imargi_distfilter.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
frankyan committed Jul 24, 2020
1 parent a9bea76 commit 0a22738
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/imargi_distfilter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,19 @@ zcat $input_file |\
if(NR % 1000000 == 0){print NR" records processed ..."}
if($0 ~ /^#/){
if($0 ~/^#columns/){
print "#samheader: @PG\tID:imargi_distfilter.sh\tPN:imargi_distfilter.sh\tCL:"commandline > output_file;
PP_ID = gensub(/.+ID:([^\t]+)\t.+/, "\\1", "g", previous_line);
print "#samheader: @PG\tID:imargi_distfilter.sh\tPN:imargi_distfilter.sh\tCL:"commandline"\tPP:"PP_ID > output_file;
print $0 > output_file;
if(filter_flag=="output"){
print "#samheader: @PG\tID:imargi_distfilter.sh\tPN:imargi_distfilter.sh\tCL:"commandline > filterOut_file;
print "#samheader: @PG\tID:imargi_distfilter.sh\tPN:imargi_distfilter.sh\tCL:"commandline"\tPP:"PP_ID > filterOut_file;
print $0 > filterOut_file;
}
}else{
print $0 > output_file;
if(filter_flag=="output"){
print $0 > filterOut_file;
}
previous_line = $0;
}
}else{
if($2!=$4){
Expand Down

0 comments on commit 0a22738

Please sign in to comment.