/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Nextflow config file for running minimal tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Defines input files and everything required to run a fast and simple pipeline test.

    Use as follows:
        nextflow run nf-core/proteinfamilies -profile test,<docker/singularity> --outdir <OUTDIR>

----------------------------------------------------------------------------------------
*/

process {
    resourceLimits = [
        cpus: 4,
        memory: '15.GB',
        time: '1.h'
    ]
}

params {
    config_profile_name        = 'Test profile'
    config_profile_description = 'Test dataset to check generic pipeline function for creating new families'

    // Input data
    input                        = params.pipelines_testdata_base_path + 'samplesheets/samplesheet.csv'
    // Clustering
    clustering_tool              = 'linclust'
    cluster_seq_identity         = 0.5
    cluster_coverage             = 0.9
    cluster_size_threshold       = 5
    // Downstream samplesheets
    skip_proteinfold_samplesheet = false
}

process {
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:FAA_SEQFU_SEQKIT:SEQFU_STATS_BEFORE' {
        memory = { 10.MB * task.attempt }
        time   = { 2.m   * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:FAA_SEQFU_SEQKIT:SEQKIT_SEQ' {
        memory = { 1.4.GB * task.attempt }
        time   = { 2.m    * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:FAA_SEQFU_SEQKIT:SEQKIT_REPLACE' {
        memory = { 1.4.GB * task.attempt }
        time   = { 2.m    * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:FAA_SEQFU_SEQKIT:SEQKIT_RMDUP' {
        memory = { 30.MB * task.attempt }
        time   = { 2.m   * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:FAA_SEQFU_SEQKIT:SEQFU_STATS_AFTER' {
        memory = { 10.MB * task.attempt }
        time   = { 2.m   * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:MMSEQS_FASTA_CLUSTER:MMSEQS_CREATEDB' {
        memory = { 2.6.GB * task.attempt }
        time   = { 3.m    * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:MMSEQS_FASTA_CLUSTER:MMSEQS_LINCLUST' {
        memory = { 1.7.GB * task.attempt }
        time   = { 2.m    * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:MMSEQS_FASTA_CLUSTER:MMSEQS_CREATETSV' {
        memory = { 6.MB * task.attempt }
        time   = { 3.m  * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:CALCULATE_CLUSTER_DISTRIBUTION' {
        memory = { 14.MB * task.attempt }
        time   = { 3.m   * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:CHUNK_CLUSTERS' {
        memory = { 1.1.GB * task.attempt }
        time   = { 3.m    * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:GENERATE_FAMILIES:ALIGN_SEQUENCES:FAMSA_ALIGN' {
        memory = { 2.5.GB * task.attempt }
        time   = { 2.m    * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:GENERATE_FAMILIES:CLIPKIT' {
        memory = { 1.8.GB * task.attempt }
        time   = { 2.m    * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:GENERATE_FAMILIES:HMMER_HMMBUILD' {
        memory = { 160.MB * task.attempt }
        time   = { 2.m    * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:GENERATE_FAMILIES:HMMER_HMMSEARCH' {
        memory = { 380.MB * task.attempt }
        time   = { 2.m    * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:GENERATE_FAMILIES:FILTER_RECRUITED' {
        memory = { 1.8.GB * task.attempt }
        time   = { 2.m    * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:GENERATE_FAMILIES:HMMER_HMMALIGN' {
        memory = { 15.MB * task.attempt }
        time   = { 2.m   * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:REMOVE_REDUNDANCY:EXTRACT_FAMILY_REPS' {
        memory = { 27.MB * task.attempt }
        time   = { 2.m   * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:REMOVE_REDUNDANCY:FIND_CONCATENATE_HMMS' {
        memory = { 13.MB * task.attempt }
        time   = { 3.m   * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:REMOVE_REDUNDANCY:HMMER_HMMSEARCH' {
        memory = { 185.MB * task.attempt }
        time   = { 2.m    * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:REMOVE_REDUNDANCY:IDENTIFY_REDUNDANT_FAMS' {
        memory = { 1.9.GB * task.attempt }
        time   = { 2.m    * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:REMOVE_REDUNDANCY:FIND_CONCATENATE_SKIP_IDS' {
        memory = { 12.MB * task.attempt }
        time   = { 2.m   * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:REMOVE_REDUNDANCY:FILTER_NON_REDUNDANT_HMM' {
        memory = { 25.MB * task.attempt }
        time   = { 2.m   * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:REMOVE_REDUNDANCY:FILTER_NON_REDUNDANT_SEED_MSA' {
        memory = { 25.MB * task.attempt }
        time   = { 2.m   * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:REMOVE_REDUNDANCY:FILTER_NON_REDUNDANT_FULL_MSA' {
        memory = { 25.MB * task.attempt }
        time   = { 2.m   * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:REMOVE_REDUNDANCY:FILTER_NON_REDUNDANT_FASTA' {
        memory = { 25.MB * task.attempt }
        time   = { 2.m   * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:REMOVE_REDUNDANCY:MMSEQS_FASTA_CLUSTER:MMSEQS_CREATEDB' {
        memory = { 2.4.GB * task.attempt }
        time   = { 2.m    * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:REMOVE_REDUNDANCY:MMSEQS_FASTA_CLUSTER:MMSEQS_LINCLUST' {
        memory = { 900.MB * task.attempt }
        time   = { 3.m    * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:REMOVE_REDUNDANCY:MMSEQS_FASTA_CLUSTER:MMSEQS_CREATETSV' {
        memory = { 240.MB * task.attempt }
        time   = { 2.m    * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:REMOVE_REDUNDANCY:REMOVE_REDUNDANT_SEQS' {
        memory = { 1.9.GB * task.attempt }
        time   = { 2.m    * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:REMOVE_REDUNDANCY:ALIGN_SEQUENCES:FAMSA_ALIGN' {
        memory = { 3.GB * task.attempt }
        time   = { 3.m  * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:EXTRACT_FAMILY_MEMBERS' {
        memory = { 24.MB * task.attempt }
        time   = { 2.m   * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:EXTRACT_FAMILY_REPS' {
        memory = { 24.MB * task.attempt }
        time   = { 2.m   * task.attempt }
    }
    withName: 'NFCORE_PROTEINFAMILIES:PROTEINFAMILIES:MULTIQC' {
        memory = { 20.GB * task.attempt }
        time   = { 2.m   * task.attempt }
    }
}
