transcript / samsa2

SAMSA pipeline, version 2.0. An open-source metatranscriptomics pipeline for analyzing microbiome data, built around DIAMOND and customizable reference databases.
GNU General Public License v3.0
54 stars 36 forks source link

About full_database_download.bash #66

Closed EugeneKim76 closed 3 years ago

EugeneKim76 commented 3 years ago

Dear all, I recently used full_database_download.bash and found an error message below. full_database_download.bash: 26: full_database_download.bash: source: not found

So, I suggest to fix full_database_download.bash as shown below.

source "${BASH_SOURCE%/*}/../bash_scripts/lib/common.sh" ->

if [[ -d "${BASH_SOURCE%/*}/../bash_scripts/lib/common.sh" ]]; then
  source "${BASH_SOURCE%/*}/../bash_scripts/lib/common.sh"
else
#assuming that you're running this full_database_download.bash directly ("bash full_database_download.bash")
  source "../bash_scripts/lib/common.sh"
fi

Best,

transcript commented 3 years ago

Hi Eugene,

This is great! Do you want to submit a PR for this so your contribution will be credited? Otherwise, I'm happy to just update the master version with these fixes.

Best, Sam

EugeneKim76 commented 3 years ago

Hi Sam, Thanks for prompt reply. I'll submit PR. Best,

cm0109 commented 3 years ago

@transcript @EugeneKim76

Even with that change, I am getting an error about not finding the file: sudo bash setup_and_test/full_database_download.bash

setup_and_test/full_database_download.bash: line 32: ../bash_scripts/lib/common.sh: No such file or directory

Any suggestions? Thanks!

transcript commented 3 years ago

Hi @cm0109 ,

Can I ask which local directory are you running this in? If you do pwd, where does it show you?

EugeneKim76 commented 3 years ago

Hi @cm0109 , In order to run sudo bash setup_and_test/full_database_download.bash , I suggest fix the script as shown below.

if [[ -d "${BASH_SOURCE%/*}/../bash_scripts/lib/common.sh" ]]; then
  source "${BASH_SOURCE%/*}/../bash_scripts/lib/common.sh"
else

->

if [ -d "${BASH_SOURCE%/*}/../bash_scripts/lib/" ]; then
  source "${BASH_SOURCE%/*}/../bash_scripts/lib/common.sh"
else

You can also download the database without fixing, by following commands below. cd "location of samsa2 GitHub download"/samsa2/setup_and_test bash full_database_download.bash

Best,

EugeneKim76 commented 3 years ago

Hi Sam In addition to cm0109's issue, I found package_installation.bash also has the same problem as shown below. bash setup_and_test/package_installation.bash

setup_and_test/package_installation.bash: line 38: ../bash_scripts/lib/common.sh: No such file or directory

Hence, I suggest to fix package_installation.bash (and full_database_download.bash) as shown below.

if [[ -d "${BASH_SOURCE%/*}/../bash_scripts/lib/common.sh" ]]; then
  source "${BASH_SOURCE%/*}/../bash_scripts/lib/common.sh"
else

->

if [ -d "${BASH_SOURCE%/*}/../bash_scripts/lib/" ]; then
  source "${BASH_SOURCE%/*}/../bash_scripts/lib/common.sh"
else

Best,

cm0109 commented 3 years ago

Hi @cm0109 ,

Can I ask which local directory are you running this in? If you do pwd, where does it show you?

Thanks for the quick response. pwd gives: /home/cm/samsa2

transcript commented 3 years ago

Great! @cm0109, it looks like @EugeneKim76 has the fix. Can you try updating the script to match his comment?

@EugeneKim76, do you want to submit another PR for the code correction in the package_installation.bash and full_database_download.bash scripts? If you feel too busy, I can simply make these changes in a quick commit myself.

EDIT: it looks like you've already done this in #68! Great!