This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Question: Can't change MAXKMERLENGTH on Velvet

Hi Everyone.

I know a couple people have been having this problem as well, but I have tried everything to change the acceptable max Kmer length on velvet. I have changed the directory to my velvet folder and used the command: make 'MAXKMERLENGTH=49'. I have done this with and without the quotes. I have gone into the actual Makefile and changed MAXKMERLENGTH to 49, and then typed in the command: make. And I always get the message Velvet can't handle k-mers as long as 49! We'll stick to 31 if you don't mind.

That devilish little quote is starting to show up in my stress dreams!

I currently have the latest version of Velvet (1.2.10). Does anyone know what to do? Or am I cursed to have a lifelong career of poor assemblies?

assembly

Hello djuna.gulliver!

Questions similar to yours can already be found at:

We have closed your question to allow us to keep similar content in the same thread.

If you disagree with this please tell us why in a reply below. We'll be happy to talk about it.

Cheers!

PS: Question (with solved answer) exists already.

This issue is not closed. I have tried everything suggested "similar question" and it still does not work. It would be nice to be able to respond to people wo have answered me.

Djuna

reopening question now.

3 answers

What happens when you do which velvetg?

There's a possibility that you're accidentally using the system-wide version instead of the one you compiled. Try running your process with the full path to your compiled velvetg and velveth

Yes, I think this is the problem. When I type which velvetg it comes up with /usr/bin. I have tried to do the follow commands:

make 'MAXKMERLENGTH=49'
make velveth velvetg

The problem seems to be that the last command is not actually making a velveth and velvetg in the correct directory, and instead, the velveth and velvetg command are using the /usr/bin/ directory. Am I doing something that is preventing me from properly compiling velveth and velvetg?

You have the choice to manually edit the Makefile file that is downloaded with the source. I do this with my students and this have been done successfully many times. Here goes the header of such a Makefile file

$gedit Makefile

CC = gcc
CFLAGS = -Wall
DEBUG = -g
LIBS = -lm
OPT = -O3
MAXKMERLENGTH=101
CATEGORIES=4
OPENMP=1
DEF = -D MAXKMERLENGTH=$(MAXKMERLENGTH) -D CATEGORIES=$(CATEGORIES)
PDFLATEX_VERSION := $(shell pdflatex --version 2> /dev/null)

This happened to another person too(See here: Velvet can't handle k-mers as long as X! We'll stick to 32 if you don't mind. ). Seems to be a problem with the Makefile. This is the workaround:

$ make clean
$ make MAXKMERLENGTH=49

If you wish to use your local velvet binaries, you either need to use them with their full path specified in the command, such as:

~/myBinaries/velvet/vetveth --rest-of-command

or add your velvet binaries to PATH before the system wide binaries, like so:

PATH=~/myBinaries/velvet:$PATH

in your bash profile.

Yes, I might have to be more specific in what I have tried. Sorry for the length, and sorry for the ugly glimpse at my lack of bioinformatics aptitude. Starting from downloading velvet:

wget http://www.ebi.ac.uk/~zerbino/velvet/velvet_1.2.03.tgz
tar xzf velvet_1.2.10.tgz
cd velvet_1.2.03
make MAXKMERLENGTH=91
make velveth velvetg
cd EPRIinsitu/RawFastq/BG1Folder #(this is where my fastq files are)
~/velvet_1.2.03/velveth BG1_35 35 -short -fastq BG1.trim.fastq

This I believe should give me a correct assembly with a KMER of 35. However, it says the file or directory of ~/velvet_1.2.10/velveth does not exist. A couple of things that I noticed: velveth and velvetg are never compiled in the velvet_1.2.10 folder. However, I do find them in the /usr/bin folder. This appears to be what is doing the assemblies. I cannot figure out how to compile these files in the /usr/bin folder, as the Makefile is in the velvet_1.2.10 folder, and for some reason I am not allowed to copy it to the /usr/bin folder. I have also tried copying the velveth and velvetg from the /usr/bin folder to the velvet_1.2.10 folder and doing the commands:

cd velvet_1.2.10
make clean
make MAXKMERLENGTH=91
make velveth velvetg
cd EPRIinsitu/RawFastq/BG1Folder #(once again, the folder my fastq's are in)
~/velvet_1.2.03/velveth BG1_35 35 -short -fastq BG1.trim.fastq

Unfortunately, this has not worked either. I still get that damned message "Velvet can't handle k-mers as long as 35! We'll stick to 31 if you don't mind."

Needless to say, I am out of ideas.

Sorry, it was suppose to say 1.2.10 for all of the versions.

This is why my New Years Resolution is to reread every email and post for typo's before hitting that send button.

Perhaps the problem can be deduced by the following error message whenever I run a make command:

src/readSet.c:36:18: fatal error: zlib.h: No such file or directory #include <zlib.h>

Whatever that means.

This is interesting. Does the make succeed at all? It should return an Error Code (possibly 1) and error out, if there's a problem with zlib.

Yes, after that message, it says:

compilation terminated.
make: ***[obj/readSet.o] Error 1

I have just now tried to download a new zlib (version 1.2.8). I run the commands:

PATH=$PATH:zlib-1.2.8 (which is the pathway to my zlib folder)
cd velvet_1.2.10
make MAXKMERLENGTH=71

But I still get the same error message.

Adding it to PATH won't work, you'll have to point LD_FLAGS and CPP_FLAGS to the lib and include folders within zlib, like so:

LD_FLAGS='-L /path/to/zlib/lib'
CPP_FLAGS='-I /path/to/zlib/include'
cd /path/to/velvet
make MAXKMERLENGTH=71

Thanks.

I compiled the zlib with:

./configure --prefix=/gullived/home # which is the folder I want zlib in
make
make install

After I put in the LD_FLAGS and CDD_FLAGS, it appeared to work. So it was a zlib issue after all.

Log in to answer this question.