int main_flags(int argc, char *argv[]) { if ( argc!=2 ) usage(); else { int mask = bam_str2flag(argv[1]); if ( mask<0 ) { fprintf(pysamerr,"Error: Could not parse \"%s\"\n", argv[1]); usage(); return 1; } printf("0x%x\t%d\t%s\n", mask, mask, bam_flag2str(mask)); } return 0; }
static void print_usage(FILE *fp, const mplp_conf_t *mplp) { char *tmp_require = bam_flag2str(mplp->rflag_require); char *tmp_filter = bam_flag2str(mplp->rflag_filter); // Display usage information, formatted for the standard 80 columns. // (The unusual string formatting here aids the readability of this // source code in 80 columns, to the extent that's possible.) fprintf(fp, "\n" "Usage: bcftools mpileup [options] in1.bam [in2.bam [...]]\n" "\n" "Input options:\n" " -6, --illumina1.3+ quality is in the Illumina-1.3+ encoding\n" " -A, --count-orphans do not discard anomalous read pairs\n" " -b, --bam-list FILE list of input BAM filenames, one per line\n" " -B, --no-BAQ disable BAQ (per-Base Alignment Quality)\n" " -C, --adjust-MQ INT adjust mapping quality; recommended:50, disable:0 [0]\n" " -d, --max-depth INT max per-file depth; avoids excessive memory usage [%d]\n", mplp->max_depth); fprintf(fp, " -E, --redo-BAQ recalculate BAQ on the fly, ignore existing BQs\n" " -f, --fasta-ref FILE faidx indexed reference sequence file\n" " --no-reference do not require fasta reference file\n" " -G, --read-groups FILE select or exclude read groups listed in the file\n" " -q, --min-MQ INT skip alignments with mapQ smaller than INT [%d]\n", mplp->min_mq); fprintf(fp, " -Q, --min-BQ INT skip bases with baseQ/BAQ smaller than INT [%d]\n", mplp->min_baseQ); fprintf(fp, " -r, --regions REG[,...] comma separated list of regions in which pileup is generated\n" " -R, --regions-file FILE restrict to regions listed in a file\n" " --ignore-RG ignore RG tags (one BAM = one sample)\n" " --rf, --incl-flags STR|INT required flags: skip reads with mask bits unset [%s]\n", tmp_require); fprintf(fp, " --ff, --excl-flags STR|INT filter flags: skip reads with mask bits set\n" " [%s]\n", tmp_filter); fprintf(fp, " -s, --samples LIST comma separated list of samples to include\n" " -S, --samples-file FILE file of samples to include\n" " -t, --targets REG[,...] similar to -r but streams rather than index-jumps\n" " -T, --targets-file FILE similar to -R but streams rather than index-jumps\n" " -x, --ignore-overlaps disable read-pair overlap detection\n" "\n" "Output options:\n" " -a, --annotate LIST optional tags to output; '?' to list []\n" " -g, --gvcf INT[,...] group non-variant sites into gVCF blocks according\n" " to minimum per-sample DP\n" " --no-version do not append version and command line to the header\n" " -o, --output FILE write output to FILE [standard output]\n" " -O, --output-type TYPE 'b' compressed BCF; 'u' uncompressed BCF;\n" " 'z' compressed VCF; 'v' uncompressed VCF [v]\n" " --threads INT number of extra output compression threads [0]\n" "\n" "SNP/INDEL genotype likelihoods options:\n" " -e, --ext-prob INT Phred-scaled gap extension seq error probability [%d]\n", mplp->extQ); fprintf(fp, " -F, --gap-frac FLOAT minimum fraction of gapped reads [%g]\n", mplp->min_frac); fprintf(fp, " -h, --tandem-qual INT coefficient for homopolymer errors [%d]\n", mplp->tandemQ); fprintf(fp, " -I, --skip-indels do not perform indel calling\n" " -L, --max-idepth INT maximum per-file depth for INDEL calling [%d]\n", mplp->max_indel_depth); fprintf(fp, " -m, --min-ireads INT minimum number gapped reads for indel candidates [%d]\n", mplp->min_support); fprintf(fp, " -o, --open-prob INT Phred-scaled gap open seq error probability [%d]\n", mplp->openQ); fprintf(fp, " -p, --per-sample-mF apply -m and -F per-sample for increased sensitivity\n" " -P, --platforms STR comma separated list of platforms for indels [all]\n" "\n" "Notes: Assuming diploid individuals.\n" "\n"); free(tmp_require); free(tmp_filter); }
static void print_usage(FILE *fp, const mplp_conf_t *mplp) { char *tmp_require = bam_flag2str(mplp->rflag_require); char *tmp_filter = bam_flag2str(mplp->rflag_filter); // Display usage information, formatted for the standard 80 columns. // (The unusual string formatting here aids the readability of this // source code in 80 columns, to the extent that's possible.) fprintf(fp, "\n" "Usage: samtools mpileup [options] in1.bam [in2.bam [...]]\n" "\n" "Input options:\n" " -6, --illumina1.3+ quality is in the Illumina-1.3+ encoding\n" " -A, --count-orphans do not discard anomalous read pairs\n" " -b, --bam-list FILE list of input BAM filenames, one per line\n" " -B, --no-BAQ disable BAQ (per-Base Alignment Quality)\n" " -C, --adjust-MQ INT adjust mapping quality; recommended:50, disable:0 [0]\n" " -d, --max-depth INT max per-BAM depth; avoids excessive memory usage [%d]\n", mplp->max_depth); fprintf(fp, " -E, --redo-BAQ recalculate BAQ on the fly, ignore existing BQs\n" " -f, --fasta-ref FILE faidx indexed reference sequence file\n" " -G, --exclude-RG FILE exclude read groups listed in FILE\n" " -l, --positions FILE skip unlisted positions (chr pos) or regions (BED)\n" " -q, --min-MQ INT skip alignments with mapQ smaller than INT [%d]\n", mplp->min_mq); fprintf(fp, " -Q, --min-BQ INT skip bases with baseQ/BAQ smaller than INT [%d]\n", mplp->min_baseQ); fprintf(fp, " -r, --region REG region in which pileup is generated\n" " -R, --ignore-RG ignore RG tags (one BAM = one sample)\n" " --rf, --incl-flags STR|INT required flags: skip reads with mask bits unset [%s]\n", tmp_require); fprintf(fp, " --ff, --excl-flags STR|INT filter flags: skip reads with mask bits set\n" " [%s]\n", tmp_filter); fprintf(fp, " -x, --ignore-overlaps disable read-pair overlap detection\n" "\n" "Output options:\n" " -o, --output FILE write output to FILE [standard output]\n" " -g, --BCF generate genotype likelihoods in BCF format\n" " -v, --VCF generate genotype likelihoods in VCF format\n" "\n" "Output options for mpileup format (without -g/-v):\n" " -O, --output-BP output base positions on reads\n" " -s, --output-MQ output mapping quality\n" "\n" "Output options for genotype likelihoods (when -g/-v is used):\n" " -t, --output-tags LIST optional tags to output: DP,DPR,DV,DP4,INFO/DPR,SP []\n" " -u, --uncompressed generate uncompressed VCF/BCF output\n" "\n" "SNP/INDEL genotype likelihoods options (effective with -g/-v):\n" " -e, --ext-prob INT Phred-scaled gap extension seq error probability [%d]\n", mplp->extQ); fprintf(fp, " -F, --gap-frac FLOAT minimum fraction of gapped reads [%g]\n", mplp->min_frac); fprintf(fp, " -h, --tandem-qual INT coefficient for homopolymer errors [%d]\n", mplp->tandemQ); fprintf(fp, " -I, --skip-indels do not perform indel calling\n" " -L, --max-idepth INT maximum per-sample depth for INDEL calling [%d]\n", mplp->max_indel_depth); fprintf(fp, " -m, --min-ireads INT minimum number gapped reads for indel candidates [%d]\n", mplp->min_support); fprintf(fp, " -o, --open-prob INT Phred-scaled gap open seq error probability [%d]\n", mplp->openQ); fprintf(fp, " -p, --per-sample-mF apply -m and -F per-sample for increased sensitivity\n" " -P, --platforms STR comma separated list of platforms for indels [all]\n" "\n" "Notes: Assuming diploid individuals.\n"); free(tmp_require); free(tmp_filter); }