tseemann / VelvetOptimiser

:chart_with_upwards_trend: Automatically optimise three of Velvet's assembly parameters.
GNU General Public License v2.0
47 stars 18 forks source link

Reverse logic on 'ncon' option #7

Closed drchriscole closed 7 years ago

drchriscole commented 7 years ago

My assumption with using 'ncon' as the optimal parameter was to find the fewest number of contigs. However, it finds the combination with the highest number of contigs. I can't imagine a situation where this is really what you want. Can the logic on this be reversed i.e. optimse for the fewest contigs?

Thanks

p.s. I write this fully in the knowledge that other issues have been untouched in several years, but hey, you gotta have hope ;)

Slugger70 commented 7 years ago

Each of the optimisation variables can be used in any way you want to create a function. All the VOpt does is try to maximise the output of the optimisation function. So to get the minimum number of contigs, try -1*ncon...

drchriscole commented 7 years ago

Good point! Trying now...

drchriscole commented 7 years ago

Hmmm. Doesn't work. Getting these warnings and it's choosing the wrong assembly. "Optimisation function did not return a single float. Optimisation function was not evaluatable. Optfunc: -1*280 at ~/exbin/VelvetOptimiser-2.2.5/VelvetOpt/Assembly.pm line 329."

There were 5 iterations with the following total number of contigs: 1 = 4467 2 = 3177 3 = 1536 4 = 581 5 = 280 (4) was chosen for the 2nd stage of optimisation.

This was the command used: VelvetOptimiser.pl -s 71 -e 95 -x 6 -t 4 -k '-1*ncon' etc...

tseemann commented 7 years ago

Found the bug... if your result is negative it fails this match: unless($r =~ /^\d+/){