title: Extracting information from a .gtf to a new text file using PERL
body: <p>I have the the below .gtf file, i need to extract only 4 variables (chromosome, start/stop codon and transcripst i.d.</p>
  
  <pre><code>1       Cufflinks       transcript      11869   14412   1000    +       .      gene_id "CUFF.1"; transcript_id "CUFF.1.2"; FPKM "0.3750000000"; frac "0.000000"; conf_lo "0.375000"; conf_hi "0.375000"; cov "1.470346"; full_read_support "yes";
  1       Cufflinks       transcript      11869   14412   444     +       .      gene_id "CUFF.1"; transcript_id "CUFF.1.3"; FPKM "0.1666666667"; frac "0.000000"; conf_lo "0.166667"; conf_hi "0.166667"; cov "0.653487"; full_read_support "yes";
  2       Cufflinks       transcript      11869   14412   333     +       .      gene_id "CUFF.1"; transcript_id "CUFF.1.4"; FPKM "0.1250000000"; frac "0.000000"; conf_lo "0.125000"; conf_hi "0.125000"; cov "0.490115"; full_read_support "yes";**
  </code></pre>
  
  <p>My questions is how does a script know to work on a selected file?</p>
  
  <p>Do you used:</p>
  
  <p>(1) <code>my $file = 'transcripts_selected.gtf'</code> </p>
  
  <p>(2) Also can this script be used to extract the sected data:</p>
  
  <pre><code>say $data-&gt;{"chromosome_number"}-&gt;{"start_codon"}-&gt;{"stop_codon"}-&gt;{"transcript_id"};
  </code></pre>
  
  <p>or should: </p>
  
  <p><code>BioSeq-&gt;new(-chromosome_number, -start_codon...)</code> method be used?</p>
  
  <p>(3) Finally this scripts is taken from the BioperlHOWTO:</p>
  
  <pre><code>my $seq_in = Bio::SeqIO-&gt;new( -file   =&gt; "&lt;$infile", -format =&gt; $infileformat,);
  my $seq_out = Bio::SeqIO-&gt;new( -file   =&gt; "&gt;$outfile", -format =&gt; $outfileformat,);
  while (my $inseq = $seq_in-&gt;next_seq) {$seq_out-&gt;write_seq($inseq);
  </code></pre>
  
  <ul>
  <li>where is says the variables $infile/$outfile should the name of the .gtf file be placed here and the name of the new file with selected data replace $outfile?</li>
  </ul>