#!/usr/bin/perl

use strict;
use DBI;

my $nmod = 10;
my $gene = "rgs2";

  my $dbi = DBI->connect("DBI:mysql:database=networks", "root", "we11come" );
  my $query1 = "select b.gene_name from net_hippocampus a, annotation b where a.module=? and a.probe_id=b.probe_id";
  my $sth = $dbi->prepare($query1);
  $sth->execute($nmod);
  my $results = $sth->fetchall_arrayref();
foreach my $ref ( @$results ) {
  print join( "\t", $nmod, @$ref ) . "\n";
}
  my $query2 = "select probe_id from annotation where gene_name=?";
  my $sth = $dbi->prepare($query2);
  $sth->execute($gene);
  my $results = $sth->fetchall_arrayref();
foreach my $ref ( @$results ) {
  print join( "\t", $gene, @$ref ) . "\n";
}

my $query3 = "select * from net_hippocampus a, annotation b where a.probe_id=b.probe_id and b.gene_name=?";
  my $sth = $dbi->prepare($query2);
  $sth->execute($gene);
  my $results = $sth->fetchall_arrayref();
foreach my $ref ( @$results ) {
  print join( "\t", $gene, @$ref ) . "\n";
}




#
#
