Skip to content

Commit

Permalink
Merge pull request #29 from PalMuc/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
rivera10 committed Oct 27, 2021
2 parents 556c2ec + 386209e commit bba92cc
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 53 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* [Pipeline processes](#Pipelie-processes)
* [Manual](#Manual)
* [Publication](#Publication)
* [Cite](#Cite)
* [Citation](#Citation)
* [Funding](#Funding)
* [Future work](#Future-work)
* [Issues](#Issues)
Expand All @@ -44,9 +44,12 @@ TransPi documentation and examples can be found [here](https://palmuc.github.io/

Preprint of TransPi including kmer, reads length, and reads quantities tests can be found [here](https://doi.org/10.1101/2021.02.18.431773). Also we tested the pipeline with over 45 samples from different phyla.

## Cite
TransPi has been peer-reviewed and recommended by Peer Community In Genomics
(https://doi.org/10.24072/pci.genomics.100009)

If you use TransPi please cite the preprint:
## Citation

If you use TransPi please cite the peer-reviewed publication:

Rivera-Vicéns, R.E., García-Escudero, CA., Conci, N., Eitel, M., and Wörheide, G. (2021). TransPi – a comprehensive TRanscriptome ANalysiS PIpeline for de novo transcriptome assembly. bioRxiv 2021.02.18.431773; doi: https://doi.org/10.1101/2021.02.18.431773

Expand Down
2 changes: 1 addition & 1 deletion TransPi.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2873,7 +2873,7 @@ if (params.onlyAsm || params.onlyAnn || params.onlyEvi || params.all) {
publishDir "${workDir}/.versions", mode: "copy", overwrite: true, pattern: "*.version.txt"

input:
file(assembly), file(annotation) from
tuple file(assembly), file(annotation) from

output:
file("*.fasta") into
Expand Down
71 changes: 33 additions & 38 deletions precheck_TransPi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,23 @@ source_c() {
source ~/.bashrc
fi
}
cleanConda () {
cd $mypwd
echo -e "\n\t -- Cleaning conda environment -- \n"
conda clean -a -y
echo -e "\n\t -- Done cleaning conda environment -- \n"
}
conda_only() {
source_c
#Check conda and environment
check_conda=$( command -v conda )
if [ "$check_conda" != "" ];then #&& [ "$ver" -gt "45" ];then
echo -e "\n\t -- Conda seems to be installed in your system --\n"
ver=$( conda -V | awk '{print $2}' | cut -f 1,2 -d "." )
vern=4.8
ver=$( conda -V | awk '{print $2}' | cut -f 1,2 -d "." | tr -d "." )
vern=48
if [ $( echo "$ver >= $vern" | bc -l ) -eq 1 ];then
echo -e "\n\t -- Conda is installed (v4.8 or higher). Checking environment... --\n"
echo -e "\n\t -- Conda is installed (v4.8 or higher) --\n"
#cleanConda
fi
else
echo -e "\n\t -- Conda is not intalled --\n"
Expand Down Expand Up @@ -517,6 +524,23 @@ evi_c () {
echo -e "\n\t -- EvidentialGene is already installed and in the PATH -- \n"
fi
}
buildsql_c () {
cd ${mypwd}
if [ -d DBs/sqlite_db/ ];then
cd DBs/sqlite_db/
else
mkdir -p DBs/sqlite_db/
cd DBs/sqlite_db/
fi
}
condaTrinotate () {
echo -e "\n\t -- Creating Trinotate conda environment -- \n"
conda create --mkdir --yes --quiet -n TPtrinotate -c conda-forge bioconda::trinotate=3.2.1=pl526_0
echo -e "\n\t -- Done with Trinotate conda environment -- \n"
}
condaTrinotateEnd () {
conda remove -n TPtrinotate --all -y
}
trisql_container () {
if [ ! -e *.sqlite ];then
echo -e "\n\n\t -- Custom sqlite database for Trinotate is not installed -- \n"
Expand Down Expand Up @@ -547,7 +571,7 @@ trisql_c () {
condaRoot=$( conda info --json | grep "CONDA_ROOT" | cut -f 2 -d ":" | tr -d "," | tr -d " " | tr -d "\"" )
if [ -f ${condaRoot}/etc/profile.d/conda.sh ];then
source ${condaRoot}/etc/profile.d/conda.sh
conda activate TransPi
condaTrinotate
check_sql=$( command -v Build_Trinotate_Boilerplate_SQLite_db.pl | wc -l )
if [ $check_sql -eq 0 ];then
echo -e "\n\t -- Script \"Build_Trinotate_Boilerplate_SQLite_db.pl\" from Trinotate cannot be found -- \n"
Expand All @@ -557,6 +581,7 @@ trisql_c () {
Build_Trinotate_Boilerplate_SQLite_db.pl Trinotate
rm uniprot_sprot.dat.gz Pfam-A.hmm.gz
date -u >.lastrun.txt
condaTrinotateEnd
fi
fi
elif [ -e *.sqlite ];then
Expand All @@ -565,15 +590,6 @@ trisql_c () {
echo -e "\n\t -- Databases (PFAM,SwissProt,EggNOG,GO) last update: ${DB} --\n "
fi
}
buildsql_c () {
cd ${mypwd}
if [ -d DBs/sqlite_db/ ];then
cd DBs/sqlite_db/
else
mkdir -p DBs/sqlite_db/
cd DBs/sqlite_db/
fi
}
pfam_c() {
#Check PFAM files
cd $mypwd
Expand Down Expand Up @@ -602,24 +618,6 @@ pfam_c() {
fi
fi
}
#temporary for buscoV4
bus_env4 () {
echo -e "\n\t -- Creating BUSCO V4 environment --\n"
conda create -n busco4 -c conda-forge -c bioconda busco=4.1.4=py_0 -y
conda clean -a -y
}
bus4 () {
cd $mypwd
cpath=$( conda info --json | sed -n '/\"envs\":/,/\],/p' | grep "busco4" | tr -d "," | tr -d " " | tr -d "\"" )
if [ "$cpath" == "" ];then
echo -e "\n\t -- Cannot find the BUSCO V4 environment -- \n"
echo -e "\n\t -- Cleaning conda before installing BUSCO V4 environment -- \n"
conda clean -a -y
bus_env4
else
echo -e "\n\t -- BUSCO V4 environment found --\n"
fi
}
pfam_u() {
cd $installDir
if [ ! -d DBs/hmmerdb/ ];then
Expand Down Expand Up @@ -787,8 +785,8 @@ get_var () {
echo "unpdate=\"$( if [ -f ${mypwd}/DBs/uniprot_db/.lastrun.txt ];then cat ${mypwd}/DBs/uniprot_db/.lastrun.txt;else echo "N/A";fi )\"" >>${mypwd}/.varfile.sh
echo "pfdate=\"$( if [ -f ${mypwd}/DBs/hmmerdb/.lastrun.txt ];then cat ${mypwd}/DBs/hmmerdb/.lastrun.txt;else echo "N/A";fi )\"" >>${mypwd}/.varfile.sh
echo "dbdate=\"$( if [ -f ${mypwd}/DBs/sqlite_db/.lastrun.txt ];then cat ${mypwd}/DBs/sqlite_db/.lastrun.txt;else echo "N/A";fi )\"" >>${mypwd}/.varfile.sh
echo "tenv=$( conda info --json | sed -n '/\"envs\":/,/\],/p' | grep -w "TransPi\"" | tr -d "," | tr -d " " )" >>${mypwd}/.varfile.sh
echo "cenv=$( conda info --json | sed -n '/\"envs\":/,/\],/p' | grep "busco4" | tr -d "," | tr -d " " )" >>${mypwd}/.varfile.sh
#echo "tenv=$( conda info --json | sed -n '/\"envs\":/,/\],/p' | grep -w "TransPi\"" | tr -d "," | tr -d " " )" >>${mypwd}/.varfile.sh
#echo "cenv=$( conda info --json | sed -n '/\"envs\":/,/\],/p' | grep "busco4" | tr -d "," | tr -d " " )" >>${mypwd}/.varfile.sh
vpwd=$mypwd
echo "mypwd=$mypwd" >>${vpwd}/.varfile.sh
source .varfile.sh
Expand All @@ -802,8 +800,7 @@ get_var () {
echo -e "\t SQL DB last update: \t $dbdate"
echo -e "\t NEXTFLOW:\t\t $nextflow \n\n"
cat ${confDir}/template.nextflow.config | sed -e "s|pipeInstall|pipeInstall=\"${mypwd}\"|" -e "s|busco4db|busco4db=\"${busco4db}\"|" -e "s|uniprot|uniprot=\"${uniprot}\"|" \
-e "s|uniname|uniname=\"${uniname}\"|" -e "s|pfloc|pfloc=\"${pfloc}\"|" -e "s|pfname|pfname=\"${pfname}\"|" -e "s|Tsql|Tsql=\"${Tsql}\"|" \
-e "s|myCondaInstall=\"\"|myCondaInstall=\"${tenv}\"|" -e "s|cenv=\"\"|cenv=\"${cenv}\"|" >nextflow.config
-e "s|uniname|uniname=\"${uniname}\"|" -e "s|pfloc|pfloc=\"${pfloc}\"|" -e "s|pfname|pfname=\"${pfname}\"|" -e "s|Tsql|Tsql=\"${Tsql}\"|" >nextflow.config
rm .varfile.sh
}
get_var_user() {
Expand All @@ -826,8 +823,7 @@ get_var_user() {
echo -e "\t PFAM files:\t\t $pfloc"
echo -e "\t NEXTFLOW:\t\t $nextflow \n\n"
cat ${confDir}/template.nextflow.config | sed -e "s|pipeInstall|pipeInstall=\"${mypwd}\"|" -e "s|busco4db|busco4db=\"${busco4db}\"|" -e "s|uniprot|uniprot=\"${uniprot}\"|" \
-e "s|uniname|uniname=\"${uniname}\"|" -e "s|pfloc|pfloc=\"${pfloc}\"|" -e "s|pfname|pfname=\"${pfname}\"|" -e "s|Tsql|Tsql=\"${Tsql}\"|" \
-e "s|myCondaInstall=\"\"|myCondaInstall=\"${tenv}\"|" -e "s|cenv=\"\"|cenv=\"${cenv}\"|" >nextflow.config
-e "s|uniname|uniname=\"${uniname}\"|" -e "s|pfloc|pfloc=\"${pfloc}\"|" -e "s|pfname|pfname=\"${pfname}\"|" -e "s|Tsql|Tsql=\"${Tsql}\"|" >nextflow.config
rm .varfile.sh
}
container_pipeline_setup() {
Expand Down Expand Up @@ -869,7 +865,6 @@ conda_pipeline_setup() {
buildsql_c
trisql_c
pfam_c
bus4
echo -e "\n\t -- If no \"ERROR\" was found and all the neccesary databases are installed proceed to run TransPi -- \n"
get_var
fi
Expand Down
16 changes: 5 additions & 11 deletions template.nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ params {
// PATH to TransPi DBs installation
pipeInstall

// PATH to conda installation from precheck. Leave blank is precheck was not used or you will use containers
myCondaInstall=""

//busco4 conda env
cenv=""

// Uniprot database PATH
uniprot
uniname
Expand Down Expand Up @@ -122,7 +116,7 @@ params {
// Skip fastp quality filter step
skipFilter = false
// Minimum reads quality for filtering in fastp
minQual="25"
minQual="5"

// Filter rRNA
rRNAfilter = false
Expand Down Expand Up @@ -188,7 +182,10 @@ params {

// These options will change how the profiles work.
// Run with conda installed by the precheck
myConda = false
//next 2 parameters are outdated
myConda = false
myCondaInstall=""

condaActivate = false

// TransPi container with all programs
Expand Down Expand Up @@ -261,9 +258,6 @@ process {
// env Evidential Gene variable (only for nextflow)
env.evi="${projectDir}/scripts/evigene"

// Temp BUSCO V4 container for oneContainer option.
params.v4container="ezlabgva/busco:v4.0.5_cv1"

// Get PATH for cache environments
params.localCacheDir = (params.envCacheDir ? "${params.envCacheDir}" : "${launchDir}")

Expand Down

0 comments on commit bba92cc

Please sign in to comment.