ERROR ~ Ambiguous method overloading for method java.io.File#<init>.

618 views
Skip to first unread message

Michał T. Lorenc

unread,
Jul 14, 2017, 7:14:09 AM7/14/17
to Nextflow
Hello,
I got this error:

> nextflow run trinotate.nf --genome /home/lorencm/trinotate/Trinotate-3.0.2/sample_data/data/Trinity.fasta --chunks 4 --databases /home/lorencm/trinotate/databases/ --output /home/lorencm/trinotate/

N E X T F L O W  ~  version 0.24.2

Launching `trinotate.nf` [modest_almeida] - revision: f67362ec61

T R I N O T A T E - N F  ~  version 0.1

=====================================

genome                 : /home/lorencm/trinotate/Trinotate-3.0.2/sample_data/data/Trinity.fasta

databases              : /home/lorencm/trinotate/databases/

chunks                 : 4

output                 : /home/lorencm/trinotate/

      


WARN: Access to undefined parameter `database` -- Initialise it to a default value eg. `params.database = some_value`

ERROR ~ Ambiguous method overloading for method java.io.File#<init>.

Cannot resolve which method to invoke for [null, class java.lang.String] due to overlapping prototypes between:

[class java.lang.String, class java.lang.String]

[class java.io.File, class java.lang.String]


with the below code:

#!/usr/bin/env nextflow


log.info "T R I N O T A T E - N F  ~  version 0.1"

log.info "====================================="

log.info "genome                 : ${params.genome}"

log.info "databases              : ${params.databases}"

log.info "chunks                 : ${params.chunks}"

log.info "output                 : ${params.output}"

log.info "      \n"


/*

 * Input parameters validation

 */



genome                        = file(params.genome)

swissProt                    = new File(params.databases, "uniprot_sprot.pep")

pfamA                        = new File(params.databases, "Pfam-A.hmm")

trinotateSqlite               = new File(params.databases, "Trinotate_v3.sqlite")

chunks                        = params.chunks



//db_name = file(params.db).name

params.chunk = 1

Channel.fromPath(genome)

       .splitFasta(by: params.chunk)

       .set{chunks}


Channel.path(new File(params.database, "uniprot_sprot.pep"))

       .set(swissProt)


process formatBlastDatabases {


    input:

    file prot from swissProt


    output:

    file "${dbName}.*" into blastDb


    script:

    dbName = species.baseName

    """

    makeblastdb -dbtype prot -in ${swissProt} -out ${dbName}

    """


}


/*

 * Extends a BLAST query for each entry in the 'chunks' channel

 */

process blast {

    input:

    file 'query.fa' from chunks

    file db_path from blastdb


    output:

    file blast_results


    """

    blastp -db $db_path -query query.fa -outfmt 6 > $params.database

    """

}


How is it possible to fix it?

Thank you in advance,

Michal
Reply all
Reply to author
Forward
0 new messages