<p>If a value for <code>MAXKMERLENGTH</code> was not set when compiling <code>velveth</code>, VelvetOptimizer just uses the default <code>$maxhash</code> value of 31<sup><a href="https://github.com/tseemann/VelvetOptimiser/blob/2.2.6/VelvetOptimiser.pl#L110-L112" rel="nofollow noreferrer">1</a></sup>. The hash lengths that you specify on the command line must be less than or equal to this value to run the tool successfully. The solution is to re-compile <code>velveth</code> with a larger <code>MAXKMERLENGTH</code>, for example:</p>
<pre><code>make 'MAXKMERLENGTH=69'
</code></pre>
<p>Alternatively, re-install using the <a href="/questions/tagged/bioconda" class="post-tag" title="show questions tagged &#39;bioconda&#39;" aria-label="show questions tagged &#39;bioconda&#39;" rel="tag" aria-labelledby="bioconda-container">bioconda</a> package manager:</p>
<pre><code>conda install -c bioconda perl-velvetoptimiser
</code></pre>
<p>This package includes <a href="https://anaconda.org/bioconda/velvet" rel="nofollow noreferrer">velvet</a>, which is built using a much higher maximum k-mer length and is usually sufficient for most purposes: <code>MAXKMERLENGTH=191</code><sup><a href="https://github.com/bioconda/bioconda-recipes/blob/master/recipes/velvet/build.sh" rel="nofollow noreferrer">2</a></sup>.</p>

CC BY-SA 4.0
2023-01-17T02:49:52.767Z
2023-01-17T02:49:52.767Z
Steve
<p>I'm trying to use Velvet Optimizer for a De Novo Assembly; I set my hash-lengths to be between 55 and 69</p>
<pre><code>/projects/path/to/perlscripts/VelvetOptimiser-2.2.6/VelvetOptimiser.pl -s 55 -e 69 -f '-shortPaired -fastq.gz -separate trial2.trimmed.paired.R1.fastq.gz trial2.trimmed.paired.R2.fastq.gz' -f '-short -fastq.gz trial2.trimmed.unpaired.R1.fastq.gz' -f '-short -fastq.gz trial2.trimmed.unpaired.R2.fastq.gz' -x 2
</code></pre>
<p>When I check the output file, it returns me with</p>
<pre><code>Starting to check input parameters.
    Start hash value too high.  New start hash value is 31.
    End hash value not in workable range.  New end hash value is 31
</code></pre>
<p>Any idea where I could be going wrong in my command?</p>

<assembly>
Velvet Optimizer automatically changes to hash-length 31
# Velvet Optimizer automatically changes to hash-length 31

(Asked by: username_0 on 2023-01-16)

I'm trying to use Velvet Optimizer for a De Novo Assembly; I set my hash-lengths to be between 55 and 69
/projects/path/to/perlscripts/VelvetOptimiser-2.2.6/VelvetOptimiser.pl -s 55 -e 69 -f '-shortPaired -fastq.gz -separate trial2.trimmed.paired.R1.fastq.gz trial2.trimmed.paired.R2.fastq.gz' -f '-short -fastq.gz trial2.trimmed.unpaired.R1.fastq.gz' -f '-short -fastq.gz trial2.trimmed.unpaired.R2.fastq.gz' -x 2

When I check the output file, it returns me with
Starting to check input parameters.
    Start hash value too high.  New start hash value is 31.
    End hash value not in workable range.  New end hash value is 31

Any idea where I could be going wrong in my command?

**Tags:** assembly

---

## 1 answers

### Answer by username_1 on 2023-01-17. Score: 4 | Accepted answer

If a value for MAXKMERLENGTH was not set when compiling velveth, VelvetOptimizer just uses the default $maxhash value of 311. The hash lengths that you specify on the command line must be less than or equal to this value to run the tool successfully. The solution is to re-compile velveth with a larger MAXKMERLENGTH, for example:
make 'MAXKMERLENGTH=69'

Alternatively, re-install using the bioconda package manager:
conda install -c bioconda perl-velvetoptimiser

This package includes velvet, which is built using a much higher maximum k-mer length and is usually sufficient for most purposes: MAXKMERLENGTH=1912.


---

