Created
November 6, 2013 15:19
-
-
Save standage/7337762 to your computer and use it in GitHub Desktop.
Given a Fasta file, print out GFF3-compatible '##sequence-region' pragmas. Often when GFF3 files are produced, the sequence-region pragmas indicate the coordinates directly bounding and sequence annotations rather than the entire sequence length. In some cases, having the entire sequence length is useful, and this script facilitates this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use strict; | |
| use Bio::SeqIO; | |
| my $instream = Bio::SeqIO->new( -fh => \*STDIN, -format => "Fasta" ); | |
| while(my $seq = $instream->next_seq) | |
| { | |
| printf("##sequence-region %s %lu %lu\n", $seq->id, 1, $seq->length); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment