Question: error while using cutadapt
0
gravatar for KVC_bioinfo
14 days ago by
KVC_bioinfo200
PA, USA
KVC_bioinfo200 wrote:

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 • 152 views
ADD COMMENTlink modified 14 days ago by chen1.2k • written 14 days ago by KVC_bioinfo200
2
gravatar for chen
14 days ago by
chen1.2k
OpenGene
chen1.2k wrote:

\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 COMMENTlink written 14 days ago by chen1.2k

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

ADD REPLYlink written 14 days ago by KVC_bioinfo200

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 REPLYlink written 14 days ago by chen1.2k
1
gravatar for JC
14 days ago by
JC6.3k
Mexico
JC6.3k wrote:

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 COMMENTlink written 14 days ago by JC6.3k

when I try that I get command not found.

ADD REPLYlink written 14 days ago by KVC_bioinfo200
2
dos to unix:
sed 's/\r$//' dos.txt > unix.txt
unix to dos:
sed 's/$/\r/' unix.txt > dos.txt
ADD REPLYlink written 14 days ago by genomax37k
1

you need to install it ;)

sudo apt-get install dos2unix
ADD REPLYlink written 14 days ago by JC6.3k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 607 users visited in the last hour