Package: pistis
PistisQuality control plotting for long reads.This package provides plotting designed to give you an idea of how your long read
sequencing data looks. It was conceived of and developed with nanopore reads in
mind, but there is no reason why PacBio reads can't be used.Installationpip3installpistisYou can also usepipif you are running with python2.Or using a virtual
environment manager such ascondaorpipenv.You should now be able to runpistisfrom the command linepistis--helpSingularityThere is a built image maintained with this repository that can be used. For the latest release you can use the URIshub://mbhall88/pistisFor examplesingularityexec"shub://mbhall88/pistis"pistis--help
singularitypull--namepistis.simg"shub://mbhall88/pistis"UsageThe main use case forpistisis as a command-line interface (CLI), but it can also be
used in an interactive way, such as with aJupyter Notebook.CLI UsageAfter installing and running the help menu you should see the following usage
optionspistis -h

Usage: pistis [OPTIONS]

  A package for sanity checking (quality control) your long read data.
  Feed it a fastq file and in return you will receive a PDF with four plots:

          1. GC content histogram with distribution curve for sample.

          2. Jointplot showing the read length vs. phred quality score for
          each         read. The interior representation of this plot can be
          altered with the         --kind option.

          3. Box plot of the phred quality score at positional bins across
          all reads. The reads are binned into read positions 1, 2, 3, 4, 5,
          6, 7, 8, 9, 10, 11-20, 21-50, 51-100, 101-200, 201-300. Plots from
          the start of reads.

          4. Same as 3, but plots from the end of the read.

  Additionally, if you provide a BAM/SAM file a histogram of the read
  percent identity will be added to the report.

Options:
  -f, --fastq PATH                Fastq file to plot. This can be gzipped.
  -o, --output PATH               Path to save the plot PDF as. If name is not
                                  specified, will use the name of the fastq
                                  (or bam) file with .pdf extension.
  -k, --kind [kde|scatter|hex]    The kind of representation to use for the
                                  jointplot of quality score vs read length.
                                  Accepted kinds are 'scatter', 'kde'
                                  (default), or 'hex'. For examples refer to h
                                  ttps://seaborn.pydata.org/generated/seaborn.
                                  jointplot.html
  --log_length / --no_log_length  Plot the read length as a log10
                                  transformation on the quality vs read length
                                  plot
  -b, --bam PATH                  SAM/BAM file to produce read percent
                                  identity histogram from.
  -d, --downsample INTEGER        Down-sample the sequence files to a given
                                  number of reads. Set to 0 for no
                                  subsampling. Default: 50000
  -h, --help                      Show this message and exit.Note the--downsampleoption is set to 50000 by default. That is,pistiswill
only plot 50000 reads (sampled from a uniform distribution). You can set this to
0 if you want to plot every read, or select another number of your choosing. Be aware
that if you try to plot too many reads you may run into memory issues, so try
downsampling if this happens.There are three different use cases - currently - for producing plots:Fastq only- This will return four plots:A distribution plot of the GC content for each read.A bivariate jointplot with read length on the y-axis and mean read quality
score on the x-axis.Two boxplots that show the distribution of quality scores at select positions
and positional ranges. One plot shows the scores from the beginning of the
read and the other from the end of the read.To usepistisin this way you just need a fastq file.pistis-f/path/to/my.fastq-o/save/as/report.pdfThis will save the four plots to a file calledreport.pdfin directory/save/as/.
If you don't provide a--output/-ooption the file will be saved in the current
directory with the basename of the fastq file. So in the above example it would be
saved asmy.pdf.If you would prefer the read lengths in the bivariate plot of read length vs.
mean quality score then you can indicate this like sopistis-f/path/to/my.fastq-o/save/as/report.pdf--no_log_lengthAdditionally, you can change the way the data is represented in the bivariate plot.
The default is a kernel density estimation plot (as in the below image), however you can
choose to use ahex bin or scatter plot version instead.
In the running example, to use a scatter plot you would run the followingpistis-f/path/to/my.fastq-o/save/as/report.pdf--kindscatterYou can also provide agziped fastq file without any extra stepspistis-f/path/to/my.fastq.gz-o/save/as/report.pdfExamplesGC content:Read length vs. mean read quality score:Base quality from the start of each read:Base quality from the end of each read:Fastq and BAM/SAM- This will return the above four plots, plus a distribution
plot of each read's percent identity with the reference it is aligned to in the
[BS]AM file. Reads which are flagged as supplementary or secondary are not included.
The plot also includes a dashed vertical red line indicating the median
percent identity.Note: If using a BAM file, it must be sorted and indexed (i.e.baifile). Seesamtoolsfor instructions on how to do this.pistis-f/path/to/my.fastq-b/path/to/my.bam-o/save/as/report.pdf# orpistis-f/path/to/my.fastq-b/path/to/my.sam-o/save/as/report.pdfExampleDistribution of aligned read percent identity:BAM/SAM only- At this stage you will receive only the distribution
plot of each read's percent identity with the reference it is aligned to. In a
future release I aim to allow you to also get the other four fastq-only plots.pistis-b/path/to/my.bam-o/save/as/report.pdfAs with the fastq-only method, if you don't provide a--output/-ooption the file will be saved in the current
directory with the basename of the [BS]AM file. So in the above example it would be
saved asmy.pdf.Usage in a development environmentIf you would like to usepistiswithin a development environment such as ajupyter notebookor just a plain ol' python shell then take a look atthis example notebookfor all the details.CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.The two test data files (fastq and BAM) that I have used in this repository were
taken fromWouter De Coster'snanotestrepository.Which in turn comes fromNick Loman and Josh Quick.The example plots in thisREADMEwere made using the entire fastq of basecalled
reads from the experiment in thatblog on "whale hunting".The plot for the BAM file was obtained by runningpistison a BAM file generated
by mapping the fastq file toE. colireferenceNC_000913.3using Heng Li'sminimap2and-x map-ontoption.ContributingIf you would like to contribute to this package you are more than welcome.Please read through thecontributing guidelinesfirst.