Skip to content

Commit

Permalink
Updated descriptions and man page; Replaced -c/-m "any" with "all"
Browse files Browse the repository at this point in the history
  • Loading branch information
pd3 committed Nov 26, 2013
1 parent 3894be7 commit 5890cca
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 8 deletions.
34 changes: 31 additions & 3 deletions bcftools.1
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,28 @@ For a full list of options, run
[\fICOMMAND\fR]
without arguments.
.SS "Common Options"
.IP "\fB-c, --collapse \fIsnps\fR|\fIindels\fR|\fIboth\fR|\fIall\fR|\fIsome\fR|\fInone\fR" 4
Controls how to treat records with duplicate positions and defines compatible
records across multiple input files:
.IP ""
\fInone\fR .. only records with identical REF and ALT alleles are compatible
.IP ""
\fIsome\fR .. only records where some subset of ALT alleles match are compatible
.IP ""
\fIall\fR .. all records are compatible, regardless of whether the ALT alleles
match or not. In the case of records with the same position, only the first
will be considered and appear on output.
.IP ""
\fIsnps\fR .. any SNP records are compatible, regardless of whether the ALT
alleles match or not. For duplicate positions, only the first SNP record will
be considered and appear on output.
.IP ""
\fIindels\fR .. all indel records are compatible, regardless of whether the REF
and ALT alleles match or not. For duplicate positions, only the first indel
record will be considered and appear on output.
.IP ""
\fIboth\fR .. abbreviation of "\fB-c\fR \fIindels\fR \fB-c\fR \fIsnps\fR"
.PD
.IP "\fB-o, --output-type \fIb\fR|\fIu\fR|\fIz\fR|\fIv\fR" 4
Output compressed BCF (\fIb\fR), uncompressed BCF (\fIu\fR), compressed VCF (\fIz\fR), uncompressed VCF (\fIv\fR).
.IP "\fB-r, --regions \fIfile\fR|\fIchr\fR|\fIchr:pos\fR|\fIchr:from-to\fR|\fIchr:from-\fR[,...]" 4
Expand Down Expand Up @@ -98,14 +120,20 @@ a VCF by using:
.IP "\fBbcftools call\fR [\fIOPTIONS\fR]"
.RS 4
.IP "\fB-C, --constrain\fR \fIalleles\fR|\fItrio\fR"
\fIalleles\fR, call genotypes given alleles. See also \fB-t, --targets\fR.
\fIalleles\fR .. call genotypes given alleles. See also \fB-t, --targets\fR.
.IP ""
\fItrio\fR, call genotypes given the father-mother-child constraint. See also \fB-s, --samples\fR.
\fItrio\fR .. call genotypes given the father-mother-child constraint. See also \fB-s, --samples\fR.
.PD
.IP "\fB-s, --samples\fR \fIfile\fR|\fIlist\fR"
List of samples to include, given as a comma-separated list, one sample per-line in a file or a PED file. With \fB-C \fItrio\fR, PED file is expected.
.RE
.P
.IP "\fBbcftools query\fR [\fIOPTIONS\fR]"
.IP "\fBbcftools merge\fR [\fIOPTIONS\fR]"
.RS 4
.IP "\fB-m, --merge \fIsnps\fR|\fIindels\fR|\fIboth\fR|\fIall\fR|\fInone\fR" 4
Defines merging behaviour, similar to \fB-c, --collapse\fR. For example, to prevent
the merge of SNPs and indels into one record, use \fB-m\fR \fIboth\fR. To prevent
creation of multi-allelic records altogether, use \fB-m\fR \fInone\fR.

.SH EXAMPLES
todo
Expand Down
6 changes: 4 additions & 2 deletions vcfisec.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ static void usage(void)
fprintf(stderr, "About: Create intersections, unions and complements of VCF files\n");
fprintf(stderr, "Usage: bcftools isec [options] <A.vcf.gz> <B.vcf.gz> ...\n");
fprintf(stderr, "Options:\n");
fprintf(stderr, " -c, --collapse <string> treat as identical sites with differing alleles for <snps|indels|both|any|some>\n");
fprintf(stderr, " -c, --collapse <string> treat as identical sites with differing alleles for <snps|indels|both|all|some|none> [none]\n");
fprintf(stderr, " -C, --complement output positions present only in the first file but missing in the others\n");
fprintf(stderr, " -f, --apply-filters <list> require at least one of the listed FILTER strings (e.g. \"PASS,.\")\n");
fprintf(stderr, " -n, --nfiles [+-=]<int> output positions present in this many (=), this many or more (+), or this many or fewer (-) files\n");
Expand All @@ -319,7 +319,7 @@ static void usage(void)
fprintf(stderr, " vcf isec A.vcf.gz B.vcf.gz -p dir -n =2 -w 1\n");
fprintf(stderr, "\n");
fprintf(stderr, " # Extract records private to A or B comparing by position only\n");
fprintf(stderr, " vcf isec A.vcf.gz B.vcf.gz -p dir -n -1 -c any\n");
fprintf(stderr, " vcf isec A.vcf.gz B.vcf.gz -p dir -n -1 -c all\n");
fprintf(stderr, "\n");
exit(1);
}
Expand Down Expand Up @@ -361,7 +361,9 @@ int main_vcfisec(int argc, char *argv[])
else if ( !strcmp(optarg,"indels") ) args->files->collapse |= COLLAPSE_INDELS;
else if ( !strcmp(optarg,"both") ) args->files->collapse |= COLLAPSE_SNPS | COLLAPSE_INDELS;
else if ( !strcmp(optarg,"any") ) args->files->collapse |= COLLAPSE_ANY;
else if ( !strcmp(optarg,"all") ) args->files->collapse |= COLLAPSE_ANY;
else if ( !strcmp(optarg,"some") ) args->files->collapse |= COLLAPSE_SOME;
else if ( !strcmp(optarg,"none") ) args->files->collapse = COLLAPSE_NONE;
else error("The --collapse string \"%s\" not recognised.\n", optarg);
break;
case 'f': args->files->apply_filters = optarg; break;
Expand Down
3 changes: 2 additions & 1 deletion vcfmerge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ static void usage(void)
fprintf(stderr, " --use-header <file> use the provided header\n");
fprintf(stderr, " --print-header <file> print only header of the output file and exit\n");
fprintf(stderr, " -f, --apply-filters <list> require at least one of the listed FILTER strings (e.g. \"PASS,.\")\n");
fprintf(stderr, " -m, --merge <string> merge sites with differing alleles for <snps|indels|both|any|none> [both]\n");
fprintf(stderr, " -m, --merge <string> merge sites with differing alleles for <snps|indels|both|all|none> [both]\n");
fprintf(stderr, " -o, --output-type <b|u|z|v> 'b' compressed BCF; 'u' uncompressed BCF; 'z' compressed VCF; 'v' uncompressed VCF [v]\n");
fprintf(stderr, " -r, --region <reg|file> merge in the given regions only\n");
fprintf(stderr, "\n");
Expand Down Expand Up @@ -1307,6 +1307,7 @@ int main_vcfmerge(int argc, char *argv[])
else if ( !strcmp(optarg,"indels") ) args->collapse |= COLLAPSE_INDELS;
else if ( !strcmp(optarg,"both") ) args->collapse |= COLLAPSE_BOTH;
else if ( !strcmp(optarg,"any") ) args->collapse |= COLLAPSE_ANY;
else if ( !strcmp(optarg,"all") ) args->collapse |= COLLAPSE_ANY;
else if ( !strcmp(optarg,"none") ) args->collapse = COLLAPSE_NONE;
else error("The -m type \"%s\" is not recognised.\n", optarg);
break;
Expand Down
3 changes: 2 additions & 1 deletion vcfquery.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ static void usage(void)
fprintf(stderr, "Usage: bcftools query [options] <file.vcf.gz>\n");
fprintf(stderr, "Options:\n");
fprintf(stderr, " -a, --annots <list> alias for -f '%%CHROM\\t%%POS\\t%%MASK\\t%%REF\\t%%ALT\\t%%TYPE\\t' + tab-separated <list> of tags\n");
fprintf(stderr, " -c, --collapse <string> collapse lines with duplicate positions for <snps|indels|both|any|some>\n");
fprintf(stderr, " -c, --collapse <string> collapse lines with duplicate positions for <snps|indels|both|all|some|none> [none]\n");
fprintf(stderr, " -f, --format <string> learn by example, see below\n");
fprintf(stderr, " -H, --print-header print header\n");
fprintf(stderr, " -l, --list-columns list columns\n");
Expand Down Expand Up @@ -697,6 +697,7 @@ int main_vcfquery(int argc, char *argv[])
else if ( !strcmp(optarg,"indels") ) collapse |= COLLAPSE_INDELS;
else if ( !strcmp(optarg,"both") ) collapse |= COLLAPSE_SNPS | COLLAPSE_INDELS;
else if ( !strcmp(optarg,"any") ) collapse |= COLLAPSE_ANY;
else if ( !strcmp(optarg,"all") ) collapse |= COLLAPSE_ANY;
else if ( !strcmp(optarg,"some") ) args->files->collapse |= COLLAPSE_SOME;
else error("The --collapse string \"%s\" not recognised.\n", optarg);
break;
Expand Down
3 changes: 2 additions & 1 deletion vcfstats.c
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ static void usage(void)
fprintf(stderr, "Usage: bcftools stats [options] <A.vcf.gz> [<B.vcf.gz>]\n");
fprintf(stderr, "Options:\n");
fprintf(stderr, " -1, --1st-allele-only include only 1st allele at multiallelic sites\n");
fprintf(stderr, " -c, --collapse <string> treat sites with differing alleles as same for <snps|indels|both|any|some>\n");
fprintf(stderr, " -c, --collapse <string> treat sites with differing alleles as same for <snps|indels|both|all|some|none> [none]\n");
fprintf(stderr, " -d, --depth <int,int,int> depth distribution: min,max,bin size [0,500,1]\n");
fprintf(stderr, " --debug produce verbose per-site and per-sample output\n");
fprintf(stderr, " -e, --exons <file.gz> tab-delimited file with exons for indel frameshifts (chr,from,to; 1-based, inclusive, bgzip compressed)\n");
Expand Down Expand Up @@ -1116,6 +1116,7 @@ int main_vcfstats(int argc, char *argv[])
else if ( !strcmp(optarg,"indels") ) args->files->collapse |= COLLAPSE_INDELS;
else if ( !strcmp(optarg,"both") ) args->files->collapse |= COLLAPSE_SNPS | COLLAPSE_INDELS;
else if ( !strcmp(optarg,"any") ) args->files->collapse |= COLLAPSE_ANY;
else if ( !strcmp(optarg,"all") ) args->files->collapse |= COLLAPSE_ANY;
else if ( !strcmp(optarg,"some") ) args->files->collapse |= COLLAPSE_SOME;
else error("The --collapse string \"%s\" not recognised.\n", optarg);
break;
Expand Down

0 comments on commit 5890cca

Please sign in to comment.