Changeset 12


Ignore:
Timestamp:
Jul 1, 2010, 4:42:47 PM (10 years ago)
Author:
maarten
Message:

feature ok version

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/ProccesAllicVariants.pm

    r11 r12  
    9393#
    9494#       }
     95        if ( length($mutation) > 0 ) {
     96                $mutation="p.".$mutation;
     97        }
    9598        return ($mutation);
    9699
     
    362365        return ($result);
    363366}
     367sub formatdnamutation{
     368        my ($dnaUnformated) = shift;
     369        if($dnaUnformated=~/c\.(.*)/){
     370                $dnaUnformated=$1;
     371        }
     372        my $formated="";
     373                if ( $dnaUnformated =~ /^\s?(IVS\d{1,5})\w{0,5},\s?([\w\-]{3})\s?,\s?([+\-\d]{2,9})\s?$/ ) {
     374                        my $substition=$2;
     375                        $substition =~ tr/-/>/;
     376                        $formated=$1.$3.$substition;
     377        }elsif( $dnaUnformated =~ /^\s?(\d{1,4})-BP (DEL|INS), [A-z]*(\d{1,5})([ACTG]{0,10})\s?$/ ){
     378                my $amount=$1;
     379                my $event=lc($2);
     380                my $position=$3;
     381                my $sequence=$4;
     382                my $postion2="";
     383                if ($event eq "del"){
     384                         $postion2=($position+1)-$amount;
     385                }else{
     386                        $postion2=($position+1);
     387                }
     388                $formated=$position."_".$postion2.$event.$sequence;
     389       
     390       
     391        }else{
     392                $formated=$dnaUnformated;
     393        }
     394        if (length($formated)>0){
     395                $formated="c.".$formated;
     396        }
     397        return($formated);
     398}
     399
    364400
    365401sub fomatYears {
     
    417453          }
    418454        }
     455        if (length($formated)>0){
     456                $formated="c.".$formated;
     457        }
    419458        return ($formated);
    420459}
     
    597636                  . "aa mutation". "\t"
    598637                  . "dna mutation"."\t"
     638                 . "formated dna mutation"."\t"
    599639                  . "DBsnp" . "\t"
    600640                  . "references" . "\t"
     
    632672                        my $aamutation=getAAMutation($av);
    633673                        my $dnamutation=getDNAMutation($av);
     674                        my $formateddnamutation=formatdnamutation($dnamutation);
    634675                        my $authorsAndYears = getAuthor( $av->description() );
    635676                        $authorsAndYears = formatAuthors($authorsAndYears);
     
    653694                          . $aamutation . "\t"
    654695                          . $dnamutation."\t"
     696                        . $formateddnamutation."\t"
    655697                          . $dbsnp . "\t"
    656698                          . $articles . "\t"
  • test/test.pl

    r11 r12  
    1010use Omim2dbsnp;
    1111use Bio::Phenotype::OMIM::OMIMparser;
    12 use Test::More tests =>81;
     12use Test::More tests =>88;
    1313
    1414#lib "../lib";
     
    4747
    4848my $formated=ProccesAllicVariants::formatNucleotideMutation("6088C-T transition","");
    49 is( $formated, "6088C>T", "format 6088C-T transition" );
     49is( $formated, "c.6088C>T", "format 6088C-T transition" );
    5050
    5151
    5252$formated=ProccesAllicVariants::formatNucleotideMutation("T-to-C transition at nucleotide 1622 in exon 12","");
    53 is( $formated, "1622T>C", "T-to-C transition at nucleotide 1622 in exon 12" );
     53is( $formated, "c.1622T>C", "T-to-C transition at nucleotide 1622 in exon 12" );
    5454
    5555$formated=ProccesAllicVariants::formatNucleotideMutation("CGA to TGA",2147);
    56 is( $formated, "6439_6441delinsTGA", "CGA to TGA 2147" );
     56is( $formated, "c.6439_6441delinsTGA", "CGA to TGA 2147" );
    5757
    5858$formated=ProccesAllicVariants::calculateNuclitideMutation("CGA to TGA","2147");
     
    415415        is(ProccesAllicVariants::getfilename("LMBR1 DOMAIN-CONTAINING PROTEIN 1: LMBRD1",";;LMBD1;;"),"LMBRD1","get name");
    416416        is(ProccesAllicVariants::getfilename("TRANSIENT RECEPTOR POTENTIAL CATION CHANNEL, SUBFAMILY M, MEMBER 6;","TRPM6"),"TRPM6","get name");
     417
     418
     419my $dnamutation = ProccesAllicVariants::formatdnamutation(
     420        "IVS30, G-T, +1 ");
     421is( $dnamutation, "c.IVS30+1G>T", "dnamutation" );
     422
     423 $dnamutation = ProccesAllicVariants::formatdnamutation(
     424        "IVS5AS, A-G, -2");
     425
     426is( $dnamutation, "c.IVS5-2A>G", "dnamutation with extra chars after IVS" );
     427
     428 $dnamutation = ProccesAllicVariants::formatdnamutation(
     429        "1-BP DEL, 1225A");
     430
     431is( $dnamutation, "c.1225_1225delA", "dnamutation DEL" );
     432
     433 $dnamutation = ProccesAllicVariants::formatdnamutation(
     434        "15-BP DEL, NT3539");
     435
     436is( $dnamutation, "c.3539_3525del", "dnamutation DEL" );
     437
     438 $dnamutation = ProccesAllicVariants::formatdnamutation(
     439        "c.15-BP DEL, NT3539");
     440
     441is( $dnamutation, "c.3539_3525del", "dnamutation DEL" );
     442
     443 $dnamutation = ProccesAllicVariants::formatdnamutation(
     444        "c.2-BP INS, 3211GT");
     445
     446is( $dnamutation, "c.3211_3212insGT", "dnamutation INS" );
     447
     448 $dnamutation = ProccesAllicVariants::formatdnamutation(
     449        "c.2-BP INS, 3211GT, 2-BP INS, 3211GT");
     450
     451is( $dnamutation, "c.2-BP INS, 3211GT, 2-BP INS, 3211GT", "dnamutation double INS should be the same" );
Note: See TracChangeset for help on using the changeset viewer.