#download ubuntu singularity
singularity pull --arch amd64 library://library/default/ubuntu:20.04
singularity build --sandbox blast ubuntu_20.04.sif
#install software
singularity shell --writable blast/
#singularity shell --writable --fakeroot blast
Singularity> cp ncbi-blast-2.10.1+-x64-linux.tar.gz /opt/
Singularity> cd /opt/
Singularity> tar -zxf ncbi-blast-2.10.1+-x64-linux.tar.gz
Singularity> cd ncbi-blast-2.10.1+/bin/
Singularity> cd ../..
Singularity> rm ncbi-blast-2.10.1+-x64-linux.tar.gz
Singularity> exit
vim blast/environment
export PATH=/opt/ncbi-blast-2.10.1+/bin:$PATH
#build
singularity build blast.sif blast
#test use
singularity exec blast.sif blastp -help
#use singularity software to analysis a simple blast
singularity exec blast.sif makeblastdb -dbtype prot -in PRAD.fasta -out genome
singularity exec blast.sif blastp -query input.fa -db genome -out blast.out -outfmt 7
#copy sig to a shared container doc
mkdir /opt/software/container
cp blast.sif /opt/software/container/
singularity exec /opt/software/container/blast.sif blastp -query input.fa -db genome -out blast.out -outfmt 7
#load file
singularity shell --bind /opt/software/:/mnt blast.sif
Singularity> ls /mnt/
Singularity> exit
singularity shell --bind /opt/software/ blast.sif
Singularity> ls /opt/
Singularity> ls /mnt/
Singularity> exit