title: Extracting ID and sequence from a FASTQ file
body: <p>I'm trying to manipulate a Fastq file.
  It looks like this:</p>
  
  <pre><code>@HWUSI-EAS610:1:1:3:1131#0/1
  GATGCTAAGCCCCTAAGGTCATAAGACTGNNANGTC
  +
  B&lt;ABA&lt;;B@=4A9@:6@96:1??9;&gt;##########
  @HWUSI-EAS610:1:1:3:888#0/1
  GATAGGACCAAACATCTAACATCTTCCCGNNGNTTC
  +
  B9&gt;&gt;ABA@B7BB:7?@####################
  @HWUSI-EAS610:1:1:4:941#0/1
  GCTTAGGAAGGAAGGAAGGAAGGGGTGTTCTGTAGT
  +
  BBBB:CB=@CB@?BA/@BA;6&gt;BBA8A6A&lt;?A4?B=
  ...
  ...
  ...
  @HWUSI-EAS610:1:1:7:1951#0/1
  TGATAGATAAGTGCCTACCTGCTTACGTTACTCTCC
  +
  BB=A6A9&gt;BBB9B;B:B?B@BA@AB@B:74:;8=&gt;7
  </code></pre>
  
  <p>My expected output is:</p>
  
  <pre><code>@HWUSI-EAS610:1:1:3:1131#0/1
  GACNTNNCAGTCTTATGACCTTAGGGGCTTAGCATC
  @HWUSI-EAS610:1:1:3:888#0/1
  GAANCNNCGGGAAGATGTTAGATGTTTGGTCCTATC
  @HWUSI-EAS610:1:1:4:941#0/1
  ACTACAGAACACCCCTTCCTTCCTTCCTTCCTAAGC
  </code></pre>
  
  <p>So, the ID line are those starting with @HWUSI (i.e @HWUSI-EAS610:1:1:7:1951#0/1).. After each ID there is a line with its sequence.
  Now, I would like to obtain a file only with each ID and its correspondig sequence and the sequence should be reverse and complement. (A=T, T=A, C=G, G=C)
  With Sed I can obtain all the sequence reverse and complementary with the command </p>
  
  <pre><code>sed -n '2~4p' MYFILE.fq | rev | tr ATCG TAGC
  </code></pre>
  
  <p>How can I obtain also the corresponding ID?</p>