error while using cutadapt
2
0
Entering edit mode
7.1 years ago
KVC_bioinfo ▴ 600

Hello, I am using cutadapt for trimming the adaptor sequences from fastq file:

I constantly get the following error:

cutadapt: error: Line 1 in FASTQ file is expected to start with '@', but found '\r\n'

Can anyone help me regarding this?

running

head -n1 myfastq.fastq | sed -n 'l' gives me

@41404e26-7b94-4142-b3a5-0ec9334993d5 runid=62c17cb4e69123bd793be3870\ 6e23549626a5271 read=33 ch=100 start_time=2017-01T14:10:44Z\r$

cutadapt trim • 3.2k views
ADD COMMENT
2
Entering edit mode
7.1 years ago
chen ★ 2.5k

\r\n is the line break used in Windows or DOS system. Maybe cutadapt doesn't support it (I didn't try).

You can use fastp to cut adapters, which can handle different kinds of line breaks (\n,\r or \r\n).

You can use fastp to preprocess your Illumina sequencing data (no matter RNASeq / DNASeq, no matter PE/SE). It can trim adapters automatically for both PE and SE data, which means that you don't have to input the adapter sequences.

Besides trimming adapters, this tool also performs quality filtering and other operations to improve your data quality. And most of the features are automated. All you have to do is to install fastp, and run:

fastp -i in.R1.fq.gz -I in.R2.fq.gz -o out.R1.fq.gz -O out.R2.fq.gz

This tool is very fast (written in C++, with multithreading supported), you can get it from: https://github.com/OpenGene/fastp

ADD COMMENT
0
Entering edit mode

Thank you! Can I use this tool for nanopore sequence?

ADD REPLY
0
Entering edit mode

I didn't try it since I don't have such data.

Would you please send me a sample of nanopore data so that I can fit this tool for nanopore sequence?

My email: chen@haplox.com

ADD REPLY
1
Entering edit mode
7.1 years ago
JC 13k

As many Bioinformatics programs, it is complaining about text files in DOS format ("\r\n" marks a new line), those programs expects the file to be in Unix format ("\n" is the new line). You can convert your file with the Unix command dos2unix.

ADD COMMENT
0
Entering edit mode

when I try that I get command not found.

ADD REPLY
2
Entering edit mode
dos to unix:
sed 's/\r$//' dos.txt > unix.txt
unix to dos:
sed 's/$/\r/' unix.txt > dos.txt
ADD REPLY
1
Entering edit mode

you need to install it ;)

sudo apt-get install dos2unix
ADD REPLY

Login before adding your answer.

Traffic: 1504 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6