diff libs/sratoolkit.2.8.0-centos_linux64/example/perl/simplefastq.pl @ 3:38ad1130d077 draft

planemo upload commit a4fb57231f274270afbfebd47f67df05babffa4a-dirty
author charles_s_test
date Mon, 27 Nov 2017 11:21:07 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libs/sratoolkit.2.8.0-centos_linux64/example/perl/simplefastq.pl	Mon Nov 27 11:21:07 2017 -0500
@@ -0,0 +1,35 @@
+#!/usr/bin/perl -w
+
+use IO::File;
+
+#
+# this script has to be fed from vdb-dump
+# it takes input on STDIN
+# the input has to be a stream of lines
+# each line containing "SPOT_ID,NAME,SPOT_LEN,READ,QUALITY" delimited by tab
+#
+# example:
+#
+# vdb-dump SRR000001 -C "SPOT_ID,NAME,SPOT_LEN,READ,(INSDC:quality:text:phred_33)QUALITY" -f tab | simplefastq.pl SRR000001 > SRR000001.fastq
+#
+
+my $line;
+my $base =  $ARGV[ 0 ];
+
+if ( !defined ( $base ) )
+{
+    $base = "out";
+}
+
+while ( defined ( $line = <STDIN> ) )
+{
+    #remove line-feeds, white space etc.
+    chomp( $line );
+    @tokens = split( /\s/, $line );
+
+    print( '@' );
+    print( "$base.$tokens[0] $tokens[1] length=$tokens[2]\n" );
+    print( "$tokens[3]\n" );
+    print( "+$base.$tokens[0] $tokens[1] length=$tokens[2]\n" );
+    print( "$tokens[4]\n" );
+}
\ No newline at end of file