Bracken icon indicating copy to clipboard operation
Bracken copied to clipboard

bracken-build issue

Open valentinavan opened this issue 2 years ago • 7 comments

Hi,

I am not able to run bracken-built. Kraken2 is correctly installed and is in the path. The database folder "standard_db" has the .k2d and .map files as well as the library and taxonomy folders. Inside the library folders I have all the the archaea, bacteria, viral etc folders each one with the .fna files.

`./bracken-build -d /Users/linnaeus/kraken/standard_db -t 2 -k 35 -l 150

Selected Options: kmer length = 35 read length = 150 database = /Users/linnaeus/kraken/standard_db threads = 2 Checking for Valid Options... Creating database.kraken [if not found] >> kraken2 --db /Users/linnaeus/kraken/standard_db --threads 2 <( find -L /Users/linnaeus/kraken/standard_db/library ( -name *.fna -o -name *.fa -o -name *.fasta ) -exec cat {} + ) > /Users/linnaeus/kraken/standard_db/database.kraken /Users/linnaeus/opt/anaconda3/envs/MetaKraken2_env/libexec/classify: illegal option -- H Usage: classify [options] <fasta/fastq file(s)>

Options: (*mandatory)

  • -d filename Kraken DB filename
  • -i filename Kraken DB index filename -n filename NCBI Taxonomy nodes file -o filename Output file for Kraken output -t # Number of threads -u # Thread work unit size (in bp) -q Quick operation -m # Minimum hit count (ignored w/o -q) -C filename Print classified sequences -U filename Print unclassified sequences -O format [Un]classified output format {legacy, paired} -f Input is in FASTQ format -F Output in FASTQ format -P Input files are paired. -c Only include classified reads in output -M Preload database files -h Print this message

At least one FASTA or FASTQ file must be specified. Kraken output is to standard output by default.`

I have also tried to run the "Step #1a: kraken2" separately but it does not work neither.

Can someone please help? Thanks

valentinavan avatar Mar 24 '22 02:03 valentinavan

What kraken installation are you using? Bracken works with the default kraken/kraken2/krakenuniq installations, but I do not think it works with conda installations.

jenniferlu717 avatar Mar 24 '22 11:03 jenniferlu717

Thanks Jennifer, I see...yes I installed both with conda as I am having troubles installing the programs as per the manual. I have a mac and I read that there are some issues with dependencies...indeed the .sh scripts are not working for me.

valentinavan avatar Mar 25 '22 07:03 valentinavan

Hello, not sure you still have this issue, I had this issue when i also conda installed kraken2 and braken in the same environment. For some reason braken also installs kraken (1) and it causes issues. Kraken2 works fine if installed in its own conda environment. I cannot find the link of the issue I used for this.

TomasaSbaffi avatar Jun 28 '22 22:06 TomasaSbaffi

I meet the same issue when using kraken2 + bracken.

alienzj avatar Nov 24 '22 07:11 alienzj

Maybe I know why. kraken, kraken2 and krakenUniq all contain classify program, which were stored at /path/to/env/libexec/classify. If we install kraken/kraken2/kraken2Uniq at same environment using conda/mamba, this may raise issue when bracken-build call kraken/kraken2/krakenunique, then kraken/kraken2/krakenUnique call classify.

alienzj avatar Nov 24 '22 08:11 alienzj

Report here: https://github.com/bioconda/bioconda-recipes/issues/38110

alienzj avatar Nov 24 '22 08:11 alienzj

Just uninstall kraken and/or krakenuniq using conda/mamba, then reinstall kraken2 + bracken using conda/mamba, bracken-build will work.

alienzj avatar Nov 24 '22 09:11 alienzj