[Bioperl-l] Bio::PopGen::IO

Jason Stajich jason at bioperl.org
Tue Jan 9 21:10:32 UTC 2007


you need to pass in an array ref when you create the population, note  
the missing '\'.
The CSV method also provides a method next_population which will go  
ahead and build a population object for you as well.

> my $pop = Bio::PopGen::Population->new(	
> -name => 'popname',
> -description => 'description',
> -individuals => \@population);

On Jan 9, 2007, at 11:38 AM, Marian Thieme wrote:

> Hi,
>
> I have a problem/missing knowledge about initialising/providing  
> markers
> in a population object
>
> Let me illustrating what I did:
>
> 1. importing csv file with sample and marker information for some
> individuals. (including header info):
>
> my $io = new Bio::PopGen::IO (	-format => 'csv',
> 				-allele_delimiter => ' ',
> 				-field_delimiter => '',
> 				-file => 'test.csv')
>
>
> 2.)pushing all individuals to an array
>
> my @population;
> while( my $ind = $io->next_individual ) {
> 	push @population, $ind;
> }
>
> 3.) I convinced myself that this has worked, because I was able to  
> ouput
> alleles, individual_id and marker_name.
>
>
> 4.) Did create a population object with that individuals:
>
> my $pop = Bio::PopGen::Population->new(	
> -name => 'popname',
> -description => 'description',
> -individuals => @population);
>
> 5.) But when I try to access the markers via:
>
> for my $name ( $pop->get_marker_names ) {
> 	my $marker = $pop->get_Marker();
> 	print $marker;
> }
>
> nothing appears on the screen, becuase the function get_marker_names
> obviously doesnt fetch some values, in my case.
>
> Question: Do I need to provide the marker information seperatly ?
>
> Regards,
> Marian
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

--
Jason Stajich
Miller Research Fellow
University of California, Berkeley
lab: 510.642.8441
http://pmb.berkeley.edu/~taylor/people/js.html





More information about the Bioperl-l mailing list