SEQanswers

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 12:39 AM
How to exclude some id's from the file by grep or any other command M.Verma Bioinformatics 11 01-16-2013 06:40 PM
GATK with non-model organism (Help with making SNP VCF file)) newbietonextgen Bioinformatics 7 09-10-2012 07:59 AM
making non-redundant isotig file from newbler output Seqasaurus Bioinformatics 2 09-22-2011 04:44 AM
Making a bedGraph from a Bowtie file gez Bioinformatics 2 12-15-2010 07:35 AM

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

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

Hello,

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, 06:38 PM   #2
Kennels
Senior Member
 
Location: Sydney

Join Date: Feb 2011
Posts: 149
Default

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, 06:55 AM   #3
BugSeq
Junior Member
 
Location: OH

Join Date: Feb 2012
Posts: 5
Default

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 (http://www.usadellab.org/cms/?page=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.

Code:
#!/usr/bin/perl

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";
	system.exit(0);	
}

$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
Reply

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 09:41 AM.


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