Eco-Flow / pollen-metabarcoding

A pipeline developled in collaboration with Exeter University
1 stars 0 forks source link

Nextflow version 24 fails #5

Closed chriswyatt1 closed 5 months ago

chriswyatt1 commented 6 months ago

$ nextflow run main.nf -profile docker,test_small -resume

N E X T F L O W ~ version 24.04.1

ERROR ~ Unknown method invocation makeComplement on _parse_closure5 type

Seems to be connected to the use of Reverse complement definition in module.config.

Made a temporary branch that skips this until a fix is found: See branch Without_RV

chriswyatt1 commented 6 months ago

Had to fix groovy code that was broken somehow. The following works:

class Example { 
   static void main(String[] args) { 

        def makeComplement = { seq ->
            def complements = [ A:'T', T:'A', U:'A', G:'C', C:'G', Y:'R', R:'Y', S:'S', W:'W', K:'M', M:'K', B:'V', D:'H', H:'D', V:'B', N:'N' ]
            def comp = seq.toUpperCase().collect { base -> complements[ base ] ?: 'X' }.join()
            return comp
        }

      //Initializing 2 variables 
      def FW_primer = "AGTGCGACGATGCATGCA"
      def RV_primer = "AGTGCGACGATGCATGCA"

      //Printing the value of the variables to the console 
      println("The value of x is " + FW_primer + "The value of X is " + RV_primer);  

      def RV_primer_RevComp = makeComplement ( RV_primer.reverse() )

      println(RV_primer_RevComp);
    }
}
chriswyatt1 commented 6 months ago

Changed in modules config to :

        def makeComplement = { seq ->
            def complements = [ A:'T', T:'A', U:'A', G:'C', C:'G', Y:'R', R:'Y', S:'S', W:'W', K:'M', M:'K', B:'V', D:'H', H:'D', V:'B', N:'N' ]
            def comp = seq.toUpperCase().collect { base -> complements[ base ] ?: 'X' }.join()
            return comp
        }
        def RV_primer_RevComp = makeComplement ( "${params.RV_primer}".reverse() )
        def FW_primer_RevComp = makeComplement ( "${params.FW_primer}".reverse() )

But still have an error:

ERROR ~ Error executing process > 'CUTADAPT (ERR2537811)'

Caused by:
  No signature of method: nextflow.executor.BashFunLib.render() is applicable for argument types: () values: []
  Possible solutions: render(), every(), find(), every(groovy.lang.Closure), find(groovy.lang.Closure), any()
 -- Check '.nextflow.log' file for details
chriswyatt1 commented 5 months ago

Run with old version of nextflow if it doesn't work:

NXF_VER=23.04.5 nextflow run main.nf ...

chriswyatt1 commented 5 months ago

Had to update amazon plugin too. Now fixed

58d3b9d