Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR ~ Unknown method invocation getBaseName on String type #530

Closed
PPpissar opened this issue Oct 30, 2023 · 6 comments
Closed

ERROR ~ Unknown method invocation getBaseName on String type #530

PPpissar opened this issue Oct 30, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@PPpissar
Copy link

Description of the bug

hi I have been running Mag Pipeline for some days, and I ran into this error: see below

What can we do to fix this?

Command used and terminal output

nextflow run nf-core/mag -profile singularity --input samplesheet_23032023.csv --outdir metagenomic_data/out202310025_250 -w metagenomic_data/work202310025_250│·······
 -r 2.5.0 -c NextSeq32.config -resume

OUTPUT

executor >  local (6)                                                                                                                                                                              [6/1897]│·······
[0d/7ac8fc] process > NFCORE_MAG:MAG:FASTQC_RAW (29A_run0_raw)                                               [100%] 24 of 24, cached: 24 ✔                                                                 │·······
[41/0be321] process > NFCORE_MAG:MAG:FASTP (30C_run0)                                                        [100%] 24 of 24, cached: 24 ✔                                                                 │·······
[ac/bcc21f] process > NFCORE_MAG:MAG:BOWTIE2_PHIX_REMOVAL_BUILD (GCA_002596845.1_ASM259684v1_genomic.fna.gz) [100%] 1 of 1, cached: 1 ✔                                                                    │·······
[c5/304391] process > NFCORE_MAG:MAG:BOWTIE2_PHIX_REMOVAL_ALIGN (45B_run0)                                   [100%] 24 of 24, cached: 24 ✔                                                                 │·······
[d2/45f335] process > NFCORE_MAG:MAG:FASTQC_TRIMMED (30A_run0)                                               [100%] 24 of 24, cached: 24 ✔                                                                 │·······
[-        ] process > NFCORE_MAG:MAG:CAT_FASTQ                                                               -                                                                                             │·······
[-        ] process > NFCORE_MAG:MAG:NANOPLOT_RAW                                                            -                                                                                             │·······
[-        ] process > NFCORE_MAG:MAG:PORECHOP                                                                -                                                                                             │·······
[-        ] process > NFCORE_MAG:MAG:NANOLYSE                                                                -                                                                                             │·······
[-        ] process > NFCORE_MAG:MAG:FILTLONG                                                                -                                                                                             │·······
[-        ] process > NFCORE_MAG:MAG:NANOPLOT_FILTERED                                                       -                                                                                             │·······
[-        ] process > NFCORE_MAG:MAG:CENTRIFUGE                                                              -                                                                                             │·······
[bc/b15d6f] process > NFCORE_MAG:MAG:KRAKEN2_DB_PREPARATION                                                  [100%] 1 of 1, cached: 1 ✔                                                                    │·······
[f4/d3f74b] process > NFCORE_MAG:MAG:KRAKEN2 (21B-k2_standard_20230605)                                      [100%] 24 of 24, cached: 24 ✔                                                                 │·······
[b5/e5007f] process > NFCORE_MAG:MAG:KRONA_DB                                                                [100%] 1 of 1, cached: 1 ✔                                                                    │·······
[76/10cc4f] process > NFCORE_MAG:MAG:KRONA (kraken2-19B)                                                     [100%] 24 of 24, cached: 24 ✔                                                                 │·······
[8e/f2e107] process > NFCORE_MAG:MAG:MEGAHIT (45B)                                                           [100%] 24 of 24, cached: 24 ✔                                                                 │·······
[bf/e0ff12] process > NFCORE_MAG:MAG:QUAST (MEGAHIT-19A)                                                     [100%] 24 of 24, cached: 24 ✔                                                                 │·······
[08/c14714] process > NFCORE_MAG:MAG:PRODIGAL (45B)                                                          [100%] 24 of 24, cached: 24 ✔                                                                 │·······
[64/c7aef0] process > NFCORE_MAG:MAG:BINNING_PREPARATION:BOWTIE2_ASSEMBLY_BUILD (MEGAHIT-32A)                [100%] 24 of 24, cached: 24 ✔                                                                 │·······
[b0/71860b] process > NFCORE_MAG:MAG:BINNING_PREPARATION:BOWTIE2_ASSEMBLY_ALIGN (MEGAHIT-30B-30B)            [100%] 24 of 24, cached: 24 ✔                                                                 │·······
[c8/e634fe] process > NFCORE_MAG:MAG:BINNING:METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS (30B)                      [100%] 24 of 24, cached: 24 ✔                                                                 │·······
[67/d371d6] process > NFCORE_MAG:MAG:BINNING:CONVERT_DEPTHS (30A)                                            [100%] 24 of 24, cached: 24 ✔                                                                 │·······
[a2/418adb] process > NFCORE_MAG:MAG:BINNING:METABAT2_METABAT2 (45C)                                         [100%] 24 of 24, cached: 24 ✔                                                                 │·······
[26/66207c] process > NFCORE_MAG:MAG:BINNING:MAXBIN2 (45C)                                                   [100%] 24 of 24, cached: 24 ✔                                                                 │·······
[68/809226] process > NFCORE_MAG:MAG:BINNING:ADJUST_MAXBIN2_EXT (MEGAHIT-45C)                                [100%] 24 of 24, cached: 24 ✔                                                                 │·······
[6f/c34c8d] process > NFCORE_MAG:MAG:BINNING:SPLIT_FASTA (MEGAHIT-MaxBin2-45C)                               [100%] 48 of 48, cached: 48 ✔                                                                 │·······
[b9/fe9b92] process > NFCORE_MAG:MAG:BINNING:GUNZIP_BINS (MEGAHIT-MaxBin2-45C.105.fa.gz)                     [100%] 1355 of 1355, cached: 1355 ✔                                                           │·······
[-        ] process > NFCORE_MAG:MAG:BINNING:GUNZIP_UNBINS                                                   -                                                                                             │·······
[67/0a0f11] process > NFCORE_MAG:MAG:DEPTHS:MAG_DEPTHS (MEGAHIT-MetaBAT2-29B)                                [ 43%] 21 of 48, cached: 21                                                                   │·······
[-        ] process > NFCORE_MAG:MAG:DEPTHS:MAG_DEPTHS_PLOT                                                  -                                                                                             │·······
[-        ] process > NFCORE_MAG:MAG:DEPTHS:MAG_DEPTHS_SUMMARY                                               -                                                                                             │·······
[24/924fce] process > NFCORE_MAG:MAG:BUSCO_QC:BUSCO_DB_PREPARATION (bacteria_odb10.2020-03-06.tar)           [100%] 1 of 1, cached: 1 ✔                                                                    │·······
[62/d340b9] process > NFCORE_MAG:MAG:BUSCO_QC:BUSCO (MEGAHIT-MaxBin2-45C.048.fa)                             [100%] 1355 of 1355, cached: 1355 ✔                                                           │·······
[12/17a878] process > NFCORE_MAG:MAG:BUSCO_QC:BUSCO_SUMMARY                                                  [100%] 1 of 1, cached: 1 ✔                                                                    │·······
[13/ec8d5e] process > NFCORE_MAG:MAG:QUAST_BINS (MEGAHIT-MaxBin2-45C)                                        [100%] 48 of 48, cached: 48 ✔                                                                 │·······
[d3/b94d4e] process > NFCORE_MAG:MAG:QUAST_BINS_SUMMARY                                                      [100%] 1 of 1, cached: 1 ✔                                                                    │·······
[ab/bffbab] process > NFCORE_MAG:MAG:CAT_DB (CAT_prepare_20210107.tar)                                       [100%] 1 of 1, cached: 1 ✔                                                                    │·······
[e9/3caae6] process > NFCORE_MAG:MAG:CAT (MEGAHIT-MetaBAT2-7B-CAT_prepare_20210107)                          [  0%] 0 of 42                                                                                │·······
[-        ] process > NFCORE_MAG:MAG:CAT_SUMMARY                                                             -                                                                                             │·······
[ef/ec184e] process > NFCORE_MAG:MAG:GTDBTK:GTDBTK_DB_PREPARATION (gtdbtk_r214_data.tar.gz)                  [100%] 1 of 1, cached: 1 ✔                                                                    │·······
[-        ] process > NFCORE_MAG:MAG:GTDBTK:GTDBTK_CLASSIFYWF                                                -                                                                                             │·······
[-        ] process > NFCORE_MAG:MAG:GTDBTK:GTDBTK_SUMMARY                                                   -                                                                                             │·······
[-        ] process > NFCORE_MAG:MAG:BIN_SUMMARY                                                             -                                                                                             │·······
[12/15ce6e] process > NFCORE_MAG:MAG:PROKKA (MEGAHIT-MaxBin2-45C.057)                                        [100%] 1355 of 1355, cached: 1355 ✔                                                           │·······
[-        ] process > NFCORE_MAG:MAG:CUSTOM_DUMPSOFTWAREVERSIONS                                             -                                                                                             │·······
[-        ] process > NFCORE_MAG:MAG:MULTIQC                                                                 -                                                                                             │·······
ERROR ~ Unknown method invocation `getBaseName` on String type                                                                                                                                             │·······
                                                                                                                                                                                                           │·······
 -- Check script '/nvme/h/ppissaridou/.nextflow/assets/nf-core/mag/./workflows/../subworkflows/local/gtdbtk.nf' at line: 27 or see '.nextflow.log' file for more details

Relevant files

configuration and log file.zip

System information

N E X T F L O W ~ version 23.04.1

HPC

Singularity

Ubuntu

Version of nf-core/mag 2.5

@PPpissar PPpissar added the bug Something isn't working label Oct 30, 2023
@maxibor
Copy link
Member

maxibor commented Nov 2, 2023

Just encountered the same issue :
The fix in subworkflows/local/gtdbtk.nf at line: 27 should be
Though, I'm not sure why we need this whole map there, since the odb10 is not a substring of the database directory anyway.

def busco_db = file(params.busco_db)
if (busco_db.getBaseName().contains('odb10')) {

Also ping @jfy133

@maxibor
Copy link
Member

maxibor commented Nov 2, 2023

There's also a similar issue in workflows/mag.nf starting from line 457 (for @gregorysprenger and @jfy133 )

if ( !ch_centrifuge_db_file.isEmpty() ) {
        if ( ch_centrifuge_db_file.extension in ['gz', 'tgz'] ) {
            // Expects to be tar.gz!
            ch_db_for_centrifuge = CENTRIFUGE_DB_PREPARATION ( ch_centrifuge_db_file ).db
        } else if ( ch_centrifuge_db_file.isDirectory() ) {
            ch_db_for_centrifuge = Channel
                                    .fromPath( "${ch_centrifuge_db_file}/*.cf" )
        } else {
            ch_db_for_centrifuge = Channel.empty()
        }
    } else {
        ch_db_for_centrifuge = Channel.empty()
    }

    // Centrifuge val(db_name) has to be the basename of any of the
    //   index files up to but not including the final .1.cf
    ch_db_for_centrifuge = ch_db_for_centrifuge
                            .collect()
                            .map{
                                db ->
                                    def db_name = db[0].getBaseName().split('\\.')[0]
                                    [ db_name, db ]
                            }

The map needs to be moved inside the if/else if otherwise in case where a centriuge db is not provided, it craps out trying to getBaseName of a null object

@jfy133
Copy link
Member

jfy133 commented Feb 1, 2024

In the upcoming patch release :)

@jfy133 jfy133 closed this as completed Feb 1, 2024
@mtva0001
Copy link

Hi! I have the same issue and, although I see that you are planning to fix this in the next release, I wonder how I could fix it without updating the pipeline? Once I tried to update it and resume and it started the entire process from the very beginning, so I would like to avoid that this time (especially since I'm very close to finish with the processing after so many months).
Thanks a lot for your help in advance!

@jfy133
Copy link
Member

jfy133 commented Feb 11, 2024

Hi @mtva0001 the fix is already out in 2.5.3.

However it's very hard to say whether it will start from the beginning again or not :/.

The only thing I can recommend is to try and copy the 'fix' that is in 2.5.3 into your local copy of the pipeline, and then try to resume from there.

The fix in particular is:

https://github.com/nf-core/mag/blob/master/subworkflows%2Flocal%2Fgtdbtk.nf#L28-L29

  • And your local copy should be in something like ~/. nextflow/assets/nf-core/mag/subworkflow/local/gtdbtk.nf or something like that

However I can't guarantee this will work though... Sorry. The resuming thing is a little mysterious

@mtva0001
Copy link

Thanks a lot! It seems it worked! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants