[Perl] FASTAQ To FASTA Converter

14 May 2013 | Research, SLab, Today`s Script

Codes to convert FASTAQ to FASTA format in Perl programming language

#/usr/bin/perl -w
use strict;


my $file;
my $fileOutput;
my $write=0;


$file = $ARGV[0];
$fileOutput = $ARGV[1];
open (IN, $file) or die “file can not open -$!”;
open OUTPUT, “>$fileOutput”;



while (my $line = )
{
    if($line =~ m/^\@/) {
      print OUTPUT ""
      .">". substr($line,1);
      $write=1;
    } elsif ($write){
      print OUTPUT ""
      .$line. "\n";
      $write=0;
    }
}


Leave a Reply