[Bioperl-l] reference array containing Bio::seq objects

Xu, Lizhe - APHIS Lizhe.Xu at aphis.usda.gov
Mon Jan 9 14:40:21 UTC 2012


I created a reference array which contains 26  Bio::seq objects:

push(@primer, \Bio::Seq->new(-seq => $primerSeq,
                         -display_id => $primerName,
                          -desc => chop($primerName),
                         -alphabet => 'dna' ))
};

I checked the contents of @primer by ${$primer[$index]}-> and get the primer sequence, id and desc for these 26 primers. However, there are two things bother me and I want to learn why I get this kind of results:

(1)    length (@primer) gives me 2, instead of 26.

(2)    the last char of $primerName is "F" or "R" , which gives the direction of the primer. ${$primer[$index]}->desc  gives the direction info correctly. However, ${$primer[$index]}->id gives the primer name without the last char of the direction info. I thought the $primerName is first assigned to -display_id before chop() action and it should contains the whole name with the last char of direction. Certainly I'm wrong, but I'd like to know why so I can avoid the similar error later.
Thank you very much.

Lizhe





More information about the Bioperl-l mailing list