Package: afplot
afplotThis is a tool to plot allele frequencies in VCF files.The two main subcommands that are available are: *regions: Plot
single regions or regions from a bed file, optionally with a margin. *whole-genome: Create a single image for every chromosome on the
genome.Both subcommands have three modes:histogram: This will create a histogram with kernel density plot
of allele frequencies.scatter: Create a scatter plot of allele frequencies, along the
region or chromosome.distance: Create a scatter plot of distances to theoretical
allele frequencies, along the region or chromosome. This only makes
sense for autosomes of diploid organisms.By default, colors correspond to call type (hom_alt/ref/hom_ref).Multiple VCF files can be supplied simultaneously for thewhole-genomesubcommand, in which case they can be grouped by label.
When multiple VCF files are supplied, plots will be colored on label per
VCF file.Only one sample per VCF file can be plotted.We currently assume the presence of anADcolumn in theFORMATfield. This column should contain the depth per allele, with the
reference allele being first.All VCFs should be indexed with tabix, and should contain contigs in the
header.Installationafplot is available through pypi with:pip install afplotRequirementsPython 3.4+clicknumpymatplotlibpandasseabornprogressbar2pysampyvcfUsageUsage: afplot [OPTIONS] COMMAND [ARGS]...

  Plot allele frequencies in VCF files.

  Two basic modes exist:
    - regions: Plot histogram, scatter or distance plots per
      user-specified region.
    - whole-genome: Plot histogram, scatter or distance plots over the
      entire genome.

Options:
  --help  Show this message and exit.

Commands:
  regions       Region plots
  whole-genome  Whole-genome plotsExamplesSingle VCF on a single regionafplot regions histogram-vmy.vcf.gz-ooutput_dir-Rchr1:100-200Single VCF on a bed fileafplot regions histogram-vmy.vcf.gz-ooutput_dir-Lregions.bedSingle VCF whole genomeafplotwhole-genomehistogram-vmy.vcf.gz-lmy_label-smy_sample-omysample.histogram.pngMultiple VCFs whole genomeafplotwhole-genomehistogram-vmy1.vcf.gz-lmy_label1-smy_sample1-vmy2.vcf.gz-lmy_label2-smy_sample2-oboth_samples.histogram.pngGrouping samples can be achieved by supplying identical labels to
samples. E.g.afplotwhole-genomehistogram-v1.vcf.gz-v2.vcf.gz-v3.vcf.gz-v4.vcf.gz-lgroup1-lgroup1-lgroup2-lgroup2[...]Excluding contigs on whole genomeIn certain cases, you may not want to plot all contigs. For instance,
when your vcf header contains many small unplaced contigs. This can be
achieved by supplying a regex pattern to the-eflag. For instance,
all contigs containing “gl” can be filtered out by doing:afplotwhole-genome[...]-e'.*gl.*'Changelog0.2The entire command line interface was changed to useclick, instead
of regular argparse. This allows a more complex CLI. In stead of having
flags for plot mode,afplotnow uses subcommands.While the CLI has changed, and the internals ofafplothave been
refactored, the old-style (version 0.1) API remains in place for now.
This may be deprecated in the future.Support for plotting regions was added. Region plotting outputs on a
directory, rather than on a single file.LicenseMIT