Last active
August 29, 2015 14:11
-
-
Save sestaton/651a34ae8dbb4d4c945c to your computer and use it in GitHub Desktop.
biostars123787.pl - print numeric Fasta records
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 5.010; | |
use strict; | |
use warnings; | |
use Bio::SeqIO; | |
use List::MoreUtils qw(any); | |
my @ids = (1, 5, 10); | |
my $num = 0; | |
my $seqio = Bio::SeqIO->new(-fh => \*STDIN); | |
while (my $seq = $seqio->next_seq) { | |
$num++; | |
say join "\n", ">".$seq->id, $seq->seq | |
if any { $_ == $num } @ids; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment