Skip to content

Commit

Permalink
ignore null changes, write sample name to STDERR
Browse files Browse the repository at this point in the history
  • Loading branch information
gringer committed Oct 30, 2016
1 parent 26d305a commit d2dd5bd
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions mpileup2Proportion.pl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"Assembly", "Position", "Coverage", "ref", "cR",
"pR,A,C,G,T,d,i,InsMode");
} else {
if($sampleName){
printf(STDERR "%s,", "Sample");
}
printf(STDERR "%s,%s,%s,%s,%s,%s\n",
"Assembly", "Position", "Coverage", "ref", "cR",
"pR,A,C,G,T,d,i,InsMode,Variant");
Expand Down Expand Up @@ -180,17 +183,22 @@
} elsif($sortedAlleles[0] ne "r"){
$consAllele = $sortedAlleles[0];
}
printf(STDERR "%s,%d,%d,%s,", $refName, $pos, $cov, $refAllele);
printf(STDERR "%0.2f,%0.2f,%0.2f,%0.2f,%0.2f,%0.2f,%0.2f,%0.2f",
$rc, $pr, $pa, $pc, $pg, $pt, $pd, $pi);
if($maxInsertSeq){
printf(STDERR ",%s;%0.2f", $maxInsertSeq, $maxInserts / $ic);
printf(STDERR ",[Insert %s]", $maxInsertSeq);
} else {
printf(STDERR ",");
printf(STDERR ",[%s -> %s]", $refAllele, $consAllele);
if($consAllele ne $refAllele){
if($sampleName){
printf(STDERR "%s,", $sampleName);
}
printf(STDERR "%s,%d,%d,%s,", $refName, $pos, $cov, $refAllele);
printf(STDERR "%0.2f,%0.2f,%0.2f,%0.2f,%0.2f,%0.2f,%0.2f,%0.2f",
$rc, $pr, $pa, $pc, $pg, $pt, $pd, $pi);
if($maxInsertSeq){
printf(STDERR ",%s;%0.2f", $maxInsertSeq, $maxInserts / $ic);
printf(STDERR ",[Insert %s]", $maxInsertSeq);
} else {
printf(STDERR ",");
printf(STDERR ",[%s -> %s]", $refAllele, $consAllele);
}
print(STDERR "\n");
}
print(STDERR "\n");
}
#print(",$consAllele");
print($consAllele); ## print current reference allele
Expand Down

0 comments on commit d2dd5bd

Please sign in to comment.