Go Back   SEQanswers > Bioinformatics > Bioinformatics

Similar Threads
Thread Thread Starter Forum Replies Last Post
Making a Constant-Step bedGraph File apredeus Bioinformatics 2 02-27-2013 01:39 AM
How to exclude some id's from the file by grep or any other command M.Verma Bioinformatics 11 01-16-2013 07:40 PM
GATK with non-model organism (Help with making SNP VCF file)) newbietonextgen Bioinformatics 7 09-10-2012 08:59 AM
making non-redundant isotig file from newbler output Seqasaurus Bioinformatics 2 09-22-2011 05:44 AM
Making a bedGraph from a Bowtie file gez Bioinformatics 2 12-15-2010 08:35 AM

Thread Tools
Old 10-26-2013, 07:56 AM   #1
morning latte
Location: MI

Join Date: Jun 2013
Posts: 91
Default command for making an interleave file


I have two separate files containing R1 and R2 reads from HiSeq. The number of each file is different from QC. I have found few commands generating one interleave file from R1 and R2 files. But I also want to generate another file only with orphans rather than discarding them. Please give me direction to that script. Thank you.
morning latte is offline   Reply With Quote
Old 10-27-2013, 07:38 PM   #2
Senior Member
Location: Sydney

Join Date: Feb 2011
Posts: 149

The software Trimmomatic can generate the orphans for you in addition to QC filter and removing adapters, all in one go. If you want interleaved PE reads, then just take the Paired files output and implement what you have already done on these.
Kennels is offline   Reply With Quote
Old 10-28-2013, 07:55 AM   #3
Junior Member
Location: OH

Join Date: Feb 2012
Posts: 5

I would recommend using filtering programs that keep track of the paired end relationship and separates them into another file when the mate doesn't meet your filtering requirements. I have had good luck with Trimmomatic (

With the pared files in hand a simple script is all that is needed to interleave them. The one below used to come with velvet.


if (!@ARGV) {
	print "Usage: $0 forward_reads.fa reverse_reaads.fa outfile.fa\n";
	print "\tforward_reads.fa / reverse_reads.fa : paired reads to be merged\n";
	print "\toutfile.fa : outfile to be created\n";

$filenameA = $ARGV[0];
$filenameB = $ARGV[1];
$filenameOut = $ARGV[2];

die "Could not open $filenameA" unless (-e $filenameA);
die "Could not open $filenameB" unless (-e $filenameB);

open FILEA, "< $filenameA";
open FILEB, "< $filenameB";

open OUTFILE, "> $filenameOut";

my ($lineA, $lineB);

$lineA = <FILEA>;
$lineB = <FILEB>;

while(defined $lineA) {
	print OUTFILE $lineA;
	$lineA = <FILEA>;
	while (defined $lineA && $lineA !~ m/>/) { 
		print OUTFILE $lineA;
		$lineA = <FILEA>;

	print OUTFILE $lineB;
	$lineB = <FILEB>;
	while (defined $lineB && $lineB !~ m/>/) { 
		print OUTFILE $lineB;
		$lineB = <FILEB>;
BugSeq is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -8. The time now is 12:13 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO