xinehc / args_oap

ARGs-OAP: Online Analysis Pipeline for Antibiotic Resistance Genes Detection from Metagenomic Data Using an Integrated Structured ARG Database
MIT License
36 stars 11 forks source link

stage one fails and makes empty output directory #27

Closed osvatic closed 1 year ago

osvatic commented 1 year ago

Hello,

I have args_oap installed through the conda instructions provided but stage_one fails and produces and empty output directory

[osvatic@login01 Metabolic_C]$ args_oap stage_one -i test -o output -f fa -t 32
[2023-05-10 13:04:06] INFO: Building databases ...
[osvatic@login01 Metabolic_C]$ cd output/
[osvatic@login01 output]$ ls
[osvatic@login01 output]$ 

I have been testing with 2 files that look like this:

file 1

>HWI-A00245_BSF_1099:1:2101:10158:29262#JMF_2107_07_0004_S104725
AGCGCAAGCCCGGCGCCTTGCGCAACGGCGCGCCGTTCGCTGACATGCCCGATCCGCTGCGC
>HWI-A00245_BSF_1099:1:2101:10158:30013#JMF_2107_07_0004_S104725
TGCGCGCCTTGCGGGCAACCGGCGATGCGCGCATAGTCGTTGACGGAGGTCAGGATGATCAAGGCAGTCAAGTTCGTGAGCGTGCCGGTCAAGGATCAGGA
>HWI-A00245_BSF_1099:1:2101:10158:30295#JMF_2107_07_0004_S104725
CCCGGCAACGTTTTAAAATTCCGTTTTGATAATATTATGTTGCCAGACAGCGGTTCAAACGAGCCTCAAAGTCACGGGTACGTGATTTACGAAATTAAACC

file 2

>HWI-A00245_BSF_1099:1:2101:10158:29262#JMF_2107_07_0004_S104725
AGCGCAAGCCCGGCGCCTTGCGCAACGGCGCGCCGTTCGCTGACATGCCCGATCCGCTGCGC
>HWI-A00245_BSF_1099:1:2101:10158:30013#JMF_2107_07_0004_S104725
TGCGCGCCTTGCGGGCAACCGGCGATGCGCGCATAGTCGTTGACGGAGGTCAGGATGATCAAGGCAGTCA
AGTTCGTGAGCGTGCCGGTCAAGGATCAGGA
>HWI-A00245_BSF_1099:1:2101:10158:30295#JMF_2107_07_0004_S104725

Is there a known issue or way to troubleshoot this?

xinehc commented 1 year ago

Hi,

I suspect it's an issue with blast/diamond installation. The database is not successfully built.

Maybe try installing args_oap in a new conda environment using:

conda create -n args_oap -c bioconda -c conda-forge args_oap
conda activate args_oap

If the error persists, could you please show the results of the following command

conda list | grep -E 'diamond|blast|args_oap'

What are the filenames in folder test? It is also possible that no valid fasta/fastq files has been detected.

jowodo commented 1 year ago

Hi, thanks for the quick reply. I'm working on the same installation as @osvatic. Installation:

conda config --set channel_priority flexible
conda config --set solver libmamba
conda create -y -n args_oap-3.2.2 -c conda-forge -c bioconda args_oap=3.2.2

Conda environment:

$ conda list | grep -E 'diamond|blast|args_oap'
# packages in environment at /home/apps/conda/miniconda3/envs/args_oap-3.2.2:
args_oap                  3.2.2              pyhdfd78af_0    bioconda
blast                     2.13.0               hf3cf87c_0    bioconda
diamond                   2.1.6                h5b5514e_1    bioconda

Following the example from the README.md file:

$ wget -q https://dl.dropboxusercontent.com/s/pqgftlo24rfc2rd/example.tar.gz
$ tar -xf example.tar.gz
$ cd example
$ args_oap stage_one -i input -o output -f fa -t 8
[2023-05-12 10:35:25] INFO: Building databases ...
$ args_oap stage_two -i output -t 8
[2023-05-12 10:35:32] CRITICAL: File "metadata.txt" does not exist in input folder <output>. Please run <stage_one> first or check input folder (-i/--indir).
]$ ls *
input:
STAS_1.fa  STAS_2.fa  SWHAS104_1.fa  SWHAS104_2.fa

output:
xinehc commented 1 year ago

Please make sure you have the write permission to folder /home/apps/conda/miniconda3/envs/args_oap-3.2.2

You may use chmod -R a+rw /home/apps/conda/miniconda3/envs/args_oap-3.2.2 to grant the permission.

jowodo commented 1 year ago

Hi!

This is a central installation. That means I don't have permissions to change permission. I installed the environment into my homedir where I do have write permissions and it worked like a charm. Would it be possible to release a centrally installable version in future? Which files in the environment need write access?

Thanks!

xinehc commented 1 year ago

Which files in the environment need write access?

The first time you run args_oap it will built a database for blast/diamond and write these files to the folder.

Would it be possible to release a centrally installable version in future?

We may release a version that contains pre-built databases later.

jowodo commented 1 year ago

Running the test after installation as admin worked:

conda create -y -n args_oap-3.2.2 -c conda-forge -c bioconda args_oap=3.2.2
conda activate args_oap-3.2.2
TD=$(mktemp -d)
pushd $TD
wget -q https://dl.dropboxusercontent.com/s/pqgftlo24rfc2rd/example.tar.gz
tar -xf example.tar.gz
cd example
args_oap stage_one -i input -o output -f fa -t 8
args_oap stage_two -i output -t 8
popd
rm -rf $TD

Now I can run the test successfully as non-privileged user. It might be helpful for others to put a short note in the README file that for central installations the test should be performed once as admin user.

Thanks!