<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.anunna.wur.nl/index.php?action=history&amp;feed=atom&amp;title=Convert_fastq_to_fasta</id>
	<title>Convert fastq to fasta - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.anunna.wur.nl/index.php?action=history&amp;feed=atom&amp;title=Convert_fastq_to_fasta"/>
	<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Convert_fastq_to_fasta&amp;action=history"/>
	<updated>2026-04-18T10:11:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Convert_fastq_to_fasta&amp;diff=3&amp;oldid=prev</id>
		<title>Hjmegens: Created page with &quot;Converting fasq to fasta can sometimes be useful. Here a simple perl script is described that can do this. The script works on a stream, and will output to STDOUT. Optional is fi...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Convert_fastq_to_fasta&amp;diff=3&amp;oldid=prev"/>
		<updated>2011-11-24T15:46:57Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Converting fasq to fasta can sometimes be useful. Here a simple perl script is described that can do this. The script works on a stream, and will output to STDOUT. Optional is fi...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Converting fasq to fasta can sometimes be useful. Here a simple perl script is described that can do this. The script works on a stream, and will output to STDOUT. Optional is filtering for reads that have a certain minimum length&lt;br /&gt;
&lt;br /&gt;
Example for invoking the script, assuming the script is named fastq_to_fasta.pl:&lt;br /&gt;
&amp;lt;source lang=&amp;#039;bash&amp;#039;&amp;gt;&lt;br /&gt;
gunzip -c fastqfile.fq.gz | perl fastq_to_fasta.pl -l 50 | gzip -c &amp;gt;fastafile.fa.gz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is the perl script itself:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;#039;perl&amp;#039;&amp;gt;&lt;br /&gt;
 #!/usr/bin/perl -w&lt;br /&gt;
 use strict;&lt;br /&gt;
 use warnings;&lt;br /&gt;
 use Getopt::Std;&lt;br /&gt;
 my %opts = ();&lt;br /&gt;
 $opts{l}=60;&lt;br /&gt;
 getopt(&amp;#039;l&amp;#039;, \%opts);&lt;br /&gt;
 my $minlength = $opts{l};&lt;br /&gt;
 my $count=0;&lt;br /&gt;
 my $name=&amp;#039;nn&amp;#039;;&lt;br /&gt;
 while (&amp;lt;&amp;gt;){&lt;br /&gt;
        my $line = $_;&lt;br /&gt;
        chomp $line;&lt;br /&gt;
        ++$count;&lt;br /&gt;
        if ($count==1){&lt;br /&gt;
                $name = $line;&lt;br /&gt;
                $name =~ s/^@/&amp;gt;/;&lt;br /&gt;
        }&lt;br /&gt;
        if ($count==2){&lt;br /&gt;
                if (length $line &amp;gt; 60){&lt;br /&gt;
                        print &amp;quot;$name\n$line\n&amp;quot;;&lt;br /&gt;
                }&lt;br /&gt;
        }&lt;br /&gt;
        if ($count==4){&lt;br /&gt;
                $count=0;&lt;br /&gt;
        }&lt;br /&gt;
 }&lt;br /&gt;
 exit;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hjmegens</name></author>
	</entry>
</feed>