=head1 LICENSE Copyright (c) 2007-2009 Illumina, Inc. This software is covered by the "Illumina Genome Analyzer Software License Agreement" and the "Illumina Source Code License Agreement", and certain third party copyright/licenses, and any user of this source file is bound by the terms therein (see accompanying files Illumina_Genome_Analyzer_Software_License_Agreement.pdf and Illumina_Source_Code_License_Agreement.pdf and third party copyright/license notices). This file is part of the Consensus Assessment of Sequence And VAriation (CASAVA) software package. =head1 NAME Casava::SampleSheet - Utility library for the management of sample sheets. =head1 SYNOPSIS use Casava::Demultiplex::SampleSheet; $sampleSheet = Casava::SampleSheet->new() $sampleSheet->loadCsv("SampleSheet.csv") or die "Couldn't load SampleSheet.csv"); $recipe = $sampleSheet->recipe($lane, $barcode); $operator = $sampleSheet->operator($lane, $barcode); foreach $lane ($sampleSheet->laneNumbers) { foreach $barcode ($sampleSheet->barcodes($lane)) { $sample = $sampleSheet->sample($lane, $barcode); $species = $sampleSheet->species($lane, $barcode); $description = $sampleSheet->description($lane, $barcode); $control = $sampleSheet->control($lane, $barcode); } } =head1 DESCRIPTION The sample sheet is used to describe the list of samples, and their associated barcodes, available in each lane of a multiplexed run. The default format for the sample sheet is a csv file, with the following columns: Flow Cell Id Lane Id Sample Id Species Barcode Description Control Recipe Operator The following optional column is added for the directory mapping after demultiplexing: Directory It is assumed that there is only one flowcell id for the whole sample sheet. Each lane can have several barcodes. Each line in the sample sheed is uniquely identified by the couple (lane id, barcode). There are no constraints on the other columns of the file. =head1 SUBROUTINES =cut # POD for for each subroutines is right before the implementation # More POD after __END__ package Casava::Demultiplex::SampleSheet::Make; use base 'Casava::Demultiplex::SampleSheet'; use strict; use warnings "all"; use Exporter 'import'; use Carp; our $SIGNATURE = 'CASAVA-1.8.2'; =pod =head2 save Dump sample sheet as Makefile data. I =over 4 =item * $handle open handle to the actual data =back I Nothing I =over 4 =item * Incorrect number of columns =back =cut sub save($$) { my $self = shift; my $handle = shift; print $handle "# This file was automatically generated by $SIGNATURE.\n# Please do not edit.\n\n"; foreach my $lane (sort $self->laneNumbers) { my @barcodes = $self->barcodes($lane); if (scalar @barcodes) { print $handle "l${lane}_BARCODES:=".join(' ',@barcodes)."\n"; print $handle "l${lane}_SAMPLEIDS:=". join(' ',map {length($_) ? $_ : "''"} map {$self->sampleId($lane, $_)} @barcodes)."\n"; print $handle "l${lane}_SUBDIRS:=". join(' ',map {defined $_ ? $_ : "''"} map {$self->projectSampleDirName($lane, $_)} @barcodes)."\n"; } } return $self; } 1; __END__ =pod =head1 DEPENDENCIES =over 4 =item Standard perl modules strict, warnings, Exporter, Carp, Text::ParseWords =item External perl modules XML::Simple =item Casava perl modules None =head1 BUGS AND LIMITATIONS There are no known bugs in this module. All documented features are fully implemented. Please report problems to Illumina Technical Support (support@illumina.com) Patches are welcome. =head1 AUTHOR Come Raczy =cut