Fwd: Re: [Bioperl-l] haplotype

Pedro pedro.fabre at gen.gu.se
Wed Nov 5 07:14:41 EST 2003


I forgot cc to the bioperl-list.

Here is the code example.

Cheers
Pedro

>Date: Wed, 5 Nov 2003 12:09:27 +0000
>To: Ewan Birney <birney at ebi.ac.uk>
>From: Pedro <pedro.fabre at gen.gu.se>
>Subject: Re: [Bioperl-l] haplotype
>Cc:
>Bcc:
>X-Attachments:
>
>Hi Ewan,
>
>Thanks for your email.
>>On Wed, 5 Nov 2003, Pedro wrote:
>>
>>>  Dear developers,
>>>
>>>  I have done some work on SNP haplotypes. I have created two modules
>>>  one to find the ht_SNP set and another one to tag the minimal set of
>>>  an haplotype.
>>>
>>>  I would like to contibute to bioperl these two modules.
>>>
>>>  The modules could be under:
>>>
>>>       Bio::Haplotype::Select
>>>       Bio::Haplotype::Tag
>>>
>>>  I also have stand alone examples about how the code is working and
>>>  about what to input and what you get from the module.
>>>
>>
>>It would be great if you could show a little synopsis of how a client
>>would use objects
>
>
>Select.pm
>my $hap = Select->new($hap,$snp,$pop);
>
>methods:
>
>$hap->input_block;   # returns the input block
>$hap->snp_ids;       # returns the snp_ids set
>$hap->pop_freq;      # returns the population id and their frequency
>
>$hap->deg-snp;       # list of degenerated snps
>$hap->snp_type;      # all snp and their types
>$hap->no_snp;        # false snps
>$hap->useful_snp;    # list of snps that can be used for the analysis
>$hap->ht_type;       # selection of snps which create not redundante set
>$hap->ht_set;        # minimal set of SNP to tag
>$hap->snp_type_code  # every snp is converted to a numeric code.
>                      # this is the result.
>
>Tag.pm
>
>my $tag = Tag -> new($hap);
>
>methods:
>
>$tag->input_block;   # input block
>$tag->tag_list;      # returns list of SNP's combination.
>$tag->tag_length;    # return the minimal number of SNPs you have to tag
>                      # to define the block
>
>
>
>Here come the examples
>
>############## Call to Select.pm ##########################
>
>#!/usr/local/bin/perl
>
>use warnings;
>use strict;
>use Select;
>use Util;
>use Data::Dumper;
>
>my $hap = [
>      'acgt?cact', 
>      'acgt?ca-t', 
>      'cg?tag?gc', 
>      'cactcgtgc', 
>      'cgctcgtgc', 
>      'cggtag?gc', 
>      'ac?t?cact' 
>      ];
>
>my $snp = [qw/s1 s2 s3 s4 s5 s6 s7 s8 s9/];
>
>my $pop = [
>      [qw/ uno    1/],
>      [qw/ dos    2/],
>      [qw/ tres   3/],
>      [qw/ cuatro 4/],
>      [qw/ cinco  5/],
>      [qw/ seis   6/],
>      [qw/ siete  7/]
>        ];
>
># create the object
>my $obj = Select->new($hap,$snp,$pop);
>
>print Dumper $obj;
>
>
>#print input block
>print "this is the input block (Haplotype) [input_block]\n";
>foreach (@{$obj->input_block}){
>     print "$_\n";
>}
>
>print "\n",'[snp_id] return the SNP IDs list',"\n";
>print "@{$obj->snp_ids}\n";
>
>print "\n",'[pop_freq] return the population frequency',"\n";
>
>
>############## result for this set ##########################
>
>this is the input block (Haplotype) [input_block]
>acgt?cact
>acgt?ca-t
>cg?tag?gc
>cactcgtgc
>cgctcgtgc
>cggtag?gc
>ac?t?cact
>
>[snp_id] return the SNP IDs list
>s1 s2 s3 s4 s5 s6 s7 s8 s9
>
>[pop_freq] return the population frequency
>uno     1      
>dos     2      
>tres    3      
>cuatro  4      
>cinco   5      
>seis    6      
>siete   7      
>
>[deg_snp] if there is any degenerate SNP must be here
>s7 s5 s3
>
>[ht_set] working haplotype
>0       0       0      
>1       1       1      
>0       0       2      
>1       2       1      
>
>[ht_type] return the list of the snp type used
>30 57 48
>
>[useful_snp]
>s1 s2 s6 s8 s9
>
>[snp_type_code]
>30 57 30 48 30
>
>[ht_type]
>30 57 48
>#################################################################
>
>once you have the set this is the second example
>
>####################### taggin module ###########################
>
>#!/usr/local/bin/perl
>
>use warnings;
>use strict;
>use Tag;
>use Util;
>use Data::Dumper;
>
>my $hap = [
>              [qw/0       0       0/],
>              [qw/1       1       1/],
>              [qw/0       0       2/],
>              [qw/1       2       1/]
>           ];
>
>my $obj = Tag -> new($hap);
>
>my $input      = $obj->input_block;
>my $tag_list   = $obj->tag_list;
>my $tag_length = $obj->tag_length;
>
>print "This was the input\n";
>foreach (@$input){
>     print "@$_\n";
>}
>
>print "This is the tag list. You will need to tag the snp's on the 
>list (start from 0)\n";
>foreach (@$tag_list){
>     print "@$_\n";
>}
>
>print "This is the tag length\n";
>
>print "$tag_length\n";
>
>###################### this is the result for this set #################
>This was the input
>0 0 0
>1 1 1
>0 0 2
>1 2 1
>This is the tag list. You will need to tag the snp's on the list 
>(start from 0)
>1 2
>This is the tag length
>2
>
>########################################################################
>
>Do you think this information if enough?
>
>I know that the biological implication of multiallelic variance is 
>rare but I have taken that into account.
>
>
>
>>  > I would like also to know if there is any perl style to follow. Any
>>>  documentation about that?
>>
>>In bioperl release there is biodesign.pod which gives you some hints.
>
>Thanks for the reference.
>
>>  >
>>>  If you think this can be insteresting for bioperl, please let me know.
>>>
>>
>>I am sure this would be and I would be happy to help you do conversion
>>into bioperl style...
>
>Thanks once again.
>
>Pedro
>
>>
>>
>>>  Cheers
>>>  Pedro
>>>
>>>
>>>  _______________________________________________
>>>  Bioperl-l mailing list
>>>  Bioperl-l at portal.open-bio.org
>>>  http://portal.open-bio.org/mailman/listinfo/bioperl-l
>>>
>>
>>-----------------------------------------------------------------
>>Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
>><birney at ebi.ac.uk>.
>>-----------------------------------------------------------------



More information about the Bioperl-l mailing list