On 5/11/2012, at 10:35 AM, Marcelo Laia <marcelolaia / gmail.com> wrote:

It's telling you what the problem is.

> # search for xac + hypothetical
> xac =3D serv.bfind("T00084 hypothetical")
> # get the IDS into an array
> ids =3D xac.map { |gene| $1 if gene =3D~/^(.*?)\s+/ }
> # retrieve fasta and print
> ids.each { |id| puts serv.bget("-f -n 1 #{id}") }
> -----CODE END HERE--------
>=20

> /home/marcelo/bin/scripts/get_fasta4:10:in `<main>': undefined method
> `map' for #<String:0x87a9f38> (NoMethodError)


xac is a String which doesn't have a method 'map'. 'map' expects an =
Array. You can either force xac to be an Array=85

ids =3D Array(xac).map { |gene| $1 if gene =3D~/^(.*?)\s+/ }

or fix the previous line to return an array.

Henry