prbndr has asked for the wisdom of the Perl Monks concerning the following question:
hi monks,
another rookie perl question... i have an array that i populate with the following code:
push @positions, $read->end + 1, $base;the first entry ($read->end + 1) is a number and the second entry is a string that can be an A,G,C, or T, so each line of this array is a number/string pair.
i would like to remove every line of this array that contains a G or a T as the string. after doing that, i would like to get rid of the strings altogether, so i just have an array with one column representing the number. how do i go about this?
i've looked into the pop function, which seems relevant for the second half of what i want to do, but i am unsure about how to do the filtering, namely accessing the second element in each line of the array. any advice would be much appreciated!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: filtering an array
by ww (Archbishop) on Sep 02, 2012 at 01:50 UTC | |
by prbndr (Acolyte) on Sep 02, 2012 at 03:12 UTC | |
Re: filtering an array
by philiprbrenan (Monk) on Sep 01, 2012 at 19:41 UTC | |
by philiprbrenan (Monk) on Sep 01, 2012 at 20:15 UTC | |
by prbndr (Acolyte) on Sep 01, 2012 at 19:50 UTC | |
Re: filtering an array
by jwkrahn (Abbot) on Sep 01, 2012 at 20:18 UTC | |
by prbndr (Acolyte) on Sep 01, 2012 at 22:30 UTC | |
by philiprbrenan (Monk) on Sep 01, 2012 at 22:41 UTC | |
by prbndr (Acolyte) on Sep 01, 2012 at 22:48 UTC | |
by philiprbrenan (Monk) on Sep 01, 2012 at 23:03 UTC | |
| |
by philiprbrenan (Monk) on Sep 01, 2012 at 22:59 UTC | |
| |
Re: filtering an array
by swampyankee (Parson) on Sep 02, 2012 at 01:35 UTC | |
Re: filtering an array
by vagabonding electron (Curate) on Sep 02, 2012 at 14:55 UTC |