IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Bioinformatique Perl Discussion :

OO récupération d'informations sur GenBank


Sujet :

Bioinformatique Perl

  1. #1
    Membre émérite
    Avatar de Jasmine80
    Femme Profil pro
    Bioinformaticienne
    Inscrit en
    Octobre 2006
    Messages
    3 157
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 44
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Bioinformaticienne
    Secteur : Santé

    Informations forums :
    Inscription : Octobre 2006
    Messages : 3 157
    Points : 2 673
    Points
    2 673
    Par défaut OO récupération d'informations sur GenBank
    Bonjour,


    Voici le format de l'objet
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
                     '_annotation' => bless( {
                                               '_typemap' => bless( {
                                                                      '_type' => {
                                                                                   'keyword' => 'Bio::Annotation::SimpleValue',
                                                                                   'comment' => 'Bio::Annotation::Comment',
                                                                                   'reference' => 'Bio::Annotation::Reference',
                                                                                   'date_changed' => 'Bio::Annotation::SimpleValue',
                                                                                   'dblink' => 'Bio::Annotation::DBLink'
                                                                                 }
                                                                    }, 'Bio::Annotation::TypeManager' ),
                                               '_annotation' => {
                                                                  'keyword' => [
                                                                                 bless( {
                                                                                          'value' => '',
                                                                                          '_root_verbose' => 0,
                                                                                          'tagname' => 'keyword'
                                                                                        }, 'Bio::Annotation::SimpleValue' )
                                                                               ],
                                                                  'reference' => [
                                                                                   bless( {
                                                                                            'authors' => 'Beutin,L. and Burgos,Y.',
                                                                                            'location' => 'Unpublished',
                                                                                            'title' => 'Characterization of plasmid encoded alpha-haemolysin determinants',
                                                                                            '_root_verbose' => 0,
                                                                                            'tagname' => 'reference'
                                                                                          }, 'Bio::Annotation::Reference' ),
    J'aimerais récupérer le titre, les auteurs ainsi que la location. Il faut utiliser les méthodes du module Bio::Annotation::Reference. Le problème est que je ne sais pas comment accéder à cet objet contenant ces données.

    Voici mon script
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    #!/usr/local/bin/perl
     
    use strict;
     
    use Bio::DB::GenBank;
    use Data::Dumper;
     
    no warnings qw/redefine/;
     
     
    my @request = qw (FM210349);
     
     
    my $gb = new Bio::DB::GenBank;
     
    foreach my $acc (@request){
     
    	# Recherche dans Genbank
    	#--------------------------
    	my $info = $gb->get_Seq_by_acc($acc);
     
    	# print Dumper $info;
     
    	my $seq = $info->seq();
     
    	my $acc = $info->accession();
     
    	my $gi = $info->primary_id;
     
    	my $def = $info->description;
    	$def =~ s/([\\'])/\\$1/g;  # pour insertion en DB
     
    	my $seq_length = length($seq);
     
    	my ($title, $authors, $location);
     
     
     
     
     
    	print "acc : $acc\ngi : $gi\nLongueur de la séquence $seq_length nucléotides\ndescription : $def\ntitle : $title\n\n\n";
     
    }

    Avez-vous une idée de la façon de récupérer ces 3 valeurs?


    Merci,
    -- Jasmine --

  2. #2
    Membre régulier
    Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Novembre 2009
    Messages
    212
    Détails du profil
    Informations personnelles :
    Âge : 34
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Novembre 2009
    Messages : 212
    Points : 93
    Points
    93
    Par défaut
    je vois que le sujet date et qu'il n'y a pas eu de réponse. J'ai exactement le même problème il me faut récupéré tout ce qui est auteur titre et remarque pour chaque fiche mais je n'y arrive pas As tu trouvé la solution entre temps?

  3. #3
    Membre émérite
    Avatar de Jasmine80
    Femme Profil pro
    Bioinformaticienne
    Inscrit en
    Octobre 2006
    Messages
    3 157
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 44
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Bioinformaticienne
    Secteur : Santé

    Informations forums :
    Inscription : Octobre 2006
    Messages : 3 157
    Points : 2 673
    Points
    2 673
    Par défaut
    Module Bio::Annotation::Collection - Default Perl implementation of AnnotationCollectionI


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    		my $info = $gb->get_Seq_by_acc($acc);
     
    		my $def = $info->description;
    		my $gi = $info->primary_id;
    		my $an = $info->annotation();
     
    		print $fh_publi "acc : $acc\ngi : $gi\ndescription : $def\n";
     
    		foreach my $key ( $an->get_all_annotation_keys() ) {
     
    			my @values = $an->get_Annotations($key);
     
    			foreach my $value ( @values ) {
     
    				# access into this object
    				my $hash = $value->hash_tree();
     
    				if (defined $hash->{title}){
    					print $fh_publi "title : ".$hash->{title}."\n";
    				}
    				if (defined $hash->{authors}){
    					print $fh_publi "authors : ".$hash->{authors}."\n";
    				}
    				if (defined $hash->{location}){
    					print $fh_publi "location : ".$hash->{location}."\n";
    				}
    				if (defined $hash->{pubmed}){
    					print $fh_publi "pubmed : ".$hash->{pubmed}."\n";
    				}
    				if (defined $hash->{value}){
    					if ($hash->{value} =~ m/\w+/){
    						print $fh_publi "date : ".$hash->{value}."\n\n\n";
    					}
    				}			
    			}
    			print $fh_publi "\n";
    		}
    -- Jasmine --

  4. #4
    Membre régulier
    Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Novembre 2009
    Messages
    212
    Détails du profil
    Informations personnelles :
    Âge : 34
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Novembre 2009
    Messages : 212
    Points : 93
    Points
    93
    Par défaut
    merci beaucoup ^^

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Récupération d'informations sur plusieures lignes
    Par Oli_Ifre dans le forum Langage
    Réponses: 6
    Dernier message: 03/04/2007, 09h57
  2. Réponses: 5
    Dernier message: 30/10/2006, 17h23
  3. Récupérations d'informations sur le net
    Par Bibou06 dans le forum Langage
    Réponses: 6
    Dernier message: 29/08/2006, 21h09
  4. Réponses: 5
    Dernier message: 03/02/2006, 14h47
  5. Réponses: 6
    Dernier message: 28/04/2004, 11h41

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo