Closed GoogleCodeExporter closed 9 years ago
every time I try to run cutadapt (e.g. cutadapt --help) i get the following
error:
Traceback (most recent call last):
File "/share/bin/cutadapt", line 9, in ?
from cutadapt.scripts import cutadapt
ImportError: No module named cutadapt.scripts
i'm not a linux expert, so any help at all would be great!
cheers
matt
Original comment by matt.a...@gmail.com
on 4 Mar 2015 at 8:48
Regarding your installation problem: It seems to me you are using a quite old
Python version. Considering your second comment, did you manage to get it
installed?
What does "python --version" say and which Linux distribution are you using (if
any)?
Original comment by marcel.m...@tu-dortmund.de
on 4 Mar 2015 at 9:06
thanks for coming to me
python --version doesn't work
python -V gives:
Python 2.4.3
i have no idea on the linux distribution. It's a large shared cluster and lots
of people use it for NGS analysis.
I have found that cutadapt is already installed in /shared/bin (which cutadapt
returns /share/bin/cutadapt)
there are some older versions of cutadapt as well so it looks likely that it's
been on there a while. in /share/apps i can see:
cutadapt_1.0
cutadapt_1.4.1
cutadapt_current -> cutadapt_1.4.1
matt
Original comment by matt.a...@gmail.com
on 4 Mar 2015 at 9:21
That’s a really old Python version. Cutadapt requires at least Python 2.6.
But I think you have a more recent Python available on the system since those
old versions have also required 2.6 and you seem to be able to run them
(somehow).
To find out where the Python is that the installed cutadapt version uses, run
"head -n 1 /share/bin/cutadapt". It should show you the path to the more recent
Python.
Or perhaps even simpler: Try to run "python2.6" or "python2.7" instead of just
"python". If that works, then install cutadapt with "python2.7 setup.py install
--user".
Or do you have some kind of a module system which you can use to load a more
recent Python?
Original comment by marcel.m...@tu-dortmund.de
on 4 Mar 2015 at 9:37
this is what i get when i type python2.6
[marnobrc@bignode bin]$ python2.6
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback
Python 2.6 (r26:66714, May 11 2013, 13:52:32)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Original comment by matt.a...@gmail.com
on 4 Mar 2015 at 9:44
i also have python2.7 so i typed (verbatim) python2.7 setup.py install --user
a whole load of output....
how can i test if it's installed properly?
Original comment by matt.a...@gmail.com
on 4 Mar 2015 at 9:51
so now i deleted previous installation of 1.7.1, and re unpacked the tar file,
and installed it again using the python2.7 setup.py install --user
still doesn't work...
here is the output from the installation and the --help command
[marnobrc@bignode cutadapt-1.7.1]$ python2.7 setup.py install --user
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/cutadapt
copying cutadapt/modifiers.py -> build/lib.linux-x86_64-2.7/cutadapt
copying cutadapt/compat.py -> build/lib.linux-x86_64-2.7/cutadapt
copying cutadapt/xopen.py -> build/lib.linux-x86_64-2.7/cutadapt
copying cutadapt/adapters.py -> build/lib.linux-x86_64-2.7/cutadapt
copying cutadapt/colorspace.py -> build/lib.linux-x86_64-2.7/cutadapt
copying cutadapt/align.py -> build/lib.linux-x86_64-2.7/cutadapt
copying cutadapt/seqio.py -> build/lib.linux-x86_64-2.7/cutadapt
copying cutadapt/report.py -> build/lib.linux-x86_64-2.7/cutadapt
copying cutadapt/__init__.py -> build/lib.linux-x86_64-2.7/cutadapt
copying cutadapt/qualtrim.py -> build/lib.linux-x86_64-2.7/cutadapt
creating build/lib.linux-x86_64-2.7/cutadapt/scripts
copying cutadapt/scripts/cutadapt.py ->
build/lib.linux-x86_64-2.7/cutadapt/scripts
copying cutadapt/scripts/__init__.py ->
build/lib.linux-x86_64-2.7/cutadapt/scripts
running build_ext
building 'cutadapt._align' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/cutadapt
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -I/share/apps/python_2.7/include/python2.7 -c
cutadapt/_align.c -o build/temp.linux-x86_64-2.7/cutadapt/_align.o
gcc -pthread -shared build/temp.linux-x86_64-2.7/cutadapt/_align.o -o
build/lib.linux-x86_64-2.7/cutadapt/_align.so
building 'cutadapt._qualtrim' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -I/share/apps/python_2.7/include/python2.7 -c
cutadapt/_qualtrim.c -o build/temp.linux-x86_64-2.7/cutadapt/_qualtrim.o
gcc -pthread -shared build/temp.linux-x86_64-2.7/cutadapt/_qualtrim.o -o
build/lib.linux-x86_64-2.7/cutadapt/_qualtrim.so
building 'cutadapt._seqio' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -I/share/apps/python_2.7/include/python2.7 -c
cutadapt/_seqio.c -o build/temp.linux-x86_64-2.7/cutadapt/_seqio.o
gcc -pthread -shared build/temp.linux-x86_64-2.7/cutadapt/_seqio.o -o
build/lib.linux-x86_64-2.7/cutadapt/_seqio.so
running build_scripts
creating build/scripts-2.7
copying and adjusting bin/cutadapt -> build/scripts-2.7
changing mode of build/scripts-2.7/cutadapt from 664 to 775
running install_lib
copying build/lib.linux-x86_64-2.7/cutadapt/_align.so ->
/home/marnobrc/.local/lib/python2.7/site-packages/cutadapt
copying build/lib.linux-x86_64-2.7/cutadapt/_qualtrim.so ->
/home/marnobrc/.local/lib/python2.7/site-packages/cutadapt
copying build/lib.linux-x86_64-2.7/cutadapt/_seqio.so ->
/home/marnobrc/.local/lib/python2.7/site-packages/cutadapt
running install_scripts
copying build/scripts-2.7/cutadapt -> /home/marnobrc/.local/bin
changing mode of /home/marnobrc/.local/bin/cutadapt to 775
running install_egg_info
Removing
/home/marnobrc/.local/lib/python2.7/site-packages/cutadapt-1.7.1-py2.7.egg-info
Writing
/home/marnobrc/.local/lib/python2.7/site-packages/cutadapt-1.7.1-py2.7.egg-info
[marnobrc@bignode cutadapt-1.7.1]$ ~/apps/cutadapt/cutadapt-1.7.1/bin/cutadapt
--help
Traceback (most recent call last):
File "/home/marnobrc/apps/cutadapt/cutadapt-1.7.1/bin/cutadapt", line 9, in ?
from cutadapt.scripts import cutadapt
File "/home/marnobrc/apps/cutadapt/cutadapt-1.7.1/cutadapt/__init__.py", line 9
except ImportError as e:
^
SyntaxError: invalid syntax
thanks once again - i'm learning a lot here!!
Matt
Original comment by matt.a...@gmail.com
on 4 Mar 2015 at 10:09
I think it was installed successfully, you just didn’t call the correct
program. The newly installed cutadapt is in ~/.local/bin/cutadapt . Try to run
that one instead of the one in ~/apps/... and it should work!
Original comment by marcel.m...@tu-dortmund.de
on 4 Mar 2015 at 10:31
lovely: thanks so much!!
matt
Original comment by matt.a...@gmail.com
on 4 Mar 2015 at 11:54
further to this: i want to trim 80 paired end fastq.gz files. What is the best
way to organise the files and run the scripts? I have them in 2 places: all
together in one dir and also organised in read pairs in individual dirs.
the names are as follows, for read 1: sample1-ID_index-seq_L001_R1_001.fastq.gz
and read 2 is the same but ...R2_001.fastq.gz. Will the command examples in
the documentation work with files in these formats?
cutadapt -q 10 -a ADAPTER_FWD --minimum-length 20 -o tmp.1.fastq -p tmp.2.fastq
reads.1.fastq reads.2.fastq
or do i have to rename them reads.1.fastq, reads.2.fastq, etc
what is the simplest test as a dummy run on one of the paired end read files?
matt
Original comment by matt.a...@gmail.com
on 5 Mar 2015 at 1:26
You can leave the file names as they are. The .gz ending means the files are
compressed and cutadapt recognizes that (and automatically decompresses them).
I’m not sure what you mean by "dummy run". Perhaps just follow the
instructions in the manual for one of your file pairs?
To trim all files, you can use a "for" loop on the Bash command line. This
doesn’t have so much to do with cutadapt, so I suggest you talk to your local
Unix guru, but here is something to get you started.
I would keep all files in a single directory and try something like the
following.
Create a temporary directory for the intermediate half-trimmed files (remember
that cutadapt needs to be run twice to trim paired-end reads!):
mkdir tmp
Then:
for r1 in *_R1_*.fastq.gz; do r2=${r1/_R1_/_R2_}; echo cutadapt -a
FIRST_ADAPTER -o tmp/$r1 -p tmp/$r2 $r1 $r2; done
When you run that command, it will show you the cutadapt commands (but not
actually run them). Check that everything is fine, then run the line again, but
remove the "echo".
Create the output directory:
mkdir trimmed
Then run cutadapt a second time, but reversing r1 and r2 (and using the files
in tmp/ as input).
for r1 in *_R1_*.fastq.gz; do r2=${r1/_R1_/_R2_}; echo cutadapt -a
SECOND_ADAPTER -o trimmed/$r2 -p trimmed/$r1 tmp/$r2 tmp/$r1; done
Again, check that everything looks fine, then remove the "echo" and run it. The
trimmed files should now be in the trimmed/ subdirectory. No guarantees,
though. It is much quicker to fix these things if you have someone locally that
has some Unix command-line experience.
By the way, the next cutadapt release (1.8), which I’m preparing currently,
will not require anymore that you run it twice when you have paired-end reads.
I’m closing this ticket now as "WontFix" since the original issue was not a
problem in cutadapt, but feel free to post further comments.
Original comment by marcel.m...@tu-dortmund.de
on 8 Mar 2015 at 9:31
Original issue reported on code.google.com by
matt.a...@gmail.com
on 4 Mar 2015 at 7:58