Package: phipkit
phipkitPhIP-seq data analysis toolkitThis package implements a data analysis workflow for processing the results of
phage immunoprecipitation sequencing (PhIP-Seq)
experiments.This workflow gets you from a matrix
of read counts to a list of potential epitopes for each sample. Downstream
analyses (not implemented here) may use these epitopes in case vs.
control comparisons or other analyses appropriate to the study.InstallationAll dependencies except BLAST (required byphipkit-blastcommand) can be
installed by pip:$ pip install phipkitor from a checkout of the repo:$ pip install .In order to run thephipkit-blastcommand, you will need the BLAST commandsblastpandmakeblastdbin your PATH. I recommend installing BLAST using
bioconda. Aftersetting up bioconda,
you can just run:conda install blastThis package has been tested using BLAST versions 2.6.0 and 2.10.1. Most likely
any recent version will work.You can run the phipkit unit tests with:$ pip install pytest
$ pytestAssumptions and data requirementsKey assumptions for our analysis approach:Your PhIP-seq run included several (ideally 5 or more)
"beads-only" negative control wells, i.e. wells without any antibody added.Your PhIP-seq library was designed by tiling source proteins
withoverlappingpeptides, i.e. each position in the source protein is covered
by more than one phage cloneTo use this package, you will need three things:A library annotation file (CSV) giving the amino acid insert sequence (peptide) for each cloneA reference proteome (FASTA) giving the amino acid sequences of the full-length
proteins that the library coversA sample x clones matrix (CSV) of read counts for your experiment. This can be generated
for example using thephip-statpackage.Note: in most cases where a CSV file is expected, you can also also pass a
tab-separated file (TSV), or a bzip2-compressed CSV or TSV.Example analysisWe will walk through analyzing a toy synthetic PhIP-seq dataset. First go
into the example-data directory:$ cd example-dataStep 1. Blast PhIP-seq library against itselfYou only need to do this once for each PhIP-seq library you run. If you mix
libraries in a single run, I recommend running this command on the combined
mixture of libraries.To blast phage clone sequences against themselves, run:$ phipkit-blast annotations.csv --out blast.all_against_all.csvExample results:blast.all_against_all.csv.The first argument is your library annotation file. This is expected to
have phage clone names on the first column, and another column namedseq_aathat gives the amino acid sequence of the peptide. This column name can be
changed; seephipkit-blast -h.Running this on a real library can be quite slow. I usually run it overnight.
Passing '--blast-parameter num_threads 4' can speed this up (the default is 1
thread).Step 2. Blast PhIP-seq library against reference proteomeThere's a second blast step that you also need to do only once per library. Here
we blast the library against a set of full length protein sequences (referred
to as "antigens" later).$ phipkit-blast annotations.csv --reference proteins.fasta --out blast.reference.csvExample results:blast.reference.csv.The proteins you use here should roughly correspond to the
proteins used originally to generate the PhIP-seq library. They don't have to
exactly match though. For example, for an autoantigen PhIP-seq library,
it's reasonable to use the currenthuman proteomefrom Uniprot.Step 3. Calculate scoresThis step is independent of the two BLAST steps. It calculates "scores" that
capture enrichment over beads-only negative controls. The results are conceptually
analogous to the z-scores introduced inYuan et al 2018,
although a different model is used based on a robust fit of a Poisson
distribution. Seescore.pyfor the implementation.$ phipkit-score counts.csv --out scores.csvExample results:scores.csv.Step 4. Call hitsThis step identifies phage clones (actually pairs of phage clones with
overlapping sequences) that have high enough scores to be called hits.Our method for hit calling uses only the relative ranking of the scores, not the
values themselves. You can therefore use any alternate scoring method you like,
as long as clones with higher read counts have higher scores. The method is
implemented incall_hits.py.$ phipkit-call-hits blast.all_against_all.csv scores.csv --counts counts.csv --fdr 0.1 --out hits.csvExample results:hits.csv.Step 5. Call antigensThis step looks for regions of source proteins that have multiple overlapping
hits. It's implemented incall_antigens.py.$ phipkit-call-antigens blast.reference.csv hits.csv --out antigens.csvExample results:antigens.csv.Step 6 (optional). Plot antigen callsSome rudimentary plotting support is also available.$ phipkit-plot-antigens blast.reference.csv hits.csv antigens.csv --out antigens.pdfExample results:antigens.pdf.ContributingPRs with bugfixes or new functionality are welcome. Before embarking on a major
change, please file an issue.To push a new release to PyPI:Make sure the package version specified in__init__.pyis a new version greater than what's onPyPI.Tag a new release on GitHub matching this versionTravis should deploy the release to PyPI automatically.