Working on dealing with our various cbaiodinium sp. transcriptomes and realized that transcriptomes v2.1 and v3.1 (extracted from BLASTx-annotated FastAs from 20200605) didn’t have any associated stats.
Used built-in Trinity scripts to generate assembly stats on Mox.
SBATCH script (GitHub):
#!/bin/bash
## Job Name
#SBATCH --job-name=20200819_cbai_trinity_stats_v2.1_3.1
## Allocation Definition
#SBATCH --account=coenv
#SBATCH --partition=coenv
## Resources
## Nodes
#SBATCH --nodes=1
## Walltime (days-hours:minutes:seconds format)
#SBATCH --time=15-00:00:00
## Memory per node
#SBATCH --mem=120G
##turn on e-mail notification
#SBATCH --mail-type=ALL
#SBATCH --mail-user=samwhite@uw.edu
## Specify the working directory for this job
#SBATCH --chdir=/gscratch/scrubbed/samwhite/outputs/20200819_cbai_trinity_stats_v2.1_3.1
# Script to generate cbaiodinium Trinity transcriptome stats:
# v2.1
# v3.1
###################################################################################
# These variables need to be set by user
# Assign Variables
transcriptomes_dir=/gscratch/srlab/sam/data/cbaiodinium/transcriptomes
# Paths to programs
trinity_dir="/gscratch/srlab/programs/trinityrnaseq-v2.9.0"
samtools="/gscratch/srlab/programs/samtools-1.10/samtools"
# Array of the various comparisons to evaluate
# Each condition in each comparison should be separated by a "-"
transcriptomes_array=(
"${transcriptomes_dir}"/cbai_transcriptome_v2.1.fasta \
"${transcriptomes_dir}"/cbai_transcriptome_v3.1.fasta
)
# Programs array
declare -A programs_array
programs_array=(
[samtools_faidx]="${samtools} faidx" \
[trinity_stats]="${trinity_dir}/util/TrinityStats.pl" \
[trinity_gene_trans_map]="${trinity_dir}/util/support_scripts/get_Trinity_gene_to_trans_map.pl" \
[trinity_fasta_seq_length]="${trinity_dir}/util/misc/fasta_seq_length.pl"
)
###################################################################################
# Exit script if any command fails
set -e
# Load Python Mox module for Python module availability
module load intel-python3_2017
# Loop through each transcriptome
for transcriptome in "${!transcriptomes_array[@]}"
do
# Variables
transcriptome_name="${transcriptomes_array[$transcriptome]##*/}"
assembly_stats="${transcriptome_name}_assembly_stats.txt"
# Assembly stats
${programs_array[trinity_stats]} "${transcriptomes_array[$transcriptome]}" \
> "${assembly_stats}"
# Create gene map files
${programs_array[trinity_gene_trans_map]} \
"${transcriptomes_array[$transcriptome]}" \
> "${transcriptome_name}".gene_trans_map
# Create sequence lengths file (used for differential gene expression)
${programs_array[trinity_fasta_seq_length]} \
"${transcriptomes_array[$transcriptome]}" \
> "${transcriptome_name}".seq_lens
# Create FastA index
${programs_array[samtools_faidx]} \
"${transcriptomes_array[$transcriptome]}" \
> "${transcriptome_name}".fai
# Copy files to transcriptomes directory
rsync -av \
"${transcriptome_name}"* \
${transcriptomes_dir}
# Capture FastA checksums for verification
echo "Generating checksum for ${transcriptome_name}"
md5sum "${transcriptomes_array[$transcriptome]}" > "${transcriptome_name}".checksum.md5
echo "Finished generating checksum for ${transcriptome_name}"
echo ""
done
# Document programs in PATH (primarily for program version ID)
{
date
echo ""
echo "System PATH for $SLURM_JOB_ID"
echo ""
printf "%0.s-" {1..10}
echo "${PATH}" | tr : \\n
} >> system_path.log
# Capture program options
## Note: Trinity util/support scripts don't have options/help menus
for program in "${!programs_array[@]}"
do
{
echo "Program options for ${program}: "
echo ""
${programs_array[$program]} --help
echo ""
echo ""
echo "----------------------------------------------"
echo ""
echo ""
} &>> program_options.log || true
done
RESULTS
As expected, very fast; ~2mins:
Output folder:
All stats below have been added to the C.bairdi assembly comparison spreadsheet:
- cbai_transcriptome_comp (Google Sheet)
cbai_transcriptome_v2.1.fasta
################################
## Counts of transcripts, etc.
################################
Total trinity 'genes': 131239
Total trinity transcripts: 237494
Percent GC: 50.37
########################################
Stats based on ALL transcript contigs:
########################################
Contig N10: 5347
Contig N20: 3867
Contig N30: 3024
Contig N40: 2457
Contig N50: 1996
Median contig length: 494
Average contig: 1037.76
Total assembled bases: 246461881
#####################################################
## Stats based on ONLY LONGEST ISOFORM per 'GENE':
#####################################################
Contig N10: 5047
Contig N20: 3463
Contig N30: 2579
Contig N40: 1938
Contig N50: 1388
Median contig length: 344
Average contig: 722.72
Total assembled bases: 94849243
Other useful files for downstream annotation using Trinotate:
Trinity Gene Trans Map:
Trinity FastA Sequence Lengths:
cbai_transcriptome_v3.1.fasta
################################
## Counts of transcripts, etc.
################################
Total trinity 'genes': 27399
Total trinity transcripts: 78649
Percent GC: 48.83
########################################
Stats based on ALL transcript contigs:
########################################
Contig N10: 5638
Contig N20: 4370
Contig N30: 3580
Contig N40: 3016
Contig N50: 2580
Median contig length: 1522
Average contig: 1825.11
Total assembled bases: 143543003
#####################################################
## Stats based on ONLY LONGEST ISOFORM per 'GENE':
#####################################################
Contig N10: 5753
Contig N20: 4423
Contig N30: 3622
Contig N40: 3052
Contig N50: 2597
Median contig length: 979
Average contig: 1505.44
Total assembled bases: 41247546
Other useful files for downstream annotation using Trinotate:
Trinity Gene Trans Map:
Trinity FastA Sequence Lengths: