Changeset 3


Ignore:
Timestamp:
Apr 7, 2010, 4:54:33 PM (10 years ago)
Author:
maarten
Message:
 
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • /

    • Property svn:ignore set to
      output

      .project
  • lib/ProccesAllicVariants.pm

    r2 r3  
    1010        $self->{Omim2Pubmed} = "";
    1111
    12         bless($self);                # but see below
     12        bless($self);    # but see below
    1313        return $self;
    1414}
     
    4141
    4242                $result = $1;
    43                 print($result);
    44         }
    45         print("emn.$aapos\n");
     43
     44                #print($result);
     45        }
     46
    4647        return ($result);
    4748}
     
    7677
    7778                        #codon 163 was changed from GTG (val) to CTG (leu)
     79                        #find 1110A-C transversion with wrong number (!= AA*3)
     80                        #ACTA1 .0009
     81                }
     82                elsif ( $desc =~ /([0-9]{1,5}[ACTG]-[ACTG] trans[a-z]{4,9})/i ) {
     83                        $result = $1;
     84                        $result = $1;
     85
     86                        #print($result);
     87                }
     88                elsif ( $desc =~ /([ACTG]{3} to [ACTG]{3})/ ) {
     89                        $result = $1;
    7890                }
    7991
     
    8496sub getAuthor {
    8597
    86         my $desc = shift;
    87 
     98        my $desc   = shift;
     99        my $authAV = "";
     100        my $yearAV = "";
    88101        $desc =~ tr/\n/ /;
    89         $desc =~ /([\w-]*.)\set al.\s*?\((\d{4})\)/;
    90         my $authAV = $1;
    91         my $yearAV = $2;
    92 
    93         #TODO :add regexp for authors with  "And" between names
     102        if ( $desc =~ /([\w-]*.)\set al.\s*?\(([\d\s,]{4,14})\)/ ) {
     103                $authAV = $1;
     104                $yearAV = $2;
     105        }
     106
     107        # add regexp for authors with  "And" between names
     108        if ( length($authAV) == 0 ) {
     109                if ( $desc =~ /([\w-]*.\sand\s[\w-]*.)\s*.\(([\d]{4})\)/ ) {
     110                        $authAV = $1;
     111                        $yearAV = $2;
     112                }
     113        }
    94114
    95115        #TODO: add solution for mulitple authors (author 2009; auth3 2002 ,etc )
     116
     117        #See Brennan (1985)
     118        if ( length($authAV) == 0 ) {
     119                if ( $desc =~ /See ([\w-]*.)\s*.\(([\d]{4})\)/i ) {
     120                        $authAV = $1;
     121                        $yearAV = $2;
     122                }
     123        }
     124
    96125        if ( !defined($authAV) || length($authAV) < 2 ) {
    97126                carp( "No Author found in getAuthor found in :\n\n" . $desc . "\n\n" );
    98127        }
     128
    99129        if ( !defined($yearAV) || length($yearAV) < 2 ) {
    100130                carp( "No year in getAuthor found in :\n\n" . $desc . "\n\n" );
    101131        }
    102132
     133        #Tiller et al. (1993, 1995) demonstrated that cartilage f
     134        if ( length($yearAV) != 4 ) {
     135                if ( $yearAV =~ /([\d]{4})$/ ) {
     136                        $yearAV = $1;
     137                }
     138        }
     139
    103140        return ( $authAV, $yearAV );
    104141}
     
    107144
    108145        my ( $self, $refsref, $authAV, $yearAV, $numb ) = @_;
    109 
    110         my $result  = "";
    111         my @refs    = @$refsref;
    112         my $counter = 0;
    113         foreach my $ref (@refs) {
    114                 $counter = $counter + 1;
    115                 my $auth = $ref->authors();
    116 
    117                 if ( $auth =~ m/^$authAV/ ) {
    118                         my $authY = $ref->location();
    119                         if ( $authY =~ m/$yearAV/ ) {
    120 
    121                                 $result .= $self->{Omim2Pubmed}->getpubmed( $numb, $counter );
     146        my $result = "";
     147        if ( length($authAV) != 0 ) {
     148
     149                my @refs    = @$refsref;
     150                my $counter = 0;
     151                foreach my $ref (@refs) {
     152                        $counter = $counter + 1;
     153                        my $auth = $ref->authors();
     154
     155                        if ( $auth =~ m/^$authAV/ ) {
     156                                my $authY = $ref->location();
     157                                if ( $authY =~ m/$yearAV/ ) {
     158
     159                                        $result .=
     160                                          $self->{Omim2Pubmed}->getpubmed( $numb, $counter );
     161                                }
    122162                        }
    123163                }
  • omimparser.pl

    r2 r3  
    11
    22
    3 use lib "/home/maarten/programs/BioPerl-1.6.1-patched";
     3use lib "../Bioperl-patch";
    44
    55use Bio::Phenotype::OMIM::OMIMparser;
     
    144144      # - additional_mutations (used for e.g. "1-BP DEL, 911T")
    145145
    146     my @cps        = $omim_entry->each_CytoPosition();         # from genemap
     146    #my @cps        = $omim_entry->each_CytoPosition();         # from genemap
    147147      # Array of Bio::Map::CytoPosition objects.
    148148
    149     my @gss        = $omim_entry->each_gene_symbol();          # from genemap
     149    #my @gss        = $omim_entry->each_gene_symbol();          # from genemap
    150150      # Array of strings.
    151151
  • test/test.pl

    r2 r3  
    22use warnings;
    33
    4 use lib "/home/maarten/programs/BioPerl-1.6.1-patched";
     4use lib "../../Bioperl-patch";
    55use lib "../lib";
    66
     
    99use Omim2Pubmed;
    1010use Bio::Phenotype::OMIM::OMIMparser;
    11 use Test::More tests => 11;
     11use Test::More tests => 18;
    1212
    1313#lib "../lib";
     
    2929is( ProccesAllicVariants::getDeceaseID($string), "161800", "get decease id" );
    3030
     31@getauthor = ProccesAllicVariants::getAuthor(
     32        "Tiller et al. (1993, 1995) demonstrated that cartilage f");
     33is( $getauthor[0], "Tiller", "get author" );
     34is( $getauthor[1], "1995",   "get author year" );
     35
     36@getauthor = ProccesAllicVariants::getAuthor(
     37        "See Brennan (1985).");
     38is( $getauthor[0], "Brennan", "get author" );
     39is( $getauthor[1], "1985",   "get author year" );
     40
     41
     42@getauthor = ProccesAllicVariants::getAuthor(
     43        "Brennan and Fellowes (1993) that cartilage f");
     44        is( $getauthor[0], "Brennan and Fellowes", "get author" );
     45is( $getauthor[1], "1993",   "get author year" );
     46       
    3147$string =
    3248  "In patient 2 with a congenital actin myopathy (see 161800), reported by
     
    7591        "get mutation 222G-T transversion"
    7692);
     93
    7794is(
    7895        ProccesAllicVariants::extractnuclitdemutation(
     
    89106);
    90107
     108#acta .00010
     109$string = "In 5 affected members spanning 3 generations of a Chinese family with
     110autosomal dominant congenital myopathy with cores, part of the
     111phenotypic spectrum of nemaline myopathy 3 (161800), Kaindl et al.
     112(2004) identified a 1110A-C transversion in the ACTA1 gene, resulting in
     113a glu334-to-ala (E334A) substitution. Two members of the family
     114developed adult-onset hypertrophic cardiomyopathy and respiratory
     115insufficiency.";
     116
     117$string =~ tr/\n/ /;
     118
     119is(
     120        ProccesAllicVariants::extractnuclitdemutation( $string, "334" ),
     121        "1110A-C transversion",
     122        "get 1110A-C transversion"
     123);
     124
     125#120140 .0002
     126$string =
     127"In a case of type II achondrogenesis-hypochondrogenesis (200610), Vissing et al. (1989) demonstrated heterozygosity for a single base change that converted glycine-943 to serine; the codon change was GGC to AGC.";
     128
     129#is( ProccesAllicVariants::extractnuclitdemutation( $string, "2" ),
     130#       "GGC to AGC", "codon change was GGC to AGC" );
     131
    91132my $omim_entry = $omim_parser->next_phenotype();
    92133my $numb       = $omim_entry->MIM_number();
Note: See TracChangeset for help on using the changeset viewer.