Skip to content

Commit

Permalink
feat: Add alignment step to align against ICEberg2 (#61)
Browse files Browse the repository at this point in the history
* feat: Add module to align against ICEberg2

* feat: Add conf for iceberg alignment

* fix: Add missing input

* test: Fix inputs in ann test

* fix: Change output folder

* refactor: Change icebergdb to experimental
  • Loading branch information
jvfe committed Mar 10, 2023
1 parent c8d37dc commit ed548cb
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 7 deletions.
18 changes: 18 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,14 @@ process {
]
}

withName: '.*ICEBERG_FILTER:CONCAT_ALIGNMENT' {
publishDir = [
path: { "${params.outdir}/annotation/iceberg2/" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: DIAMOND_BLAST_VFDB {
ext.args = '--evalue 1e-06 --max-target-seqs 25 --more-sensitive'
ext.prefix = { "${meta.id}_VFDB" }
Expand All @@ -189,6 +197,16 @@ process {
]
}

withName: DIAMOND_BLAST_ICEBERG {
ext.args = '--evalue 1e-06 --max-target-seqs 25 --more-sensitive'
ext.prefix = { "${meta.id}_ICEBERG" }
publishDir = [
path: { "${params.outdir}/annotation/iceberg2/${meta.id}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

// PopPUNK

withName: POPPUNK_VISUALISE {
Expand Down
17 changes: 17 additions & 0 deletions modules/local/blast_databases.nf
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,20 @@ process GET_BACMET{
touch BacMet2_EXP_database.fasta
"""
}

process GET_ICEBERG {
label 'process_low'
label 'error_retry_delay'

output:
path "ICE_aa_experimental.fas", emit: iceberg

script:
"""
curl https://bioinfo-mml.sjtu.edu.cn/ICEberg2/download/ICE_aa_experimental.fas --output ICE_aa_experimental.fas
"""
stub:
"""
touch ICE_aa_experimental.fas
"""
}
8 changes: 5 additions & 3 deletions modules/local/get_db_cache.nf
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ process GET_DB_CACHE {
path "VFDB_setA_pro.fas.gz", emit: vfdb
path "CAZyDB.07312020.fa", emit: cazydb
path "BacMet2_predicted_database.fasta.gz", emit: bacmet
path "ICE_aa_experimental.fas", emit: iceberg
path "card.json", emit: card_json
path "card.version.txt", emit: card_version
path("""k2_standard_8gb_20201202"""), emit: minikraken

script:
"""
cp $dbcache/VFDB_setA_pro.fas.gz .
cp $dbcache/CAZyDB.07312020.fa .
cp $dbcache/BacMet2_predicted_database.fasta.gz .
cp $dbcache/ICE_aa_experimental.fas .
cp $dbcache/card.json .
cp $dbcache/card.version.txt .
cp -r $dbcache/k2_standard_8gb_20201202 .
Expand All @@ -40,7 +42,7 @@ process GET_DB_CACHE {
// path "BacMet2_predicted_database.fasta.gz", emit: bacmet
// path "card.json", emit: card_json
// path "card.version.txt", emit: card_version

// script:
// """
// cp VFDB_setB_pro.fas.gz .
Expand All @@ -57,7 +59,7 @@ process GET_DB_CACHE {

// output:
// path("""k2_standard_8gb_20201202"""), emit: minikraken

// script:
// """
// cp -r $dbcache/k2_standard_8gb_20201202 .
Expand Down
25 changes: 21 additions & 4 deletions subworkflows/local/annotation.nf
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ include { BAKTA_BAKTA as BAKTA } from '../../modules/nf-core/bakta/bakta/main'
include { BAKTA_BAKTADBDOWNLOAD as BAKTADBDOWNLOAD } from '../../modules/nf-core/bakta/baktadbdownload/main'
include { GET_CAZYDB;
GET_VFDB;
GET_BACMET} from '../../modules/local/blast_databases.nf'
GET_BACMET;
GET_ICEBERG } from '../../modules/local/blast_databases.nf'
include { DIAMOND_MAKEDB as DIAMOND_MAKE_CAZY;
DIAMOND_MAKEDB as DIAMOND_MAKE_VFDB;
DIAMOND_MAKEDB as DIAMOND_MAKE_BACMET } from '../../modules/nf-core/diamond/makedb/main'
DIAMOND_MAKEDB as DIAMOND_MAKE_BACMET;
DIAMOND_MAKEDB as DIAMOND_MAKE_ICEBERG } from '../../modules/nf-core/diamond/makedb/main'
include { DIAMOND_BLASTX as DIAMOND_BLAST_CAZY;
DIAMOND_BLASTX as DIAMOND_BLAST_VFDB;
DIAMOND_BLASTX as DIAMOND_BLAST_BACMET } from '../../modules/nf-core/diamond/blastx/main'
DIAMOND_BLASTX as DIAMOND_BLAST_BACMET;
DIAMOND_BLASTX as DIAMOND_BLAST_ICEBERG } from '../../modules/nf-core/diamond/blastx/main'
//
// MODULE: Local to the pipeline
//
Expand All @@ -26,7 +29,8 @@ include { MOB_RECON } from '../../modules/local/mobsuite'
//
include { FILTER_ALIGNMENT as CAZY_FILTER;
FILTER_ALIGNMENT as VFDB_FILTER;
FILTER_ALIGNMENT as BACMET_FILTER; } from './concatenate_matches'
FILTER_ALIGNMENT as BACMET_FILTER;
FILTER_ALIGNMENT as ICEBERG_FILTER } from './concatenate_matches'



Expand All @@ -37,6 +41,7 @@ workflow ANNOTATE_ASSEMBLIES {
vfdb_cache
cazydb_cache
bacmet_cache
icebergdb_cache
card_json_cache
card_version_cache

Expand Down Expand Up @@ -81,6 +86,13 @@ workflow ANNOTATE_ASSEMBLIES {
GET_CAZYDB()
GET_CAZYDB.out.cazydb.set { ch_cazy_db }
}
if (icebergdb_cache){
icebergdb_cache.set{ ch_iceberg_db }
}
else{
GET_ICEBERG()
GET_ICEBERG.out.iceberg.set { ch_iceberg_db }
}
}
/*
* Load RGI for AMR annotation
Expand Down Expand Up @@ -161,7 +173,12 @@ workflow ANNOTATE_ASSEMBLIES {
DIAMOND_MAKE_CAZY(ch_cazy_db)
DIAMOND_BLAST_CAZY(ch_ffn_files, DIAMOND_MAKE_CAZY.out.db, "txt", blast_columns)
CAZY_FILTER(DIAMOND_BLAST_CAZY.out.txt, "CAZY", blast_columns)

DIAMOND_MAKE_ICEBERG(ch_iceberg_db)
DIAMOND_BLAST_ICEBERG(ch_ffn_files, DIAMOND_MAKE_ICEBERG.out.db, "txt", blast_columns)
ICEBERG_FILTER(DIAMOND_BLAST_ICEBERG.out.txt, "ICEBERG", blast_columns)
}

ch_software_versions = ch_software_versions.mix(DIAMOND_MAKE_VFDB.out.versions.ifEmpty(null))

emit:
Expand Down
1 change: 1 addition & 0 deletions tests/subworkflows/local/annotation.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ nextflow_workflow {
input[4] = []
input[5] = []
input[6] = []
input[7] = []
"""
}
}
Expand Down
4 changes: 4 additions & 0 deletions workflows/arete.nf
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ workflow ARETE {
GET_DB_CACHE.out.vfdb,
GET_DB_CACHE.out.cazydb,
GET_DB_CACHE.out.bacmet,
GET_DB_CACHE.out.iceberg,
GET_DB_CACHE.out.card_json,
GET_DB_CACHE.out.card_version
)
Expand All @@ -165,6 +166,7 @@ workflow ARETE {
[],
[],
[],
[],
[]
)
}
Expand Down Expand Up @@ -330,6 +332,7 @@ workflow ANNOTATION {
GET_DB_CACHE.out.vfdb,
GET_DB_CACHE.out.cazydb,
GET_DB_CACHE.out.bacmet,
GET_DB_CACHE.out.iceberg,
GET_DB_CACHE.out.card_json,
GET_DB_CACHE.out.card_version
)
Expand All @@ -346,6 +349,7 @@ workflow ANNOTATION {
[],
[],
[],
[],
[]
)
}
Expand Down

0 comments on commit ed548cb

Please sign in to comment.