Analyse PAT-Seq RNA expression data.
= Tail Tools =
This is a Python 2 based suite of tools for analysing SOLiD or Illumina
sequencing reads with poly(A) tails.
Use of PyPy is recommened for speed.
This software is distributed under the terms of the GPL, version 2 or later,
in directory tail_tools/web/third_party are covered by the terms of
their respective licenses (also in that directory).
- The remaining files in the directory tail_tools/web are placed in the
- "nesoni", available from http://vicbioinformatics.com/nesoni.shtml or using
pip install nesoni
You don't need to install all of nesoni's dependencies, just Python 2.7
or later or PyPy.
(SHRiMP for legacy color-space data)
- The "convert" tool from ImageMagick.
- rsync (for downloads from UCSC browser)
pip install tail-tools
python setup.py install
For PyPy it seems to be currently easiest to set up in a virtualenv:
virtualenv -p pypy myenv
myenv/bin/pip install tail-tools
This package contains a number of tools, which can be listed by typing:
The package can be used directly from the source directory with:
python -m tail_tools
These tools may also be used as part of a nesoni-style workflow python script.
Typical usage of the pipeline is described below.
Before processing any reads, you need to create a "tail-tools reference directory".
References are most easily downloaed from the UCSC browser using:
tail-tools make-ucsc-reference: \
If creating your own reference, it needs to consist of:
- sequences, eg in FASTA format
- annotations in GFF3 format
The reference directory is then created with the command:
tail-tools make-tt-reference: \
Annotations shall include the following feature types and attributes:
- ID - unique identifier
- Name - nomenclature name
- Product - short description
- ID - unique identifier
- Parent - gene ID
- Parent - mRNA ID
- Parent - mRNA ID
Having created a reference directory, the next step is to run the pipeline,
"analyse-polya-batch". This can be done from the command line, but is more
usefully done from a python script. We suggest adapting the following example
to your data:
import tail_tools, nesoni, glob
tags = [
('logRep1', ['BY', 'rep1']),
('logRep2', ['BY', 'rep2']),
('YPEGRep1', ['ypeg', 'rep1']),
('YPEGRep2', ['ypeg', 'rep2']),
('GALRep1', ['gal', 'rep1']),
('GALRep2', ['gal', 'rep2']),
# For each sample we create a tail_tools.Analyse_polya instance
# Each sample is given a set of tags
samples = [ ]
for name, tags in tags:
reads = sorted(glob.glob('mydata/Sample_scBY4741%s/*.fastq.gz' % name))
reads = reads,
tags = tags,
action = tail_tools.Analyse_polya_batch(
# Output directory
# Title for report
title = 'Yeast June 2013',
# Files in report will have this prefix
file_prefix = 'yeast-june-2013',
# Reference directory you created earlier
reference = 'sacCer3',
# Allow reads/peaks this far downstrand of
# the annotated transcript end point
# For sparser genomes than yeast, perhaps use 1000
extension = 200,
# Whether to include .genome file for IGV in plots tarball
# Not necessary if for model organisms where IGV
# already provides the genome.
include_genome = False,
# List of instances of tail_tools.Analyse_polya
samples = samples,
# List of sample groups
# A sample group is specified as <nesoni-selection-expression>=<name>
# See nesoni help for description of selection expressions,
# this uses the tags given to each sample to concisely
# specify sets of samples.
groups = [ 'BY=BY', 'ccr4=ccr4', 'ypeg=ypeg', 'gal=gal', 'glu10=glu10' ],
# Perform differential tests
tests = [
title='BY vs ccr4',
# A little boilerplate so that
# - multiprocessing works
# - you can control making
# (see nesoni help on --make-* flags)
if __name__ == '__main__':
# If run again with adjusted parameters,
# only the parts that need to be run again will run.
# To force a complete re-run:
# python myscript.py --make-do all
# To re-run everything but the alignment to reference
# (eg if there is a new version of tail-tools)
# python myscript.py --make-do all --make-done analyse-polya
BAM file annotations
- Will be present if the read is considered poly(A) (has at lest four non-templated As)
- Gives the observed non-templated poly(A) tail length
- Gives the number of adaptor sequence bases observed after the end of
the poly(A) sequence. If the adaptor sequence is observed, then we have
sequenced the entirety of the poly(A) tail of this fragment.
If absent assume zero. Not supported for colorspace reads.