Mercurial > repos > charles_s_test > seqsero2
view 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 source
#!/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" ); }