comparison 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
comparison
equal deleted inserted replaced
2:0d65b71ff8df 3:38ad1130d077
1 #!/usr/bin/perl -w
2
3 use IO::File;
4
5 #
6 # this script has to be fed from vdb-dump
7 # it takes input on STDIN
8 # the input has to be a stream of lines
9 # each line containing "SPOT_ID,NAME,SPOT_LEN,READ,QUALITY" delimited by tab
10 #
11 # example:
12 #
13 # vdb-dump SRR000001 -C "SPOT_ID,NAME,SPOT_LEN,READ,(INSDC:quality:text:phred_33)QUALITY" -f tab | simplefastq.pl SRR000001 > SRR000001.fastq
14 #
15
16 my $line;
17 my $base = $ARGV[ 0 ];
18
19 if ( !defined ( $base ) )
20 {
21 $base = "out";
22 }
23
24 while ( defined ( $line = <STDIN> ) )
25 {
26 #remove line-feeds, white space etc.
27 chomp( $line );
28 @tokens = split( /\s/, $line );
29
30 print( '@' );
31 print( "$base.$tokens[0] $tokens[1] length=$tokens[2]\n" );
32 print( "$tokens[3]\n" );
33 print( "+$base.$tokens[0] $tokens[1] length=$tokens[2]\n" );
34 print( "$tokens[4]\n" );
35 }