Home

Awesome

TRAPeS

We present TRAPeS (TCR Reconstruction Algorithm for Paired-End Single-cell), a software for reconstruction of T cell receptors (TCR) using short, paired-end single-cell RNA-sequencing. <br />

TRAPeS reconstruct the TCR in 3 steps: For each chain, it first identify the V and J segments by searching for paired reads with one read mapping to the V segment and its mate mapping to the J segment. Then, a set of putative CDR3-originating reads are identified as the set of unmapped reads whose mates map to the V,J and C segments. Finally, an iterative dynamic programming algorithm is used to reconstruct the CDR3 region with the putative CDR3 reads. <br />

For more information, see our paper in Nucleic Acids Research here or our bioRxiv preprint here

installing TRAPeS <br />

TRAPeS is written in Python and C++, and currently works on Linux. TRAPeS require the following python libraries: <br />

In addition, TRAPeS requires the following software: <br />

before running TRAPeS <br />

TRAPeS takes as input mapped and unmapped files of reads after genomic alignment (e.g. using TopHat).<br /> TRAPeS assumes a certain folder structure: It assumes that each cell has its own folder, and all of those folders are under one path. Also, it assumes that each cell folder has identical subfolder structure.<br />

Running TRAPeS <br />

To run TRAPeS, simply run:<br />

python trapes.py [options] <br />

To display help: <br />

python trapes.py -h <br />

Testing TRAPeS

To test that TRAPeS is installed correctly, run the following command:

python /path-to-TRAPeS/trapes.py -genome hg38 -path /path-to-TRAPeS/Example/proc_data/ -sumF /path-to-TRAPeS/Example/TRAPeS_out/TCR.out -output TRAPeS_out/TCR.out -score 15 -unmapped unmapped.bam -bam sorted.bam

This should produce the following files: <br /> /path-to-TRAPeS/Example/TRAPeS_out/TCR.out.summary.txt <br /> /path-to-TRAPeS/Example/TRAPeS_out/TCR.out.TCRs.txt <br /> <br /> which should be similar to the files: <br /> /path-to-TRAPeS/Example/TRAPeS_out/example.output.summary.txt <br /> /path-to-TRAPeS/Example/TRAPeS_out/example.output.TCRs.txt <br /> <br />

Please note: in order to download the large example bam files, use git lfs when cloning the repository.
<br /> ###Options when running TRAPeS <br />

Input files: <br /> <br />

-path : The folder with all the single cell samples. Assumes every subfolder under this path is a folder of a single cell sequencing results. <br /> -bam : The location of the sorted mapped bam file relative to the single cell folder. For example, if under each single cell folder there is a subfolder named “TopHat_Output” and the mapped file is under that folder and named mapped.bam, the command should read “–bam TopHat_Output/mapped.bam”. <br /> -unmapped : the location of the bam file containing the unmapped reads. Similar to the –bam tag, it is relative to the single cell folder. <br /> <br /> Output files: <br /> <br /> -output : Output prefix for the files generated by TRAPeS in every single cell folder, relative to the single cell folder (e.g. TopHat_Output/TRAPeS/TCR.out). Can include a subdirectory (TRAPeS will create that subdirectory if it does not yet exists). <br />

-sumF : Prefix for the output summary files of the entire path (summary of all single cells together). <br /> <br /> Parameters for the TCR reconstruction <br /> <br /> -score : The threshold score for the alignment of a read to the V or J segment. Any putative CDR3-originating read that its alignment to the V or J segments passes this score will be used for reconstruction. Default is 15, but should be changed based on sequencing quality and length. In the next version the default will be computed based on the length of the input reads <br />

-overlap : Minimum number of bases that the extended V and J segments should overlap in order to stop the reconstruction. Default is 10. <br />

-iterations : Maximum number of times to extend the V and J segments. If after that number of iterations the V and J segments still do not overlap the reconstruction is determined as unsuccessful. Default is 20. <br />

-bases : Number of bases from the V and the J segments that will be used as the initial template for the reconstruction. Default is min(length(V), length(J)). <br />

-lowQ : By default, the putative CDR3-originating reads are identified as unmapped reads whose mate is aligned to the V/J/C segments. However, those reads can by chance be mapped to other places in the genome (usually low quality mapping). By including the –lowQ tag the set of CDR3-origintating reads will also include the reads that map to other places in the genome. We recommend using this tag. <br />

-top: Rank all the V-J pairs based on the number of mapped reads, and reconstruct only the top X number of V-J pairs. Default: reconstruct all V-J pairs. Recommended for very deep libraries or libraries when there are many possible V-J pairing. <br />

-byExp: Must be used along with the top parameter. Rank all the V-J pairs based on the number of mapped reads, but instead of reconstructing only the top X number of V-J pairs, randomly choose 2 V-J pairs with the same rank (same number of mapped reads) and reconstruct them. Then TRAPeS will move on to the next rank until the number of V-J pairs specified with top has been reconstructed. Default: off. <br />

-oneSide: Add this parameter to also search for productive reconstructions only from the extended V segment (in case of no overlap between the extended V and extended J segments). Default: off. <br />

-readOverlap: Consider only reads with that number of bases overlapping V/J/C segments as mapped reads. Default: 1. Note: This parameter is still being tested <br />

<br />

Paths to other software: <br /> <br /> -bowtie2 : Path to bowtie2. If not used assumes bowtie2 is in the default PATH <br />

-rsem: Path to RSEM. If not used assumes RSEM is in the default PATH <br />

-samtools: Path to samtools. If not used assumes samtools is in the default PATH <br /> <br /> Other parameters: <br /> <br /> -singleCell : Add this tag if you are only running TRAPeS on a single cell (not a library of many single cells). Currently not active <br />

-genome : The genome used for genomic alignment. By default, TRAPeS only supports hg19, hg38 and mm10, and for mm10 with NCBI chromosome naming use mm10_ncbi. However, TRAPeS can be used for any genome or any organism, as long as the genomic annotations for the V/J/C segments are available. In order to run TRAPeS on genomes besides mm10, hg19 or hg38, the user must create the relevant annotation files (see here for more information). In addition, this will require to add the '-Aminus'/'-Bminus' parameters if necessary. <br />

-Aminus: Only used for user supplied genomes. Add this flag if the (majority) of V and J annotations of the alpha chain are on the minus strand. <br /> -Bminus: Only used for user supplied genomes. Add this flag if the (majority) of V and J annotations of the beta chain are on the minus strand. <br />

-strand : Strand orientation of the reads, options are [minus, plus, none]. For transcripts on the positive strand, to which strand does the rightmost (in genomic coordinates) mate of the read map to. Default is minus. <br /> <br /><br />

TRAPeS output<br />

<br /> - sumF.summary.txt : Summary of the reconstruction status in each cell (successful/unsuccessful). <br />

In addition, in each single cell folder you can find the following output files: <br /> <br />

<br /><br />

For any questions or comments, please email Shaked Afik, safik@berkeley.edu.