[Bioperl-l] MicroarrayIO proposal

Chervitz, Steve Steve_Chervitz@affymetrix.com
Fri, 11 Oct 2002 17:57:35 -0700


Allen,

Looks like a good start. Here are some comments.

* IO classes typically indicate the format of the file. In this case,
"affymetrix" is ambiguous since Affy produces more than one file type (e.g.,
cdf, chp, cel, etc.) If you want, you could organize the modules within a
subdir such as MicroarrayIO/affymetrix/cdf.pm, but this is probably not
necessary.

* ProbeI should extend PrimarySeqI (unless you're using containment).
Inheritance seems right to me though. (This may be an example of where
you'll have a sequence object without sequence data.) What does
$probe->value return?

* ProbeI appears twice, in Bio::Expression and Bio::Expression::Microarray.
Or maybe, one is a subclass of the other? If so, I'd give it a different
name, e.g., MicroarrayProbeI.pm. 

* Presumably, Affymetrix::Array ISA Bio::Expression::MicroarrayI. I think
it's a good idea to make this relationship more obvious in the module name,
e.g., Affymetrix::AffyMicroarray. Similarly for Affymetrix::AffyData and
Affymetrix::AffyProbe. It may seem redundant, but it helps.

Steve

> -----Original Message-----
> From: Allen Day [mailto:allenday@ucla.edu] 
> Sent: Friday, October 11, 2002 5:05 PM
> To: Bioperl
> Subject: [Bioperl-l] MicroarrayIO proposal
> 
> 
> Hi all,
> 
> I'm getting ready to commit some MicroarrayIO classes to 
> bioperl-live, but 
> first I'd like to get some feedback on how I've set them up.  
> See below:
> 
> Hierarchy is like this:
> 
> Bio/
> 	Expression/
> 		Microarray/
> 			ProbeI.pm
> 			Probeset.pm
> 			Affymetrix/
> 				Array.pm
> 				Data.pm
> 				Probe.pm
> 		MicroarrayI.pm
> 		MicroarrayIO.pm
> 		MicroarrayIO/
> 			affymetrix.pm
> 		ProbeI.pm
> 
> 
> 
> 
> And usage is like this:
> 
> use Bio::Expression::MicroarrayIO;
> 
> # create an IO object.  an array object is created
> # based on -template
> my $mio = Bio::Expression::MicroarrayIO->new(
>              -file     => 'path/to/datafile',
>              -format   => 'affymetrix',
>              -template => 'path/to/template',
>           );
> 
> # fill the array object created by the constructor
> # with data from the next array.  returns a
> # Bio::Expression::MicroarrayI compliant object
> my $array = $mio->next_array;
> 
> # this will write affy-format files, given
> # a MicroarrayI compliant object
> my $out = Bio::Expression::MicroarrayIO->new(
>              -file     => '>path/to/outputfile',
>              -format   => 'affymetrix',
>           );
> 
> #write $array to file
> $out->write_array($array);
> 
> #print a list of outliers and masked probes
> foreach my $probeset ($array->each_probeset){
> 	foreach my $probe ($probeset->each_probe){
> 		next unless $probe->is_outlier or $probe->is_masked;
> 		print join "\t", (
> 			$probeset->id,
> 			$probe->x,
> 			$probe->y,
> 			$probe->value,
> 			$probe->is_outlier,
> 			$probe->is_masked,
> 			"\n";
> 		)
> 	}
> }
> 
> 
> Comments appreciated.  Enjoy the weekend.
> 
> -Allen
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org http://bioperl.org/mailman/listinfo/bioperl-l
>