Skip to content

Instantly share code, notes, and snippets.

@cjfields
Created May 17, 2010 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjfields/404061 to your computer and use it in GitHub Desktop.
Save cjfields/404061 to your computer and use it in GitHub Desktop.
# this is mainly GFF3-specific, GFF2/GTF to be added
my ($io, $f, $s, $fcount, $scount);
################################################################################
#
# use FeatureIO::gff to read a FASTA file.
#
$fcount = 0;
$scount = 0;
ok( $io = Bio::FeatureIO->new( -file => test_input_file('dna1.fa') ) );
#read features
while($f = $io->next_feature()){
warn $f;
$fcount++;
}
is($fcount, 0);
#then try to read sequences again. should get seqs now
while($s = $io->next_seq()){
$scount++;
TODO: {
local $TODO = 'How did this ever work?!?';
if ($scount == 1) {
is($s->seq, 'Test1');
}
}
}
is($scount, 1);
__END__
Result:
not ok 4 # TODO How did this ever work?!?
# Failed (TODO) test at t/SeqFeature/FeatureIO.t line 43.
# got: 'TTCTGAACTGGTTACCTGCCGTGAGTAAATTAAAATTTTATTGACTTAGGTCACTAAATACTTTAACCAATATAGGCATAGCGCACAGACAGATAAAAATTACAGAGTACACAACATCCATGAAACGCATTAGCACCACC'
# expected: 'Test1'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment