src/hg/tcga/pBamBam/pBamBam.c 1.2

1.2 2009/12/20 22:33:25 jsanborn
updated
Index: src/hg/tcga/pBamBam/pBamBam.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/tcga/pBamBam/pBamBam.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -b -B -U 4 -r1.1 -r1.2
--- src/hg/tcga/pBamBam/pBamBam.c	20 Dec 2009 22:27:22 -0000	1.1
+++ src/hg/tcga/pBamBam/pBamBam.c	20 Dec 2009 22:33:25 -0000	1.2
@@ -33,8 +33,9 @@
   "   -minMapQ=INT    - Minimum acceptable mapping quality. [0]\n"
   "   -avgMapQ=INT    - Minimum acceptable avg mapping quality. [0]\n"
   "   -minChiSq=INT   - Minimum acceptable chi square of nucleotide freqs. [0]\n"
   "   -maxISize=INT   - Maximum Insert Size. [10000]\n"
+  "   -minOutput      - Minimal output, no read data\n"
   "\n"
   );
 }
 
@@ -45,8 +46,9 @@
     {"minMapQ", OPTION_INT},
     {"avgMapQ", OPTION_INT},
     {"minChiSq", OPTION_INT},
     {"maxISize", OPTION_INT},
+    {"minOutput", OPTION_BOOLEAN},
     {NULL, 0}
 };
 
 /* Option variables */
@@ -56,8 +58,9 @@
 int minMapQ  = 0;
 int avgMapQ  = 0;
 int minChiSq = 0;
 int maxISize = 10000;
+boolean minOutput = FALSE;
 
 typedef struct {
     int minQ;
     int minMapQ;
@@ -576,8 +579,11 @@
 
 static void print_seq(uint32_t tid, uint32_t pos, int n, 
 		      const bam_pileup1_t *pu, dual_pileup_t *d)
 {
+if (minOutput)
+    return;
+
 int i, j, rb;
 rb = (d->ref && (int)pos < d->len)? d->ref[pos] : 'N';
 for (i = 0; i < n; ++i)
     {
@@ -786,15 +792,8 @@
 
 int main(int argc, char *argv[])
 /* Process command line. */
 {
-// Print out command line as a comment.
-int i;
-putchar('#');
-for (i = 0; i < argc; i++)
-    printf(" %s", argv[i]);
-putchar('\n');
-
 optionInit(&argc, argv, options);
 if (argc < 3)
     usage();
 
@@ -811,8 +810,10 @@
 if (optionExists("maxISize"))
     maxISize = optionInt("maxISize", 10000);
 if (optionExists("position"))
     position = optionVal("position", NULL);
+if (optionExists("minOutput"))
+    minOutput = TRUE;
 
 char *inbamL = argv[1];
 char *inbamR = argv[2];
 bamBam(inbamL, inbamR, BAM_DEF_MASK);