Skip to content
Tobias Hofmann edited this page Oct 12, 2015 · 4 revisions

assemble_reads.py

Trinity

This pipeline implements Trinity for the assembly of contigs. Trinity is a commonly used, free assembly-software and has proven to be a good and reliable tool. It is very time-intensive (in comparison to other, commercial software such as CLC) but it can be parallelized over multiple cores. Check the Trinity installation path on your machine/cluster and add the complete path to the command with the --trinity flag. The default path that is otherwise assumed by the script is /usr/local/bin/Trinity.pl.

Run the script

As before, you can check the basic syntax of the script by typing:
python2.7 assemble_reads.py --h

Which will return:
usage: assemble_reads.py [-h] --input INPUT --output OUTPUT [--trinity TRINITY] [--contig_length CONTIG_LENGTH] [--cores CORES]

The script needs the cleaned reads from the previous step as input. You can move the folder, containing the cleaned reads for all samples, where you want it, but don't change anything in the file structure within that folder, not even the names of the files/subfolders. The input folder needs to contain a separate subfolder for each sample, named in this manner sampleID_clean, which contains at least the cleaned forward read file (sampleID_*_READ1.fastq) and the cleaned backward read file (sampleID_*_READ2.fastq). But if you used the clean_reads.py script described above, on your data, you don't have to bother with the file-/folder-structure at all, you will be able to just give the path to the cleaned-reads-folder as input for the assembly.

Otherwise you just have to name an output folder using the --output flag, and make sure that you give the script the correct path to Trinity.pl. You can choose a minimum contig length with the --contig_length flag. The default is 200 but you will have to decide what the best minimum for your data is (dependent on the length of the shortest loci that you tried to capture). In some cases you might want to choose an even lower threshold as e.g. 100, if you try to capture very short exons. You can parallelize Trinity over multiple computational cores, using the --cores flag.

Example:

python2.7 assemble_reads.py --input path/to/cleaned-reads-folder --output path/to/contig-folder --trinity /installation/path/of/Trinity.pl --contig_length 100 --cores 12

Clone this wiki locally