changeset 0:ba3bec698d3a draft

First upload.
author jampradinuk
date Thu, 10 May 2012 16:34:08 -0400
parents
children 028cfb1b807b
files my_tools/.DS_Store my_tools/._.DS_Store my_tools/._fastq_paired_reads_convention.xml my_tools/fastq_paired_reads_convention.pl my_tools/fastq_paired_reads_convention.xml
diffstat 5 files changed, 87 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
Binary file my_tools/.DS_Store has changed
Binary file my_tools/._.DS_Store has changed
Binary file my_tools/._fastq_paired_reads_convention.xml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/my_tools/fastq_paired_reads_convention.pl	Thu May 10 16:34:08 2012 -0400
@@ -0,0 +1,50 @@
+#! /usr/bin/perl -w
+
+use strict;
+use warnings;
+
+# fastq_paired_reads_convention2.pl [input file] [left output file] [right output file]
+
+die "Check arguments" unless @ARGV == 3;
+
+#open (LEFT, '>data/left2.fastq') or die "Cannot create $ARGV[1]: $!\n";
+#open (RIGHT, '>data/right2.fastq') or die "Cannot create $ARGV[2]: $!\n";
+#open (INPUT, '<data/interlaced.fastq') or die "Cannot open $ARGV[0]: $!\n";
+
+open (LEFT, '>', $ARGV[1]) or die "Cannot create $ARGV[1]: $!\n";
+open (RIGHT, '>', $ARGV[2]) or die "Cannot create $ARGV[2]: $!\n";
+open (INPUT, '<', $ARGV[0]) or die "Cannot open $ARGV[0]: $!\n";
+
+my $which = 0;
+my $current_id;
+
+while(<INPUT>) {
+	chomp;
+	if(/ 1\S*/){
+		$_ =~ s/ 1\S*//;
+		$_.='/1';
+		$current_id = substr $_, 1;
+		$which = 1;
+	}
+	if(/ 2\S*/){
+		$_ =~ s/ 2\S*//;
+		$_.='/2';
+		$current_id = substr $_, 1;
+		$which = 2;
+	}
+	
+	if($_ eq '+'){
+		$_.=$current_id;
+	}
+	
+	if($which == 1){
+		print LEFT "$_\n";
+	}
+	if($which == 2){
+		print RIGHT "$_\n";
+	}
+}
+
+close (LEFT);
+close (RIGHT);
+close (INPUT);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/my_tools/fastq_paired_reads_convention.xml	Thu May 10 16:34:08 2012 -0400
@@ -0,0 +1,37 @@
+<tool id="FASTQPairedReadsConvention" name="Convert paired reads format">
+	<description>to conventional (/1 and /2)</description>
+	<command interpreter="perl">fastq_paired_reads_convention.pl $input $left_out $right_out</command>
+	<inputs>
+		<param name="input" type="data" label="FASTQ file" format="fastqsanger, fastqcssanger"></param></inputs>
+	<outputs>
+		<data format="input" name="left_out"></data>
+		<data format="input" name="right_out"></data></outputs>
+	<help>
+	
+	**What it does**
+	
+	This tool takes a paired ends fastq file (with the first format below) and produces a left and right fastq file (with the second format below).
+	
+	-----
+	
+	**Example**
+	
+	Data like this::
+	
+    <![CDATA[
+	@M00325:2:000000000-A0DG1:1:1:15761:1554 1:N:0:1
+	NAACGCGCCCACACAGCTGTGGTTGGGGCGCCCGCTGATCGGTGATGGCGTTCACGGGGCGCCGGGGACCGGGCAGCCCGGTGGGGCCGGGGGGTTGTTGTGGGGTAATGGCGGTAACGGCGGTTCGTTGGCTGCCCGTCACTTCTGTGGG
+	+
+	#+14:A?DAD1<;EBD@C3C33:C0)))8'5::69=6';;;/58<>335'898(:0&&&0&070&&05085-55538<<-5>999-550--5&559>9<8<<(&&)&(+(((&&0&(+(&)&&&)(&((((((((+(&&((+++(((+((&
+    ]]>
+	
+	will produce an empty right file and a left file with one entry like this::
+	
+    <![CDATA[
+	@M00325:2:000000000-A0DG1:1:1:15761:1554/1
+	NAACGCGCCCACACAGCTGTGGTTGGGGCGCCCGCTGATCGGTGATGGCGTTCACGGGGCGCCGGGGACCGGGCAGCCCGGTGGGGCCGGGGGGTTGTTGTGGGGTAATGGCGGTAACGGCGGTTCGTTGGCTGCCCGTCACTTCTGTGGG
+	+M00325:2:000000000-A0DG1:1:1:15761:1554/1
+	#+14:A?DAD1<;EBD@C3C33:C0)))8'5::69=6';;;/58<>335'898(:0&&&0&070&&05085-55538<<-5>999-550--5&559>9<8<<(&&)&(+(((&&0&(+(&)&&&)(&((((((((+(&&((+++(((+((&
+    ]]>
+	
+	</help></tool>