--fastq_mergepairs

1,349 views
Skip to first unread message

Susan Newman

unread,
Apr 27, 2016, 10:59:03 AM4/27/16
to VSEARCH Forum
Hi,

I have a very large dataset consisting of 90 forward and 90 reverse paired sequences.  I can successfully use --fastq_mergepairs to merge a single pair.  I've done this for a small dataset of 10 samples then used cat to concatenate the individual output files into a single file of merged contigs.  I have been unable to get a wildcard command to process all of my files to work.  I am following the USearch protocol using the command:

vsearch --fastq_mergepairs *_R1_*.fastq --reverse *_R2_*.fastq --fastqout mergedAll.fq

This command generates the error:  Unrecognized string on command line (M-42-CD-A_S68_L001_R1_001.fastq)  This is the second sample in my dataset.  And the error, "segmentation fault (core dumped)"

Can you please provide the proper syntax for handling multiple files?  How do I use --relabel to preserve the sample information in the merged file?

Many thanks for your assistance.  I am switching from USearch to VSearch as this dataset is too large to be handled by USearch-Windows version.

Susan

Frédéric Mahé

unread,
Apr 27, 2016, 11:17:22 AM4/27/16
to VSEARCH Forum
Hi Susan,


vsearch can only process one file (or pair of files) at a time. You should loop over your list of files. For example:

for R1 in *_R1_*.fastq ; do
    vsearch \
        --fastq_mergepairs ${R1} \
        --reverse ${R1/_R1/_R2_} \
        --fastqout ${R1/R1_*/merged.fastq}
done


If you process your files one by one, you can freely use the --relabel option to mark your reads.

Susan Newman

unread,
May 4, 2016, 5:49:27 PM5/4/16
to VSEARCH Forum
Yes, that did the trick.  I found one small typo, a missing underscore    --reverse ${R1/_R1_/_R2_}\ 

 Thanks for helping out.

Susan

aebra...@gmail.com

unread,
Nov 3, 2016, 10:46:19 PM11/3/16
to VSEARCH Forum
Hello Guys;
I have a plan to use usearch by linux command but I didn't find any command related to usearch in linux. Is anyone can help me how to analyse my data with usearch command in linux?
Thanks
Aziz

Torbjørn Rognes

unread,
Nov 4, 2016, 6:29:19 AM11/4/16
to VSEARCH Forum
Hi Aziz,

This is a support forum for vsearch, not for usearch. 

You can find and download the vsearch software here: https://github.com/torognes/vsearch

Please follow the instructions about downloading and installation in the README.

For more information about usearch, look here: http://www.drive5.com/usearch/

Good luck!

- Torbjørn

bern...@gmail.com

unread,
May 16, 2017, 10:33:37 AM5/16/17
to VSEARCH Forum
Hi Frédéric,

I used --relabel with -fastq_mergepairs, indeed expecting that the reads would be renamed (using vsearch v2.4.3_osx_x86_64)

However, relabelling of the read IDs does not occur, they remain unchanged. For example, with --fastq_filter and the same input files, the readIds are changed.


Should --relabel work indeed with --fastq_mergepairs ? 



Best,

Bernd

Frédéric Mahé

unread,
May 17, 2017, 12:06:34 PM5/17/17
to VSEARCH Forum
Hi Bernd,

no the --relabel option does not work with the command --fastq_mergepairs. To get a list of the accepted options for each command, try vsearch -h

Best,
Message has been deleted

jstil...@gmail.com

unread,
Dec 14, 2019, 12:06:15 PM12/14/19
to VSEARCH Forum
Is there a way to do this (multiple sets of paired reads merged into a single file) in the mac version?

Frédéric Mahé

unread,
Dec 14, 2019, 4:09:44 PM12/14/19
to vsearc...@googlegroups.com
do you mean something like this?

for f in *R1.fastq ; do vsearch --fastq_mergepairs ${f} --reverse ${f/R1/R2} --fastqout - ; done > all_merged.fastq


Reply all
Reply to author
Forward
0 new messages