Tuesday, February 9, 2021

Trinity: salmon ... died with ret (256)

I had some trouble running de novo assembly using Trinity.
Error, cmd:
salmon --no-version-check index -t .../trinity_out_dir/read_partitions/Fb_0/CBin_161/c16184.trinity.reads.fa.out/Trinity.fasta.tmp -i .../trinity_out_dir/read_partitions/Fb_0/CBin_161/c16184.trinity.reads.fa.out/Trinity.fasta.tmp.salmon.idx --type quasi -k 25 -p 1
 died with ret (256) at .../trinityrnaseq-Trinity-v2.6.6/util/support_scripts/../../PerlLib/Process_cmd.pm line 19.
	Process_cmd::process_cmd("salmon --no-version-check index -t ...) called at .../trinityrnaseq-Trinity-v2.6.6/util/support_scripts/salmon_runner.pl line 23
Trinity run failed. Must investigate error above.
Trinity was installed with "brew install -v trinity". Version was 2.6.6 which is old. According to Google, it was probably due to a mismatch with the salmon version.
First, I tried docker and singularity but another error appeared.
Error, cmd: jellyfish count -t 8 -m 25 -s 100000000  --canonical  both.fa died with ret 9 at /usr/local/bin/trinityrnaseq/util/insilico_read_normalization.pl line 793.
Error, cmd: /usr/local/bin/trinityrnaseq/util/insilico_read_normalization.pl --seqType fq --JM 80G  --max_cov 200 --min_cov 1 --CPU 8 --output .../trinity_out_dir/insilico_read_normalization --max_CV 10000  --left FASTAfiles --right FASTAfiles --pairs_together  --PARALLEL_STATS   died with ret 512 at /usr/local/bin/trinityrnaseq/Trinity line 2826.
	main::process_cmd("/usr/local/bin/trinityrnaseq/util/insilico_read_normalization"...) called at /usr/local/bin/trinityrnaseq/Trinity line 3379
	main::normalize(..., ARRAY(0x55bbade24fd8), ARRAY(0x55bbade24f78)) called at /usr/local/bin/trinityrnaseq/Trinity line 3319
	main::run_normalization(200, ARRAY(0x55bbade24fd8), ARRAY(0x55bbade24f78)) called at /usr/local/bin/trinityrnaseq/Trinity line 1372
I have no idea to solve them. Then I tried another way: install Trinity using conda install. A newer version of Trinity (v2.11.0) is available.
conda install -c bioconda trinity
Finally, Trinity de novo assembly successfully worked on my mac.

"sleuth" hdf5. file accessibilty. unable to open file (Mac)

I was informed that an error occurs when loading kallisto files into sleuth using sleuth_prep().
"sleuth" hdf5. file accessibilty. unable to open file
When I tried to run the program, I got the same error. I couldn't find any useful solutions on google, so I tried to figure it out by myself.

In my case, this error seems to be caused by kallisto, not sleuth. Because kallisto's quant() command gave a warning message and the .hd5 file was not created.
Warning: kallisto was not compiled with HDF5 support so no bootstrapping will be performed. Run quant with --plaintext option or recompile with HDF5 support to obtain bootstrap estimates.

I think the problem was caused by a system update, but I couldn't figure out why. Probably, it can be handled if we can prepare a clean environment.

1. Create an independent clean conda environment. Here, I named it kallisto. And activate the environment. You can delete the environment when you no longer need it.
conda create -n kallisto -y
conda activate kallisto

2. Install kallisto and sleuth in the new environment.
conda install kallisto
conda install -c bioconda r-sleuth

3. Run kallisto as you always do. Then, you will probably get .hd5 and .tsv files.
Make sure that you use kallisto which was installed by above command.
kallisto quant --index=${rootdir}/ref/kallisto.idx --output-dir=SRR1551005 --bootstrap-samples=2 --threads=2 ${rootdir}/seq/SRR1551005_1.fastq ${rootdir}/seq/SRR1551005_2.fastq

4. Run sleuth as you always do.
R
library(sleuth)
so=sleuth_prep(...) # kallisto data was successfully loaded in my case 
...
q()

5. Deactivate the environment. Files will be retained.
conda deactivate

Hello blogger!

Hello blogger.

Generate Manhattan plots with ggplot2

Since the Manhattan plot draws millions (sometimes tens of millions) of points, it is not wise to output the plots in vector format. To gene...