in reply to Re^2: Size of sequences in fastafile
in thread Size of sequences in fastafile
It's still not very clear precisely what you expect but here's my final stab at this.
use strict; use warnings; use Test::More tests => 1; # Present this SSCCE as a test my @seq; # Sequences longer than $min are stored here my @want = ( 'GGAGGTCTTTAGCTTTAGGGAAACCC', ); # These are the sequeneces we expect for the given data set my $min = 15; # Minimum length of any sequence to be considered my $this = ''; while (<DATA>) { chomp; if (/^>/) { push @seq, $this if $min <= length $this; $this = ''; } else { $this .= $_; } } push @seq, $this if $min <= length $this; is_deeply \@seq, \@want; # Check that our algorithm has worked __DATA__ >NM_001 Homo sapiens ADA2 (CECR1) GATCCAA >NM_002 Homo sapiens IKBKG GGAGGTCTTTAGCTTTAGGGAAACCC
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Size of sequences in fastafile
by Sofie (Acolyte) on Mar 01, 2020 at 12:03 UTC | |
by zubenel0 (Sexton) on Mar 01, 2020 at 12:39 UTC | |
|
Re^4: Size of sequences in fastafile
by Sofie (Acolyte) on Mar 01, 2020 at 11:03 UTC |