Skip to content

Usage Documentation

Quarkins edited this page Jan 29, 2017 · 21 revisions

The files used in this example are find in the Examples folder of the repository.

Producing a SuperTranscript

python Lace.py Example/Example_genome.fasta Example/clusters.txt -a -t -o Test

Where Genome.fasta is a fasta file which contains all the transcripts for all the genes/clusters you wish to construct a SuperTranscript for, Clusters.txt is a text file containing two tab separated columns containing the transcript/contig name in the first column and the cluster/gene name in the second column (as is the output of Corset).

In this example, there are two mock genes (A and B) which each are expressed by two different transcripts.

This runs in parallel mode (each gene can be run as a separate stand alone thread).

To get the help options simply type:

python Lace.py --help
usage: Lace.py [-h] [--cores CORES] [--alternate] [--tidy]
             TranscriptFile ClusterFile  

positional arguments:  
  TranscriptFile        The name of the fasta file containing all transcripts  
  ClusterFile       The name of the text file with the transcript to cluster
                mapping  

optional arguments:  
  -h, --help        show this help message and exit  
  --cores CORES     The number of cores you wish to run the job on (default = 4)  
  --alternate, -a  Create alternate annotations and create metrics on success  
                of SuperTranscript Building
  --tidy, -t      Move intermediate fasta files into folder: SuperFiles
                    after running  
  --maxTran MAXTRAN  Set a maximum for the number of transcripts from a
                 cluster to be included for building the SuperTranscript
                 (default=50). 
  --outputDir OUTPUTDIR, -o OUTPUTDIR
                    Output Directory

Note: By default all the fasta files and psl files required for the BLAT pair-wise alignment will be produced in the folder where your run in if not specified otherwise.

The outputs of this script are:

  • A .fasta file containing all transcripts for each gene.
  • A .psl containing the pairwise alignment of all transcripts by blat per gene.
  • SuperDuper.fasta containing the SuperTranscript sequence per gene.
  • SuperDuper.gff The annotation for each SuperTranscript obtained from the overlap graph.
  • SuperDuperTrans.gff The annotation of the transcripts on the SuperTranscript [Optional - if --alternate flag invoked]
  • LogOut.pdf A pdf documenting various metrics for assessing the quality of the SuperTranscript construction. [Optional]

Extracting the annotation of transcripts against the SuperTranscript

If one did not originally create the alternate annotation by calling flag --alternate [-a] in the previous step, one can easily create this afterwards. Simply

Move into output directory:

cd Test

Make the alternate annotation (if not called as flag in original lace running):

python ../Checker.py SuperDuper.fasta

usage: Checker.py [-h] [--cores CORES] SuperFile  

positional arguments:  
  SuperFile      The name of the SuperDuper.fasta file created by  
             SuperTranscript  

optional arguments:  
  -h, --help     show this help message and exit   
  --cores CORES  The number of cores you wish to run the job on (default = 1)  

Outputs:

  • SuperDuperTrans.gff The annotation of the transcripts on the SuperTranscript [Optional - if --alternate flag invoked]
  • LogOut.pdf A pdf documenting various metrics for assessing the quality of the SuperTranscript construction.

IGV viewer

To start IGV from the command line, simply type: igv This will load igv (if you have it installed), then one simply has to load the SuperDuper.fasta file which contains the sequence for each gene. The sorted .bam files which contains the reads mapped to the SuperDuper.fasta and the annotation files, SuperDuper.gff and SuperDuper_trans.gff (remembering to expand them using a right click on the annotation object in igv and choosing expanded view mode).

Viewing transcript coverage on SuperTranscript

Another function which the lace package includes is to view for a given gene the coverage of each transcript on the SuperTranscript. To run this script make sure to be in the same directory as SuperDuper.fasta.

python ../STViewer.py SuperFiles/GeneA.fasta

usage: STViewer.py [-h] GeneName  

positional arguments:  
  GeneName    The fasta file for the gene you wish to view  

optional arguments:  
  -h, --help  show this help message and exit  

Outputs:

  • Visualise.pdf - A pdf displaying the transcript coverage to the SuperTranscript.

Creating Splice Block Annotation

In order to create this annotation one has to have mapped the reads back to the SuperTranscript already. In order to make this annotation one requires a splice aware mapper, i typically use STAR since it outputs the splice junctions in a handy tab delimited file. The little script i made to construct the Splice Blocks is called Mobius and it requires to inputs:

  • SJ.out.tab (delimited output from STAR for splice junctions)
  • SuperDuper.fasta (The fasta file containing sequence for the constructed SuperTranscripts)

The code to produce the splice block annotation:

python Mobius.py SJ.out.tab SuperDuper.fasta  

Output: Spliced.gtf (the annotation file based off of splice blocks)