[Bio] / GBBergeyDB / getGenomeData.pl Repository:
ViewVC logotype

View of /GBBergeyDB/getGenomeData.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (download) (as text) (annotate)
Thu Apr 5 15:28:50 2007 UTC (12 years, 8 months ago) by bartels
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +700 -282 lines
*** empty log message ***

#!/usr/bin/env /home/bartels/FIGdisk/env/cee/bin/perl

use strict;
use warnings;
use lib "../PPO/";
use DBMaster;
use GenomeParser;
use GenomeMapper;

my $dbmaster = DBMaster->new( 'GBBergeyDB' );

#######################################
# Get data from BergeysSequencing.csv #
#######################################

print STDERR "parsing Bergeys Taxonomy\n";

my $file2 = "/home/bartels/CVS/GBBergeyDB/Data/Bergeys/typestrainmapping_hierarchy.txt";

my $bergeyhash = GenomeParser::getBergeysTaxonomy( $dbmaster, $file2 );

###############################
# Get data from goldtable.csv #
###############################

print STDERR "parsing Gold\n";

my $file3 = "/home/bartels/CVS/GBBergeyDB/Data/GOLD/goldtable.txt";

my ( $goldhash ) = GenomeParser::parseGold( $dbmaster, $file3 );

###############################
# Get data from NCBI.csv #
###############################

print STDERR "parsing NCBI\n";

my $file4 = "/home/bartels/CVS/GBBergeyDB/Data/NCBI/mytax.txt";

my ( $ncbihash, $ncbistrainhash ) = GenomeParser::parseNCBI( $dbmaster, $file4 );

###############################
# Get data from DMSZ.csv #
###############################

print STDERR "parsing DMSZ\n";

my $file5 = "/home/bartels/CVS/GBBergeyDB/Data/DMSZ/bactnam0207.csv";
my $file55 = "/home/bartels/CVS/GBBergeyDB/Data/DMSZ/edited.csv";

my ( $dmszhash ) = GenomeParser::parseDMSZ( $dbmaster, $file5 );
my ( $dmszhash2 ) = GenomeParser::parseDMSZ( $dbmaster, $file55 );
foreach my $key ( $dmszhash2 ) {
  $dmszhash->{ $key } = $dmszhash2->{ $key };
}


##########################
# Get data from Jim Cole #
##########################

print STDERR "parsing data provided by RDP (Jim Cole )\n";

my $file6 = "/home/bartels/CVS/GBBergeyDB/Data/JimCole/typestrainmapping.txt";
my $file7 = "/home/bartels/CVS/GBBergeyDB/Data/JimCole/surrogatesANDnotypes.txt";
my $file67 = "/home/bartels/CVS/GBBergeyDB/Data/JimCole/release9_48_unaligned.fasta";
my $file68 = "/home/bartels/CVS/GBBergeyDB/Data/GreenGenes/current_prokMSA_unaligned.fasta";
my $file69 = "/home/bartels/CVS/GBBergeyDB/Data/GreenGenes/added16SRNAs.fasta";

my $JimColehash = GenomeParser::parseRDPJimCole( $dbmaster, $file6, $file7, $file67, $file68, $file69 );


################################
# Get data from Additional.csv #
################################

print STDERR "parsing Additional.csv\n";

my $file66 = "/home/bartels/CVS/GBBergeyDB/Data/Additional/additional.csv";

my ( $addhash ) = GenomeParser::parseDMSZ( $dbmaster, $file66 );


############################
# Get data from Literature #
############################

print STDERR "parsing Literature\n";

my $file1 = "/home/bartels/CVS/GBBergeyDB/Data/Literature/pubmedout.txt";

my ( $lithash ) = GenomeParser::parseLiterature( $dbmaster, $file1 );


##########################
# Get data from CCUG.txt #
##########################

print STDERR "parsing CCUG\n";

my $file8 = "/home/bartels/CVS/GBBergeyDB/Data/CCUG/ccugtype.txt";

my ( $ccughash ) = GenomeParser::parseCCUG( $dbmaster, $file8 );


##################################
# Get data from SEEDLinkData.csv #
##################################

print STDERR "parsing SEEDLinkData\n";

my $file88 = "/home/bartels/CVS/GBBergeyDB/Data/SEEDLINK/SEEDLinkData.csv";

my $seedlinkdatahash = GenomeParser::parseSEEDLinkData( $dbmaster, $file88 );


############################
# Get data Garrity gave us #
############################

print STDERR "parsing BergeyStrainData\n";

my $file10 = "/home/bartels/CVS/GBBergeyDB/Data/Bergeys/WFCC_table_1.txt";

my $garrityhash = GenomeParser::parseWFCC( $dbmaster, $file10 );


print STDERR "DONE\n";


##################################
# Putting data into the database #
##################################
# (1) Put in Bergey's taxonomy   #
##################################

#my $success = putInBergeysTax( $dbmaster, $bergeyhash, $garrityhash, $JimColehash );

##################################
# (2) Put in literature from KH  #
##################################

#my $success1 = putInLiterature( $dbmaster, $lithash );

##################################
# (3) Put in collection strains  #
##################################

#my $success2 = putInCollectionStrains( $dbmaster, $dmszhash, $ccughash );

##################################
# (4) Put in GOLD strains        #
##################################

my $success3 = putInGOLDStrains( $dbmaster, $goldhash );

##################################
# (5) Put in STS clusters        #
##################################

#my $success4 = getClustersIn( $dbmaster );

##################################
# (6) Put in SEED links          #
##################################

#my $success5 = getSEEDLinks( $dbmaster, $seedlinkdatahash );

##################################
# (7) Put in GreenGenes links    #
##################################

#my $success6 = getGreenGenesLinks( $dbmaster, $file68, $file69 );

1;

sub getGreenGenesLinks {

  my ( $dbmaster, $fileGreenGenesRNA, $fileAdded ) = @_;

  my $accnohash;

  my $genomeArr = $dbmaster->Genome->get_objects();

  foreach my $g ( @$genomeArr ) {
    
    if ( defined( $g->genBank ) ) {
      $accnohash->{ $g->genBank }->{ 'species' } = $g->Species->name;
      $accnohash->{ $g->genBank }->{ 'genome' } = $g;
    }

  }

  $accnohash = GenomeParser::parseGreenGenesRNA( $dbmaster, $fileGreenGenesRNA, $fileAdded, $accnohash );

  foreach my $accno ( keys %$accnohash ) {
    print STDERR $accno." ACCNO\n";
    if ( defined( $accnohash->{ $accno }->{ 'prokMSAid' } ) ) {
      print STDERR $accnohash->{ $accno }->{ 'prokMSAid' }. " prokMSAid\n";
      my $g = $accnohash->{ $accno }->{ 'genome' };
      $g->prokMSAid( $accnohash->{ $accno }->{ 'prokMSAid' } );
    }
  }
  return 1;

}

sub putInGOLDStrains {
  print STDERR "INPUTGOLDSTRAINS\n";
  my ( $dbmaster, $goldhash ) = @_;
  
  # first let's get da species 
  foreach my $g ( keys %$goldhash ) {

    my $SpeciesArr = $dbmaster->Species->get_objects( { 'name' => $g } );
    my $Species = $SpeciesArr->[0];

    if ( defined( $Species ) ) {

      my $stArr = $dbmaster->Genome->get_objects( { 'Species'    => $Species,
						    'typeStrain' => 1 } );
      foreach my $gs ( @{ $goldhash->{ $g }->{ 'strains' } } ) {	
	&putInGOLDStrain( $dbmaster, $gs, $stArr->[0], $Species );
      }
    }
    else {
      
      next if ( $g =~ /Pantoea strewartii/ );
      next if ( $g =~ /Stigmatella aurantica/ );
      
      foreach my $gs ( @{ $goldhash->{ $g }->{ 'strains' } } ) {
	print STDERR "GOLD-NOTIN: ".$gs->{ 'genus' }." ".$gs->{ 'species' }."\n";
	my $success = lookForGOLDStrain( $dbmaster, $gs );
      }
    }
  }
}

##########################################
# put in strains from strain collections # 
##########################################
sub putInCollectionStrains {

  my ( $dbmaster, $dsmzhash, $ccughash ) = @_;

  my $present = 0;

  my $inDSMZ = 0;
  my $inCCUG = 0;
  my $strains = [];
  
  foreach my $strain ( keys %$dsmzhash ) {
    last;
    my $strains = $dsmzhash->{ $strain }->{ 'strains' };
    my $strainsHash;

    my $genomeArr = $dbmaster->Genome->get_objects( { 'name'  => $strain } );
    my $genome = $genomeArr->[0];

    if ( defined( $genome ) ) {
      
      my $strainsarr = $genome->strainAliases;

      my $srep = $strainsarr->[0];

      foreach my $s ( @$strainsarr ) {
	$strainsHash->{ $s } = 1;
      }
      foreach my $s ( @$strains ) {
	$strainsHash->{ $s } = 1;
      }
      
      delete $strainsHash->{ $srep };

      my @strainse = keys %$strainsHash;
      unshift @strainse, $srep;
      $genome->strainAliases( \@strainse );
      $genome->InDSMZ( 1 );
    }
    else {
      print STDERR "$strain is not found in the database\n";
    }
  }
  
  foreach my $strain ( keys %$ccughash ) {

    my $strains = $ccughash->{ $strain }->{ 'strains' };
    my $strainsHash;

    my $genomeArr = $dbmaster->Genome->get_objects( { 'name'  => $strain } );
    my $genome = $genomeArr->[0];

    if ( defined( $genome ) ) {
      
      my $strainsarr = $genome->strainAliases;
      if ( scalar @$strainsarr == 0 ) {
	$genome->strainAliases( $strains );
      }
      else {
	my $srep = $strainsarr->[0];

	foreach my $s ( @$strainsarr ) {
	  $strainsHash->{ $s } = 1;
	}
	foreach my $s ( @$strains ) {
	  $strainsHash->{ $s } = 1;
	}
	
	delete $strainsHash->{ $srep };
	
	my @strainse = keys %$strainsHash;
	unshift @strainse, $srep;
	$genome->strainAliases( \@strainse );
	$genome->InCCUG( 1 );
      }
    }
    else {
      print STDERR "$strain is not found in the database\n";
    }
  }
  return 1;

}

sub putInBergeysTax {

  my ( $dbmaster, $bergeyhash, $garrityhash, $JimColehash ) = @_;

  my $taxhash;
  my $crashtax;
  
  ## Domains ##
  foreach my $name ( keys %{ $bergeyhash->{ 'domain' } } ) {
    my $domain = createDomain( $dbmaster, $name, $bergeyhash->{ 'domain' }->{ $name }->{ 'taxDOI' } );
    $taxhash->{ $bergeyhash->{ 'domain' }->{ $name }->{ 'taxDOI' } } = $domain;
  }
  
  ## Phyla ##
  foreach my $name ( keys %{ $bergeyhash->{ 'phylum' } } ) {
    my $parent = $taxhash->{ $bergeyhash->{ 'phylum' }->{ $name }->{ 'parentDOI' } };

    my $phylum = createPhylum( $dbmaster, $name, $bergeyhash->{ 'phylum' }->{ $name }->{ 'taxDOI' }, $parent );
    $taxhash->{ $bergeyhash->{ 'phylum' }->{ $name }->{ 'taxDOI' } } = $phylum;
  }
  
  ## Class ##
  foreach my $name ( keys %{ $bergeyhash->{ 'class' } } ) {
    my $parent = $taxhash->{ $bergeyhash->{ 'class' }->{ $name }->{ 'parentDOI' } };
    
    my $class = createClass( $dbmaster, $name, $bergeyhash->{ 'class' }->{ $name }->{ 'taxDOI' }, $parent );
    $taxhash->{ $bergeyhash->{ 'class' }->{ $name }->{ 'taxDOI' } } = $class;
  }
  
  ## Subclass ##
  # I will remove subclasses. They are now included in the Order. #
  foreach my $name ( keys %{ $bergeyhash->{ 'subclass' } } ) {
    my $parent = $taxhash->{ $bergeyhash->{ 'subclass' }->{ $name }->{ 'parentDOI' } };
    $crashtax->{ 'subclass' }->{ $bergeyhash->{ 'subclass' }->{ $name }->{ 'taxDOI' } }->{ 'parent' } = $parent;
    $crashtax->{ 'subclass' }->{ $bergeyhash->{ 'subclass' }->{ $name }->{ 'taxDOI' } }->{ 'name' } = $name;
  }
  
  ## GOrder ##
  foreach my $name ( keys %{ $bergeyhash->{ 'order' } } ) {
    my $newname = $name;
    my $parent = $taxhash->{ $bergeyhash->{ 'order' }->{ $name }->{ 'parentDOI' } };
    if ( !defined( $parent ) ) {
      $parent = $crashtax->{ 'subclass' }->{ $bergeyhash->{ 'order' }->{ $name }->{ 'parentDOI' } }->{ 'parent' };
      my $tmpname = $crashtax->{ 'subclass' }->{ $bergeyhash->{ 'order' }->{ $name }->{ 'parentDOI' } }->{ 'name' };
      $newname = $name." (". $tmpname.")";
    }
    
    my $gorder = createGOrder( $dbmaster, $newname, $bergeyhash->{ 'order' }->{ $name }->{ 'taxDOI' }, $parent );
    $taxhash->{ $bergeyhash->{ 'order' }->{ $name }->{ 'taxDOI' } } = $gorder;
  }
  # create some missing #
  my $eviltaxnumber = 100000;
  my $pare = $taxhash->{ 625 };
  my $gord = createGOrder( $dbmaster, 'Cyanobacteria (added)', $eviltaxnumber, $pare );
  $taxhash->{ $eviltaxnumber } = $gord;
  
  
  ## Suborder ##
  # I will remove suborders. They are now included in the family. #
  foreach my $name ( keys %{ $bergeyhash->{ 'suborder' } } ) {
    my $parent = $taxhash->{ $bergeyhash->{ 'suborder' }->{ $name }->{ 'parentDOI' } };
    $crashtax->{ 'suborder' }->{ $bergeyhash->{ 'suborder' }->{ $name }->{ 'taxDOI' } }->{ 'parent' } = $parent;
    $crashtax->{ 'suborder' }->{ $bergeyhash->{ 'suborder' }->{ $name }->{ 'taxDOI' } }->{ 'name' } = $name;
  }
  
  ## Family ##
  foreach my $name ( keys %{ $bergeyhash->{ 'family' } } ) {
    
    my $newname = $name;
    my $parent = $taxhash->{ $bergeyhash->{ 'family' }->{ $name }->{ 'parentDOI' } };
    if ( $bergeyhash->{ 'family' }->{ $name }->{ 'parentDOI' } == 625 ) {
      $parent = $taxhash->{ 100000 };
    }
    if ( !defined( $parent ) ) {
      $parent = $crashtax->{ 'suborder' }->{ $bergeyhash->{ 'family' }->{ $name }->{ 'parentDOI' } }->{ 'parent' };
      my $tmpname = $crashtax->{ 'suborder' }->{ $bergeyhash->{ 'family' }->{ $name }->{ 'parentDOI' } }->{ 'name' };
      $newname = $name." (". $tmpname.")";
    }
    
    my $family = createFamily( $dbmaster, $newname, $bergeyhash->{ 'family' }->{ $name }->{ 'taxDOI' }, $parent );
    $taxhash->{ $bergeyhash->{ 'family' }->{ $name }->{ 'taxDOI' } } = $family;
  }
  
  ## Genus ##
  foreach my $name ( keys %{ $bergeyhash->{ 'genus' } } ) {
    my $parent = $taxhash->{ $bergeyhash->{ 'genus' }->{ $name }->{ 'parentDOI' } };
    
    my $genus = createGenus( $dbmaster, $name, $bergeyhash->{ 'genus' }->{ $name }->{ 'taxDOI' }, $parent );
    $taxhash->{ $bergeyhash->{ 'genus' }->{ $name }->{ 'taxDOI' } } = $genus;
  }
  
  ## Species and also Genome ##
  foreach my $name ( keys %{ $bergeyhash->{ 'species' } } ) {
    my $parent = $taxhash->{ $bergeyhash->{ 'species' }->{ $name }->{ 'parentDOI' } };
    
    my $species = createSpecies( $dbmaster, $name, $bergeyhash->{ 'species' }->{ $name }->{ 'taxDOI' }, $parent );
    $taxhash->{ $bergeyhash->{ 'species' }->{ $name }->{ 'taxDOI' } } = $species;

    # Now look if we can find a genome here #
  
    my @strainsArr = ();
    my $genome;
    
    # put in type strains from Garrity #
    if ( defined( $garrityhash->{ $name } ) ) {
      my $typeStrainGarrity = $garrityhash->{ $name }->{ 'typestrain' };
      
      @strainsArr = ( $typeStrainGarrity );
      $genome = createGenome( $dbmaster, $species, \@strainsArr );
      
      $genome->InBergey( 1 );
      $genome->typeStrain( 1 );
      $genome->nameDOI( $garrityhash->{ $name }->{ 'nameDOI' } );
      $genome->exemplarDOI( $garrityhash->{ $name }->{ 'exemplarDOI' } );
      $genome->taxonDOI( $garrityhash->{ $name }->{ 'taxonDOI' } );
    }
    else {
      # Garrity misses strains, so put in one typestrain per species
      $genome = createGenome( $dbmaster, $species, [] );
      
      $genome->InBergey( 1 );
      $genome->typeStrain( 1 );
      
    }
    if ( defined( $JimColehash->{ $name } ) && defined( $genome ) ) {
      print STDERR "Setting 16S for $name\n";
      $genome->sixTeenS( $JimColehash->{ $name }->{ 'sequence' } );
      $genome->genBank( $JimColehash->{ $name }->{ 'accno' } );
    }
  }
  
  return 1;
}

#################################################
# put in literature informtion for each species #
#################################################
sub putInLiterature {

  my ( $dbmaster, $lithash ) = @_;

  foreach my $taxid ( keys %{ $lithash->{ 'TAXID' } } ) {

    my $SpeciesArr = $dbmaster->Species->get_objects( { 'taxid' => $taxid } );
    if ( defined( $SpeciesArr->[0] ) ) {
      $SpeciesArr->[0]->litNum( $lithash->{ 'TAXID' }->{ $taxid }->{ 'number' } );
      my @litarr = values %{ $lithash->{ 'TAXID' }->{ $taxid }->{ 'pubs' } };
      $SpeciesArr->[0]->litArray( \@litarr );  
    }

  }

}

#####################################################################
# now merge everything into one big hash using species as the basis #
#####################################################################

#print STDERR "\nMerging...\n";

#my $mergedHash = mergeData( $genomedatahash, $bergeyhash, $goldhash, $ncbihash, $dmszhash, $ccughash, $addhash, $garrityhash, $JimColehash );

#############################################
# now feed the database with all that stuff #
#############################################

#print STDERR "\nPutting stuff into the database...\n";

#my $success = putIntoDatabase( $dbmaster, $mergedHash, $bergeystrainhash, $goldstrainhash, $ncbistrainhash, $seedlinkdatahash );


##################
# get SEED links #
##################
sub getSEEDLinks {

  my ( $dbmaster, $seedlinkdatahash ) = @_;
  
  print STDERR "getting to SEED links \n";

  foreach my $seedlinkgenome ( keys %$seedlinkdatahash ) {
#last;
    my $taxid = $seedlinkdatahash->{ $seedlinkgenome }->{ 'taxid' };

    my $thisgenomeArr = $dbmaster->Genome->get_objects( { 'taxid' => $taxid } );

    my $thisgenome = $thisgenomeArr->[0];
    
    if ( defined( $thisgenome ) ) {
      $thisgenome->figid( $seedlinkdatahash->{ $seedlinkgenome }->{ 'figid' } );
    }
  }
  return 1;
}


sub getClustersIn {

  my ( $dbmaster ) = @_;

  my $clustertablefile = "/home/bartels/CVS/GBBergeyDB/Data/16S/cluster.table";
  my $clusterrepsfile = "/home/bartels/CVS/GBBergeyDB/Data/16S/cluster.reps";
  my $clusterscorefile = "/home/bartels/CVS/GBBergeyDB/Data/16S/cluster.sc";

  print STDERR "parsing Cluster data\n";
  my $clusterhash = GenomeParser::getClustersNew( $dbmaster, $clustertablefile, $clusterrepsfile, $clusterscorefile );
  print STDERR "DONE\n";  

  foreach my $clusnum ( keys %$clusterhash ) {
    print STDERR "working on cluster $clusnum\n";
    my $cluster = createSTScluster( $dbmaster, $clusnum );
    
    my $rep = $clusterhash->{ $clusnum }->{ 'representative' };
    $cluster->score( $clusterhash->{ $clusnum }->{ 'score' } );
    my $strains = $clusterhash->{ $clusnum }->{ 'strains' };

    my @SpeciesOfClusterGenomes = ();

    foreach my $s ( keys %$strains ) {
      my $genomeArr = $dbmaster->Genome->get_objects( { 'genBank' => $s } );
      if ( !defined( $genomeArr->[0] ) ) {
	die "Genome $s is not present in the database :( \n";
      }
      else {
	push @SpeciesOfClusterGenomes, $genomeArr->[0]->Species;

	if ( $genomeArr->[0]->genBank eq $rep ) {
	  $cluster->representative( $genomeArr->[0] );
	}
	if ( defined( $genomeArr->[0]->sequencingStatus ) && ( $genomeArr->[0]->sequencingStatus ne 'none' ) ) {
	  $cluster->seqrepresentation( 1 );
	}
	$genomeArr->[0]->STScluster( $cluster );
      }
    }
    foreach my $sp ( @SpeciesOfClusterGenomes ) {
      my $strainsOfSpecies = $dbmaster->Genome->get_objects( { 'Species' => $sp } );
      foreach my $str ( @$strainsOfSpecies ) {
	if ( defined( $str->sequencingStatus ) && ( $str->sequencingStatus ne 'none' ) ) {
	  $cluster->seqrepresentation( 1 );
	}
      }
    }
  }
  
  return 1;  
}

sub lookForB16SStrain {

  my ( $dbmaster, $ghash ) = @_;

  my $species = $ghash->{ 'species' };

  my $found = 0;
  my $outputname = $ghash->{ 'genus' };
  if ( defined( $ghash->{ 'species' } ) ) {
    $outputname = $outputname." ".$ghash->{ 'species' };
  }
  if ( defined( $ghash->{ 'strain' } ) ) {
    $outputname = $outputname. " " .$ghash->{ 'strain' };
  }

  # look if we can find a species by name
  my $searchname = $ghash->{ 'Species' };

  my $SpeciesArr = $dbmaster->Species->get_objects( { 'name' => $searchname } );
  if ( defined( $SpeciesArr->[0] ) ) {

    my $stArr = $dbmaster->Genome->get_objects( { 'Species'    => $SpeciesArr->[0],
						  'typeStrain' => 1 } );
    &putInB16SStrain( $dbmaster, $ghash, $stArr->[0], $SpeciesArr->[0] );
  }
  else {
    print STDERR "No Species 16S found for ". $searchname."\n";
  }
  return 1;
}

sub putInB16SStrain {
  my ( $dbmaster, $ghash, $typeGenome, $Species ) = @_;

  my $name = $ghash->{ 'Name' };

  my $genomeArr = $dbmaster->Genome->get_objects( { 'name' => $name } );

  my $straintxt = $ghash->{ 'strain' };
  my @strs = split( /; /, $straintxt );

  if ( defined( $genomeArr->[0] ) ) {
    $genomeArr->[0]->sixTeenS( $ghash->{ 'Sequence' } );
#    print ">".$genomeArr->[0]->name."\n".$ghash->{ 'Sequence' }."\n";
  }
  else {
    $genomeArr = $dbmaster->Genome->get_objects( { 'name' => $Species->name } );
    
    if ( defined( $genomeArr->[0] ) ) {

      my $tostrains = $genomeArr->[0]->strainAliases;
      my $isit = 0;
      if ( scalar( @$tostrains ) == 0 ) {
	$isit = 1;

      }
      else {
	foreach my $ts2 ( @$tostrains ) {
	  my $ts = $ts2;
	  foreach my $strain ( @strs ) {
	    if ( $ts eq $strain ) {
	      $isit = 1;
	      last;
	    }
	    else {
	      $ts =~ s/ //g;
	      $strain =~ s/ //g;
	      $strain =~ s/\(T\)//g;
	      $strain =~ s/\-T//g;
	      if ( $strain =~ /T$/ ) {
		chop $strain;
	      }
	      if ( $strain =~ /str. (.*)/ ) {
		$strain = $1;
	      }

	      if ( $ts eq $strain ) {
		$isit = 1;
		last;
	      } 
	    }
	  }
	  last if $isit;
	}
      }
      if ( $isit ) {
	$genomeArr->[0]->sixTeenS( $ghash->{ 'Sequence' } );
#	print ">".$genomeArr->[0]->name."\n".$ghash->{ 'Sequence' }."\n";
      }
      else {
	my $genomeNew = createGenome( $dbmaster, $Species, \@strs, $ghash->{ 'specaff' }, undef, $ghash->{ 'Name' } ); 
	$genomeNew->InGOLD( 0 );
	$genomeNew->sixTeenS( $ghash->{ 'Sequence' } );
#	print ">".$genomeNew->name."\n".$ghash->{ 'Sequence' }."\n";
      }
    }
    else {
      print STDERR "Did still not find strain $name of species ".$Species->name."\n";
    }
  }
  return 1;
}

sub putInGOLDStrain {
  my ( $dbmaster, $ghash, $typeGenome, $Species ) = @_;

  my $isin = 0;
  my $thereisoneGOLD = 0;
  my $thereisoneDB = 0;
  my $typeStrains;
  my $straintxt;
  if ( defined( $typeGenome ) ) {
    $typeStrains = $typeGenome->strainAliases;
  }

  if ( defined( $ghash->{ 'strain' } ) ) {

    $straintxt = $ghash->{ 'strain' };
    if ( $straintxt ne '' ) {
      $thereisoneGOLD = 1;
    }
    my @sarr = split( /, /, $straintxt );
    foreach my $tS ( @$typeStrains ) {
      $thereisoneDB = 1;
      foreach my $gS ( @sarr ) {
	if ( $tS eq $gS ) {
	  print STDERR "TypeStrain sequenced: ". $tS. " AND ".$gS."\n";
	  $isin = 1;
	  last;
	}
      }
    }
  }
  if ( defined( $typeGenome ) && ( $isin || ( $thereisoneDB == 0 && $thereisoneGOLD == 0 ) ) ) {
    $typeGenome->sequencingStatus( $ghash->{ 'STATUS' } );
    $typeGenome->InGOLD( 1 );
    $typeGenome->goldstamp( $ghash->{ 'GOLDSTAMP' } );
  }
  else {
    #create another strain and hang it to the species
    my @sarr = ();
    if ( defined( $straintxt ) ) {
      @sarr = split( /, /, $straintxt );
    }
    if ( defined( $straintxt ) ) {
      my $orgname = $ghash->{ 'Organism' } . " " . $straintxt;
      my $genome2 = createGenome( $dbmaster, $Species, \@sarr, $ghash->{ 'specaff' }, $straintxt, $orgname );
      $genome2->sequencingStatus( $ghash->{ 'STATUS' } );
      $genome2->InGOLD( 1 );
      $genome2->goldstamp( $ghash->{ 'GOLDSTAMP' } );
    }
  }
}

sub lookForGOLDStrain {

  my ( $dbmaster, $ghash ) = @_;

  my $species = $ghash->{ 'species' };

  my $found = 0;

  my $outputname = $ghash->{ 'genus' };
  if ( defined( $ghash->{ 'species' } ) ) {
    $outputname = $outputname." ".$ghash->{ 'species' };
  }
  if ( defined( $ghash->{ 'strain' } ) ) {
    $outputname = $outputname. " " .$ghash->{ 'strain' };
  }

  # look if we can find a species by name
  my $searchname = $ghash->{ 'genus' };
  if ( defined( $ghash->{ 'species' } ) ) {
    $searchname = $searchname . " " .$ghash->{ 'species' };
  }
  my $SpeciesArr = $dbmaster->Species->get_objects( { 'name' => $searchname } );
  if ( defined( $SpeciesArr->[0] ) ) {
    print STDERR "This Species ".$SpeciesArr->[0]->name."\n";

    my $stArr = $dbmaster->Genome->get_objects( { 'Species'    => $SpeciesArr->[0],
						  'typeStrain' => 1 } );
    &putInGOLDStrain( $dbmaster, $ghash, $stArr->[0], $SpeciesArr->[0] );
  }
  elsif ( $outputname =~ /Methanospirillum hungateii (.*)/ ) {
    my $SpeciesArr = $dbmaster->Species->get_objects( { 'name' => 'Methanospirillum hungatei' } );
    my $stArr = $dbmaster->Genome->get_objects( { 'name' => 'Methanospirillum hungatei' } );
    &putInGOLDStrain( $dbmaster, $ghash, $stArr->[0], $SpeciesArr->[0] );
  }
  else {
    print STDERR "No Species found for ". $searchname."\n";
    if ( defined( $ghash->{ 'species' } ) ) {
      $searchname = $searchname . " ".$ghash->{ 'species' };
      print STDERR "Trying type subspecies :) : ". $searchname."\n";
      my $SpeciesArr = $dbmaster->Species->get_objects( { 'name' => $searchname } );
      if ( defined( $SpeciesArr->[0] ) ) {
	print STDERR "Now we got it: ".$SpeciesArr->[0]->name."\n";

	my $stArr = $dbmaster->Genome->get_objects( { 'Species'    => $SpeciesArr->[0],
						      'typeStrain' => 1 } );
	&putInGOLDStrain( $dbmaster, $ghash, $stArr->[0], $SpeciesArr->[0] );

	$found = 1;
      }
      else {
	print STDERR "STILL NOTHING: ".$outputname."\n";
      }
    }
    else {
      print STDERR "Searching for the Genus ".$ghash->{ 'genus' }."\n";
      my $GenusArr = $dbmaster->Genus->get_objects( { 'name' => $searchname } );
      if ( defined( $GenusArr->[0] ) ) {
	print STDERR "Now we got it: ".$GenusArr->[0]->name." GENUS\n";

	my $Species = createSpecies( $dbmaster, $GenusArr->[0]->name, undef, $GenusArr->[0] );

	&putInGOLDStrain( $dbmaster, $ghash, undef, $Species );
	$found = 1;
      }
      else {
	print STDERR "STILL NOTHING: ".$outputname."\n";
      }
    }
  }

  if ( !$found ) {
    my ( $genomeObj ) = trySpecialCasesGOLD( $dbmaster, $ghash, $outputname );
  }
  return 1;
}

sub makeShouldBeHash {
  my ( $dbmaster ) = @_;

  my $sbh;
  my $genomes = $dbmaster->Genome->get_objects();
  foreach my $g ( @$genomes ) {
    my $rnarr = $dbmaster->GenomeAlias->get_objects( { 'name' => $g->name } );
    my $rn = $rnarr->[0];
    if ( defined( $rn ) ) {
      $sbh->{ $g->name } = $rn->scientificName;
    }
  }

  return $sbh
}

sub trySpecialCasesGOLD {

  my ( $dbmaster, $goldObject, $outputname ) = @_;

  my ( $genomeObj, $species );

  my $name = $goldObject->{ 'genus' }. " ".$goldObject->{ 'species' };

  if ( $name =~ /Halobacterium salinarum/ ) {
    my $SpeciesArr = $dbmaster->Species->get_objects( { 'name' => 'Halobacterium salinarum' } );
    my $strainsarr = [ 'RI', 'DSM671', 'DSM 671', 'ATCC 19700' ];
    $genomeObj = createGenome( $dbmaster, $SpeciesArr->[0], $strainsarr, undef, 'RI' );
    $genomeObj->InGOLD( 1 );
    $genomeObj->InBergey( 0 );
    $genomeObj->goldstamp( 'Gi00290' );
    $genomeObj->sequencingStatus( 'incomplete' );
  }
  elsif ( $name =~ /Gallionella capsiferriformans/ ) {
    my $SpeciesArr = $dbmaster->Species->get_objects( { 'name' => 'Gallionella ferruginea' } );
    $genomeObj = createGenome( $dbmaster, $SpeciesArr->[0], [], undef, undef, $name );
    $genomeObj->InGOLD( 1 );
    $genomeObj->InBergey( 0 );
    $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
    $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
  }
  elsif ( $name =~ /Mycobacterium flavenscens/ ) {
    my $SpeciesArr = $dbmaster->Species->get_objects( { 'name' => 'Mycobacterium flavescens' } );
    $genomeObj = createGenome( $dbmaster, $SpeciesArr->[0], [ 'PYR-GCK' ], undef, undef, $name );
    $genomeObj->InGOLD( 1 );
    $genomeObj->InBergey( 0 );
    $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
    $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
  }
  elsif ( $name =~ /Erwinia carotovora (SCRI1043)/ ) {
    my $SpeciesArr = $dbmaster->Species->get_objects( { 'name' => 'Erwinia carotovora carotovora' } );
    my $strainsarr = [ $1 ];
    $genomeObj = createGenome( $dbmaster, $SpeciesArr->[0], $strainsarr, undef, $1 );
    $genomeObj->InGOLD( 1 );
    $genomeObj->InBergey( 0 );
    $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
    $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
  }
  elsif ( $name =~ /Methanothermobacter thermoautotrophicus/ ) {
    my $GenomeArr = $dbmaster->Genome->get_objects( { 'name' => 'Methanothermobacter thermautotrophicus' } );
    $genomeObj = $GenomeArr->[0];
    $genomeObj->InGOLD( 1 );
    $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
    $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
    my $sas = [ 'Delta H', 'ATCC 29096', 'DSM 1053', 'JCM 10044', 'NBRC 100330', 'OCM 143', 'VKM B-1908' ];
    $genomeObj->strainAliases( $sas );
  }
  elsif ( $name =~ /Thermococcus kodakaraensis/ ) {
    my $GenomeArr = $dbmaster->Genome->get_objects( { 'name' => 'Thermococcus kodakarensis' } );
    $genomeObj = $GenomeArr->[0];
    $genomeObj->InGOLD( 1 );
    $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
    $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
    my $sas = [ 'KOD1', 'ATCC BAA-918', 'JCM 12380' ];
    $genomeObj->strainAliases( $sas );
  }
#  elsif ( $name =~ /Caminibacter mediatlanticus/ ) {
#    my $GenusArr = $dbmaster->Genus->get_objects( { 'name' => 'Caminibacter' } );
#    my $Genus = $GenusArr->[0];
#    my $Species = createSpecies( $dbmaster, $name, undef, $Genus );
#    my $strainsarr = [ 'TB-2', 'DSM 16658' ];
#    $genomeObj = createGenome( $dbmaster, $Species, $strainsarr, undef, 'TB-2' );
#    $genomeObj->InGOLD( 1 );
#    $genomeObj->InBergey( 0 );
#    $genomeObj->goldstamp( 'Gi01407' );
#    $genomeObj->sequencingStatus( 'incomplete' );
#  }
  elsif ( $name =~ /Prochlorococcus elongatus/ ) {
    my $GenusArr = $dbmaster->Genus->get_objects( { 'name' => 'Mannheimia' } );
    my $Genus = $GenusArr->[0];
    my $Species = createSpecies( $dbmaster, 'Prochlorococcus elongatus', undef, $Genus );
    $Species->added( 1 );
    my $strainsarr = [ 'PCC7942' ];
    $genomeObj = createGenome( $dbmaster, $Species, $strainsarr, undef, undef, $name );
    $genomeObj->InGOLD( 1 );
    $genomeObj->InBergey( 0 );
    $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
    $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
  }
  elsif ( $name =~ /Mannheimia succinici/ ) {
    my $GenusArr = $dbmaster->Genus->get_objects( { 'name' => 'Mannheimia' } );
    my $Genus = $GenusArr->[0];
    my $Species = createSpecies( $dbmaster, 'Mannheimia succiniciproducens', undef, $Genus );
    $Species->added( 1 );
    my $strainsarr = [ 'MBEL55E' ];
    $genomeObj = createGenome( $dbmaster, $Species, $strainsarr, undef, undef, $name );
    $genomeObj->InGOLD( 1 );
    $genomeObj->InBergey( 0 );
    $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
    $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
  }
  elsif ( $name =~ /Pyrobaculum calidifontis/ ) {
    my $GenusArr = $dbmaster->Genus->get_objects( { 'name' => 'Pyrobaculum' } );
    my $Genus = $GenusArr->[0];
    my $Species = createSpecies( $dbmaster, $name, undef, $Genus );
    $Species->added( 1 );
    my $strainsarr = [];
    $genomeObj = createGenome( $dbmaster, $Species, $strainsarr, undef, undef, $name );
    $genomeObj->InGOLD( 1 );
    $genomeObj->InBergey( 0 );
    $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
    $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
  }
  elsif ( $name =~ /Corynebacterium thermoaminogenes/ ) {
    my $GenusArr = $dbmaster->Genus->get_objects( { 'name' => 'Corynebacterium' } );
    my $Genus = $GenusArr->[0];
    my $Species = createSpecies( $dbmaster, $name, undef, $Genus );
    $Species->added( 1 );
    my $strainsarr = [ 'FERM9246' ];
    $genomeObj = createGenome( $dbmaster, $Species, $strainsarr, undef, 'FERM9246' );
    $genomeObj->InGOLD( 1 );
    $genomeObj->InBergey( 0 );
    $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
    $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
  }
  elsif ( $name =~ /Vibrio angustum/ ) {
    my $GenusArr = $dbmaster->Genus->get_objects( { 'name' => 'Vibrio' } );
    my $Genus = $GenusArr->[0];
    my $Species = createSpecies( $dbmaster, $name, undef, $Genus );
    $Species->added( 1 );
    my $strainsarr = [ 'S14' ];
    $genomeObj = createGenome( $dbmaster, $Species, $strainsarr, undef, undef, $name );
    $genomeObj->InGOLD( 1 );
    $genomeObj->InBergey( 0 );
    $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
    $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
  }
  elsif ( $name =~ /Colwellia psychroerythraea/ ) {
    my $SpeciesArr = $dbmaster->Species->get_objects( { 'name' => 'Colwellia psychrerythrea' } );
    my $strainsarr = [ '34H', 'ATCC BAA-681' ];
    $genomeObj = createGenome( $dbmaster, $SpeciesArr->[0], $strainsarr, undef, '34H', 'Colwellia psychroerythraea' );
    $genomeObj->InGOLD( 1 );
    $genomeObj->InBergey( 0 );
    $genomeObj->goldstamp( 'Gc00280' );
    $genomeObj->sequencingStatus( 'complete' );
  }
  elsif ( $name =~ /Myxococcus xanthus./ || $name =~ /Corynebacterium glutamicum./ ) {
    if ( $name =~ /^(.* .*)\.$/ ) {
      my $rightname = $1;
      my $SpeciesArr = $dbmaster->Species->get_objects( { 'name' => $rightname } );
      $genomeObj = createGenome( $dbmaster, $SpeciesArr->[0], [], undef, undef, $name );
      $genomeObj->InGOLD( 1 );
      $genomeObj->InBergey( 0 );
      $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
      $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
    }
  }
  elsif ( $name =~ /Campylobacter jejuni./ ) {
      my $SpeciesArr = $dbmaster->Species->get_objects( { 'name' => 'Campylobacter jejuni subsp. jejuni' } );
      $genomeObj = createGenome( $dbmaster, $SpeciesArr->[0], [], undef, undef, $name );
      $genomeObj->InGOLD( 1 );
      $genomeObj->InBergey( 0 );
      $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
      $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
  }
  elsif ( $name =~ /Xylella fastidiosa/ ) {
      my $SpeciesArr = $dbmaster->Species->get_objects( { 'name' => 'Xylella fastidiosa' } );
      $genomeObj = createGenome( $dbmaster, $SpeciesArr->[0], [], undef, undef, $name );
      $genomeObj->InGOLD( 1 );
      $genomeObj->InBergey( 0 );
      $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
      $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
  }
  elsif ( $name =~ /Xanthomonas axonopodis/ || $name =~ /Xanthomonas smithii/ ) {
      my $SpeciesArr = $dbmaster->Species->get_objects( { 'name' => 'Xanthomonas axonopodis' } );
      $genomeObj = createGenome( $dbmaster, $SpeciesArr->[0], [], undef, undef, $name );
      $genomeObj->InGOLD( 1 );
      $genomeObj->InBergey( 0 );
      $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
      $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
  }
  elsif ( $name =~ /Xanthomonas oryzae/ ) {
      my $SpeciesArr = $dbmaster->Species->get_objects( { 'name' => 'Xanthomonas oryzae' } );
      $genomeObj = createGenome( $dbmaster, $SpeciesArr->[0], [], undef, undef, $name );
      $genomeObj->InGOLD( 1 );
      $genomeObj->InBergey( 0 );
      $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
      $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
  }
  elsif ( $name =~ /(Pseudomonas \w+)/ ) {
    my $spec = $1;
    my $GenusArr = $dbmaster->Genus->get_objects( { 'name' => 'Pseudomonas' } );
    my $Genus = $GenusArr->[0];
    my $Species = createSpecies( $dbmaster, $spec, undef, $Genus );
    $Species->added( 1 );
    my $strain = $goldObject->{ 'STRAIN' };
    my $strainsarr = [ $strain ];
    $genomeObj = createGenome( $dbmaster, $Species, $strainsarr, undef, undef, $name );
    $genomeObj->InGOLD( 1 );
    $genomeObj->InBergey( 0 );
    $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
    $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
  }
  elsif ( $name =~ /Dechloromonas aromatica/ ) {
    my $GenusArr = $dbmaster->Genus->get_objects( { 'name' => 'Dechloromonas' } );
    my $Genus = $GenusArr->[0];
    my $Species = createSpecies( $dbmaster, 'Dechloromonas aromatica', undef, $Genus );
    $Species->added( 1 );
    my $strain = $goldObject->{ 'STRAIN' };
    my $strainsarr = [ $strain ];
    $genomeObj = createGenome( $dbmaster, $Species, $strainsarr, undef, undef, $name );
    $genomeObj->InGOLD( 1 );
    $genomeObj->InBergey( 0 );
    $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
    $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
  }
  elsif ( $name =~ /Sulfolobus islandicus/ ) {
    my $GenusArr = $dbmaster->Genus->get_objects( { 'name' => 'Sulfolobus' } );
    my $Genus = $GenusArr->[0];
    my $Species = createSpecies( $dbmaster, $name, undef, $Genus );
    $Species->added( 1 );
    my $strain = $goldObject->{ 'STRAIN' };
    my $strainsarr = [ $strain ];
    $genomeObj = createGenome( $dbmaster, $Species, $strainsarr, undef, undef );
    $genomeObj->InGOLD( 1 );
    $genomeObj->InBergey( 0 );
    $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
    $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
  }
  elsif ( $name =~ /Pyrococcus abyssi/ ) {
    my $GenusArr = $dbmaster->Genus->get_objects( { 'name' => 'Pyrococcus' } );
    my $Genus = $GenusArr->[0];
    my $Species = createSpecies( $dbmaster, 'Pyrococcus abyssi', undef, undef, $name );
    $Species->added( 1 );
    my $strain = $goldObject->{ 'STRAIN' };
    my $strainsarr = [ $strain ];
    $genomeObj = createGenome( $dbmaster, $Species, $strainsarr, undef, undef, $name );
    $genomeObj->InGOLD( 1 );
    $genomeObj->InBergey( 0 );
    $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
    $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
  }
#  elsif ( $name =~ /Deinococcus deserti/ ) {
#    my $GenusArr = $dbmaster->Genus->get_objects( { 'name' => 'Deinococcus' } );
#    my $Species = createSpecies( $dbmaster, "Deinococcus deserti", undef, $GenusArr->[0] );
#    my $strainsarr = [ 'VCD115', 'DSM 17065', 'LMG 22923' ];
#    $genomeObj = createGenome( $dbmaster, $Species, $strainsarr, undef, undef, 'Deinococcus deserti' );
#    $genomeObj->InGOLD( 1 );
#    $genomeObj->InBergey( 0 );
#    $genomeObj->typeStrain( 1 );
#    $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
#    $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
#  }
#  elsif ( $name =~ /Parvibaculum lavamentivorans/ ) {
#    my $FamilyArr = $dbmaster->Family->get_objects( { 'name' => 'Phyllobacteriaceae' } );
#    my $Family = $FamilyArr->[0];
#    my $Genus = createGenus( $dbmaster, "Parvibaculum", undef, $Family, 0 );
#    my $Species = createSpecies( $dbmaster, "Parvibaculum lavamentivorans", undef, $Genus );
#    my $strain = $goldObject->{ 'STRAIN' };
#    my $strainsarr = [ $strain ];
#    $genomeObj = createGenome( $dbmaster, $Species, $strainsarr, undef, 'DS-1' );
#    $genomeObj->InGOLD( 1 );
#    $genomeObj->InBergey( 0 );
#    $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
#    $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
#  }
  elsif ( $name =~ /Blochmannia/ ) {
    my $FamilyArr = $dbmaster->Family->get_objects( { 'name' => 'Enterobacteriaceae' } );
    my $Family = $FamilyArr->[0];
    my $Genus = createGenus( $dbmaster, "Candidatus Blochmannia", undef, $Family, 0 );
    my $specname = $goldObject->{ 'genus' } . " " . $goldObject->{ 'species' };
    my $Species = createSpecies( $dbmaster, $specname, undef, $Genus );
    my $strain = $goldObject->{ 'STRAIN' };
    my $strainsarr;
    if ( defined( $strain ) ) {
      $strainsarr = [ $strain ];
    }
    $genomeObj = createGenome( $dbmaster, $Species, $strainsarr, undef, $strain );
    $genomeObj->InGOLD( 1 );
    $genomeObj->InBergey( 0 );
    $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
    $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
  }
#  elsif ( $name =~ /Collimonas/ ) {
#    my $FamilyArr = $dbmaster->Family->get_objects( { 'name' => 'Oxalobacteraceae' } );
#    my $Family = $FamilyArr->[0];
#    my $Genus = createGenus( $dbmaster, "Collimonas", undef, $Family, 0 );
#    my $specname = $goldObject->{ 'genus' } . " " . $goldObject->{ 'species' };
#    my $Species = createSpecies( $dbmaster, $specname, undef, $Genus );
#    my $strain = $goldObject->{ 'STRAIN' };
#    my $strainsarr;
#    if ( defined( $strain ) ) {
#      $strainsarr = [ $strain ];
#    }
#    $genomeObj = createGenome( $dbmaster, $Species, $strainsarr, undef, $strain );
#    $genomeObj->InGOLD( 1 );
#    $genomeObj->InBergey( 0 );
#    $genomeObj->typeStrain( 1 );
#    $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
#    $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
#  }
  elsif ( $name =~ /Burkholderia/ || $name =~ /Shewanella/ || $name =~ /Geobacter/ ) {
    my $GenusArr = $dbmaster->Genus->get_objects( { 'name' => $goldObject->{ 'genus' } } );
    my $specname = $goldObject->{ 'genus' } . " " . $goldObject->{ 'species' };
    my $Species = createSpecies( $dbmaster, $specname, undef, $GenusArr->[0] );
    my $strain = $goldObject->{ 'STRAIN' };
    my $strainsarr;
    if ( defined( $strain ) ) {
      $strainsarr = [ $strain ];
    }
    $genomeObj = createGenome( $dbmaster, $Species, $strainsarr, undef, $strain );
    $genomeObj->InGOLD( 1 );
    $genomeObj->InBergey( 0 );
    $genomeObj->goldstamp( $goldObject->{ 'GOLDSTAMP' } );
    $genomeObj->sequencingStatus( $goldObject->{ 'STATUS' } );
  }
  else {
    print STDERR "NOTINYET: $outputname ". $goldObject->{ 'GOLDSTAMP' }."\n";
  }
  
  return ( $genomeObj, $species );
}


sub getStrainsFromCollection {

  my ( $dbmaster, $mergedHash, $g ) = @_;

}


sub searchGenome {

  my ( $dbmaster, $hash, $g ) = @_;

  my $genus = $hash->{ 'genus' };
  my $species = $hash->{ 'species' };    
  my $specaff = $hash->{ 'specaff' };

  my $searchname = $genus;
  if ( defined( $species ) ) {
    $searchname = $species;
  }
  elsif ( defined( $specaff ) ) {
    $searchname = $searchname." ".$specaff;
  }

  print STDERR "searching for $searchname...\n";
  
  my $genomeObjArr = $dbmaster->Genome->get_objects( { 'name' => $searchname } );
  if ( defined( $genomeObjArr->[0] ) ) {
    print STDERR "FOUND GENOME ".$genomeObjArr->[0]->name."\n";
    return $genomeObjArr->[0];
  }
  else {
    print STDERR "found nothing :( \n";
    return undef;
  }

}

sub createNCBIObject {

  my ( $dbmaster, $bhash ) = @_;

  my $domain;
  my $phylum;
  my $class;
  my $gorder;
  my $family;
  my $genus;
  my $species;

  if ( defined( $bhash->{ 'genus' } ) ) {
    $genus = createGenus( $dbmaster, $bhash->{ 'genus' }, undef, $family, $bhash->{ 'form' } );
    if ( !defined( $genus->{'Family'} ) ) {

      my $fam = $bhash->{ 'family' };

      my $familyarr = $dbmaster->Family->get_objects( { 'name' => $fam } );
      if ( defined( $familyarr->[0] ) ) {
	$genus->Family( $family->[0] );
#	print STDERR $bhash->{ 'genus' }. " and " . $family->[0]->name ."\n";
      }
#      print STDERR $bhash->{ 'genus' }."\n";
    }
  }
 
  return ( $domain, $phylum, $class, $gorder, $family, $genus, $species );

  
}

sub createBergeysObject {
  
  my ( $dbmaster, $bhash, $cov ) = @_;

  my $domain;
  my $phylum;
  my $class;
  my $gorder;
  my $family;
  my $genus;
  my $species;

  if ( !defined( $bhash->{ 'domain' } ) ) {
    print STDERR "Error ".$bhash->{ 'genus' }."\n";
  }
  else {
    $domain = createDomain( $dbmaster, $bhash->{ 'domain' } );
  }
  if ( !defined( $bhash->{ 'phyla' } ) ) {
    print STDERR "Error ".$bhash->{ 'genus' }."\n";
  }
  else {
    $phylum = createPhylum( $dbmaster, $bhash->{ 'phyla' }, $domain );
  }
  if ( !defined( $bhash->{ 'class' } ) ) {
    print STDERR "Error ".$bhash->{ 'genus' }."\n";
  }
  else {
    $class = createClass( $dbmaster, $bhash->{ 'class' }, $phylum );
  }
  if ( !defined( $bhash->{ 'gorder' } ) ) {
    print STDERR "Error ".$bhash->{ 'genus' }."\n";
  }
  else {
    $gorder = createGOrder( $dbmaster, $bhash->{ 'gorder' }, $class );
  }
  if ( !defined( $bhash->{ 'family' } ) ) {
    print STDERR "Error ".$bhash->{ 'genus' }."\n";
  }
  else {
    $family = createFamily( $dbmaster, $bhash->{ 'family' }, $gorder );
  }
  if ( !defined( $bhash->{ 'genus' } ) ) {
    print STDERR "Error ".$bhash->{ 'genus' }."\n";
  }
  else {
    $genus = createGenus( $dbmaster, $bhash->{ 'genus' }, $family, $bhash->{ 'form' } );
  }
  if ( !defined( $bhash->{ 'species' } ) ) {
    print STDERR "Error ".$bhash->{ 'species' }."\n";
  }
  else {
    $species = createSpecies( $dbmaster, $bhash->{ 'species' }, undef, $genus, $cov );
  }
 
  return ( $domain, $phylum, $class, $gorder, $family, $genus, $species );
}

sub mergeData {

  my ( $genomedatahash, $bergeyhash, $goldhash, $ncbihash, $dmszhash, $CCUGhash, $addhash, $garrityhash, $jimcolehash ) = @_;

  my $mergedhash;

  foreach my $g ( keys %$genomedatahash ) {

      $mergedhash->{ $g }->{ 'GenomeData' } = 1;
      $mergedhash->{ $g }->{ 'GenomeDataObject' } = $genomedatahash->{ $g };

  }

  foreach my $g ( keys %$bergeyhash ) {

      $mergedhash->{ $g }->{ 'Bergey' } = 1;
      $mergedhash->{ $g }->{ 'BergeyObject' } = $bergeyhash->{ $g };

  }

  foreach my $g ( keys %$goldhash ) {

      $mergedhash->{ $g }->{ 'Gold' } = 1;
      $mergedhash->{ $g }->{ 'GoldObject' } = $goldhash->{ $g };

  }

  foreach my $g ( keys %$ncbihash ) {

      $mergedhash->{ $g }->{ 'NCBI' } = 1;
      $mergedhash->{ $g }->{ 'NCBIObject' } = $ncbihash->{ $g };

  }

  foreach my $g ( keys %$dmszhash ) {
    
    $mergedhash->{ $g }->{ 'DSMZ' } = 1;
    $mergedhash->{ $g }->{ 'DSMZObject' } = $dmszhash->{ $g };

  }

  foreach my $g ( keys %$CCUGhash ) {

      $mergedhash->{ $g }->{ 'CCUG' } = 1;
      $mergedhash->{ $g }->{ 'CCUGObject' } = $CCUGhash->{ $g };

  }

  foreach my $g ( keys %$addhash ) {

      $mergedhash->{ $g }->{ 'add' } = 1;
      $mergedhash->{ $g }->{ 'addObject' } = $addhash->{ $g };

  }

  foreach my $g ( keys %$garrityhash ) {

      $mergedhash->{ $g }->{ 'Garrity' } = 1;
      $mergedhash->{ $g }->{ 'GarrityObject' } = $garrityhash->{ $g };

  }

  foreach my $g ( keys %$jimcolehash ) {

      $mergedhash->{ $g }->{ 'Jimcole' } = 1;
      $mergedhash->{ $g }->{ 'JimcoleObject' } = $jimcolehash->{ $g };

  }

  return $mergedhash;
}

sub createPublication {

  my ( $dbmaster, $pub1, $pub2, $pub3 ) = @_;
  my $Publication;

  my $year = undef;
  my $url = undef;
  my $journal = undef;
  my $number = undef;
  my $pages = undef;

  if ( ( !defined( $pub1 ) || $pub1 eq '' ) && ( !defined( $pub2 ) || $pub2 eq '' ) && ( !defined( $pub3 ) || $pub3 eq '' ) ) {
    return undef;
  }

  if ( defined( $pub2 ) && $pub2 ne '' ) {
    $year = $pub2;
  }

  my $pubmed = $pub3;
  if ( !defined( $pubmed ) || $pubmed eq '' ) {
    if ( defined( $pub1 ) && ( $pub1 =~ /\d+/ ) ) {
      $pubmed = $pub1;
      $pub1 = undef;
    }
    else {
      $pubmed = '';
    }
  }
  
  if ( defined( $pub1 ) ) {

    if ( $pub1 =~ /complete/ ) {
      return undef;
    }
    elsif ( $pub1 =~ /\"(.*)\s(\d+),\s?(\d+\-\d+)\"/ ) {
      $journal = $1;
      $number = $2;
      $pages = $3;
    }
  }

  $Publication = $dbmaster->Publication->create( { 'pubmed' => $pubmed, 
						   'url'   => $url,
						   'year'  => $year,
						   'journal' => $journal,
						   'number' => $number,
						   'pages' => $pages } );
  return $Publication;
}

sub getGenomeDatabase {
  
  my ( $dbmaster, $text ) = @_;
  
  if ( !defined( $text ) || $text eq "" ) {
    return undef;
  }

  my ( $name, $url );
  
  if ( $text =~ /\<a href\=\"\"(http\:.*)\"\"\>(.*)\</ ) {
    $name = $2;
    $url = $1;
  }
  else {
    $name = $text;
  }

  my $GenomeDatabase = undef;
  
  if ( defined( $url ) ) {
    my $arr = $dbmaster->GenomeDatabase->get_objects( { 'url' => $url } );
    $GenomeDatabase = $arr->[0];
    if ( defined( $GenomeDatabase ) ) {
      return $GenomeDatabase;
    }
  }
  elsif ( defined( $name ) ) {
    my $arr = $dbmaster->GenomeDatabase->get_objects( { 'name' => $name } );
    $GenomeDatabase = $arr->[0];
    if ( defined( $GenomeDatabase ) ) {
      return $GenomeDatabase;
    }
  }
  
  $GenomeDatabase = $dbmaster->GenomeDatabase->create( { 'url'   => $url,
							 'name'  => $name } );
  return $GenomeDatabase;
}

sub getInstitution {
  
  my ( $dbmaster, $text ) = @_;
  
  if ( !defined( $text ) || $text eq "" ) {
    return undef;
  }

  my ( $name, $url );
  
  if ( $text =~ /\<a href\=\"\"(http\:.*)\"\"\>(.*)\</ ) {
    $name = $2;
    $url = $1;
  }
  else {
    $name = $text;
  }

  my $Institution = undef;
  
  if ( defined( $url ) ) {
    my $arr = $dbmaster->Institution->get_objects( { 'url' => $url } );
    $Institution = $arr->[0];
    if ( defined( $Institution ) ) {
      return $Institution;
    }
  }
  elsif ( defined( $name ) ) {
    my $arr = $dbmaster->Institution->get_objects( { 'name' => $name } );
    $Institution = $arr->[0];
    if ( defined( $Institution ) ) {
      return $Institution;
    }
  }
  
  $Institution = $dbmaster->Institution->create( { 'url'   => $url,
						   'name'  => $name } );
  return $Institution;
}

sub getHabitat {
  
  my ( $hab1, $hab2, $hab3 ) = @_;
  my $habitat = undef;
  
  if ( ( !defined( $hab1 ) || ( $hab1 eq '' ) ) && ( !defined( $hab2 ) || ( $hab2 eq '' ) ) && ( !defined( $hab3 ) || ( $hab3 eq '' ) ) ) {
    return undef;
  }

  if ( defined( $hab2 ) && ( $hab2 ne '' ) ) {
    if ( $hab2 =~ /\"(.*)\"/ ) {
      $hab2 = $1;
    }
    if ( defined( $hab3 ) && ( $hab3 ne '' ) ) {
      $habitat = $hab2 . " ( $hab3 )";
    }
    else {
      $habitat = $hab2;
    }
  }
  elsif ( defined( $hab1 ) && ( $hab1 ne '' ) ) {
    if ( defined( $hab3 ) && ( $hab3 ne '' ) ) {
      $habitat = $hab1 . " ( $hab3 )";
    }
    else {
      $habitat = $hab1;
    }
  }  
  else {
    $habitat = $hab3;
  }
}

sub createContact {
  
  my ( $dbmaster, $text ) = @_;
  
  if ( !defined( $text ) || $text eq "" ) {
    return undef;
  }

  my ( $name, $url, $email );
  
  if ( $text =~ /\<a href\=\"\"(http\:.*)\"\"\>(.*)\</ ) {
    $name = $2;
    $url = $1;
  }
  elsif ( $text =~ /\<a href\=\"\"mailto\:(.*)\"\"\>(.*)\</ ) {
    $name = $2;
    $email = $1;
  }
  else {
    $name = $text;
  }

  my $Contact = undef;

  if ( defined( $url ) ) {
    my $arr = $dbmaster->Contact->get_objects( { 'url' => $url } );
    $Contact = $arr->[0];
    if ( defined( $Contact ) ) {
      return $Contact;
    }
  }
  elsif ( defined( $email ) ) {
    my $arr = $dbmaster->Contact->get_objects( { 'email' => $email } );
    $Contact = $arr->[0];
    if ( defined( $Contact ) ) {
      return $Contact;
    }
  }
  elsif ( defined( $name ) ) {
    my $arr = $dbmaster->Contact->get_objects( { 'name' => $name } );
    $Contact = $arr->[0];
    if ( defined( $Contact ) ) {
      return $Contact;
    }
  }

  $Contact = $dbmaster->Contact->create( { 'url'   => $url,
					   'email' => $email,
					   'name'  => $name } );
  return $Contact;
}

###########################################
# use this method to create a new species #
###########################################
sub createSpecies {

  my ( $dbmaster, $speci, $taxDOI, $Genus, $cov ) = @_;

  my $Speciesarr = $dbmaster->Species->get_objects( { 'name' => $speci } );
  
  # look if we got this GenomeAlias already - easy mode
  my $genomeAliasArr = $dbmaster->GenomeAlias->get_objects( { 'name' => $speci } );
  my $taxid;
  if ( defined( $genomeAliasArr->[0] ) ) {
    $taxid = $genomeAliasArr->[0]->taxid;
  }
  # now lets look at things where we have a subspecies
  if ( $speci =~ /(.+ .+) (.+)/ ) {
    my $newname = $1." subsp. ".$2;
    my $genomeAliasArr2 = $dbmaster->GenomeAlias->get_objects( { 'name' => $newname } );
    if ( defined( $genomeAliasArr2->[0] ) ) {
      $taxid = $genomeAliasArr2->[0]->taxid;
    }
  }
  # what if it's a constructed name due to another subspecies?
  if ( $speci =~ /(.+) (.+) (.+)/ ) {
    if ( $2 eq $3 ) {
      my $newname = $1." ".$2;
      my $genomeAliasArr2 = $dbmaster->GenomeAlias->get_objects( { 'name' => $newname } );
      if ( defined( $genomeAliasArr2->[0] ) ) {
	$taxid = $genomeAliasArr2->[0]->taxid;
      }
    }
  }
  # now lets remove things in brackets
  if ( $speci =~ /(.+) \(.+\) (.+)/ ) {
    my $newname = $1.' '.$2;
    my $genomeAliasArr2 = $dbmaster->GenomeAlias->get_objects( { 'name' => $newname } );
    if ( defined( $genomeAliasArr2->[0] ) ) {
      $taxid = $genomeAliasArr2->[0]->taxid;
    }
  }


  if ( defined( $Speciesarr->[0] ) ) {
    $Speciesarr->[0]->taxid( $taxid );
    return $Speciesarr->[0];
  }

  # create a new one
  my $Species = $dbmaster->Species->create( { 'name'   => $speci,
					      'Genus'  => $Genus,
					      'taxDOI' => $taxDOI,
					      'taxid'  => $taxid } );
  $Species->computedscore( $cov );
  return $Species;

}

#########################################
# use this method to create a new genus #
#########################################
sub createGenus {

  my ( $dbmaster, $gens, $taxDOI, $family, $form ) = @_;

  if ( !defined( $form ) ) {
    $form = 0;
  }

  # look if we got this Genus already
  my $Genusarr = $dbmaster->Genus->get_objects( { 'name' => $gens } );
  if ( defined( $Genusarr->[0] ) ) {
    return $Genusarr->[0];
  }
  if ( !defined( $family ) ) {
    my $Genus = $dbmaster->Genus->create( { 'name'   => $gens,
					    'taxDOI' => $taxDOI,
					    'form'   => $form } );
    return $Genus;
  }
  else {
    # create a new one
    my $Genus = $dbmaster->Genus->create( { 'name'   => $gens,
					    'Family' => $family,
					    'taxDOI' => $taxDOI,
					    'form'   => $form } );
    return $Genus;
  }

}

##########################################
# use this method to create a new domain #
##########################################
sub createDomain {

  my ( $dbmaster, $domain, $taxDOI ) = @_;

  # look if we got this Domain already
  my $Domainarr = $dbmaster->Domain->get_objects( { 'name' => $domain } );
  if ( defined( $Domainarr->[0] ) ) {
    return $Domainarr->[0];
  }

  # create a new one
  my $Domain = $dbmaster->Domain->create( { 'name'   => $domain,
					    'taxDOI' => $taxDOI } );
  return $Domain;

}

##########################################
# use this method to create a new phylum #
##########################################
sub createPhylum {

  my ( $dbmaster, $phylum, $taxDOI, $domain ) = @_;

  # look if we got this Phylum already
  my $Phylumarr = $dbmaster->Phyla->get_objects( { 'name'   => $phylum,
						   'taxDOI' => $taxDOI,
						   'Domain' => $domain } );
  if ( defined( $Phylumarr->[0] ) ) {
    return $Phylumarr->[0];
  }

  # create a new one
  my $Phylum = $dbmaster->Phyla->create( { 'name'   => $phylum,
					   'taxDOI' => $taxDOI,
					   'Domain' => $domain } );
  return $Phylum;

}

#########################################
# use this method to create a new class #
#########################################
sub createClass {

  my ( $dbmaster, $class, $taxDOI, $phylum ) = @_;

  # look if we got this Class already
  my $Classarr = $dbmaster->Class->get_objects( { 'name'   => $class,
						  'taxDOI' => $taxDOI,
						  'Phyla' => $phylum } );
  if ( defined( $Classarr->[0] ) ) {
    return $Classarr->[0];
  }

  # create a new one
  my $Class = $dbmaster->Class->create( { 'name'   => $class,
					  'taxDOI' => $taxDOI,
					  'Phyla' => $phylum} );
  return $Class;

}

##############################################
# use this method to create a new STScluster #
##############################################
sub createSTScluster {

  my ( $dbmaster, $number ) = @_;

  my $Cluster;

  # look if we got this STScluster already
  my $Clusterarr = $dbmaster->STScluster->get_objects( { 'number'            => $number } );
  if ( defined( $Clusterarr->[0] ) ) {
    $Cluster = $Clusterarr->[0];
  }
  else {
    # create a new one
    $Cluster = $dbmaster->STScluster->create( { 'number'            => $number,
						'seqrepresentation' => 0 } );
  }

  my $spechash;
  my $genomes = $dbmaster->Genome->get_objects( { 'STScluster' => $Cluster } );
  foreach my $genome (@$genomes) {
    $spechash->{ $genome->Species->_id } = $genome->Species->litNum ;
  }

  my $litnum = 0;
  foreach my $spec ( values %$spechash ) {
    $litnum += $spec;
  }
  $Cluster->litCount( $litnum );

  return $Cluster;

}

#########################################
# use this method to create a new Order #
#########################################
sub createGOrder {

  my ( $dbmaster, $gorder, $taxDOI, $class ) = @_;

  # look if we got this order already
  my $Gorderarr = $dbmaster->GOrder->get_objects( { 'name'   => $gorder,
						    'taxDOI' => $taxDOI,
						    'Class' => $class } );
  if ( defined( $Gorderarr->[0] ) ) {
    return $Gorderarr->[0];
  }

  # create a new one
  my $Gorder = $dbmaster->GOrder->create( { 'name'   => $gorder,
					    'taxDOI' => $taxDOI,
					    'Class' => $class} );
  return $Gorder;

}

##########################################
# use this method to create a new Family #
##########################################
sub createFamily {

  my ( $dbmaster, $family, $taxDOI, $gorder ) = @_;

  # look if we got this family already
  my $Familyarr = $dbmaster->Family->get_objects( { 'name'   => $family,
						    'taxDOI' => $taxDOI,
						    'GOrder' => $gorder } );
  if ( defined( $Familyarr->[0] ) ) {
    return $Familyarr->[0];
  }

  # create a new one
  my $Family = $dbmaster->Family->create( { 'name'   => $family,
					    'taxDOI' => $taxDOI,
					    'GOrder' => $gorder} );
  return $Family;

}

##########################################
# use this method to create a new Genome #
##########################################
sub createGenome {

  my ( $dbmaster, $Species, $strains, $specaff, $takestrainname, $diffGenomeName ) = @_;

  # construct the name of the Genome #
  my $name;
  if ( defined( $diffGenomeName ) ) {
    # diffGenomeName is used for the case that the Genome name should not be
    # constructed from the Species / Strain name
    $name = $diffGenomeName;
  }
  else {
    # construct Genome name from Species / Strain information
    if ( defined( $Species ) ) {
      $name = $Species->name;
    }
    if ( defined( $specaff ) ) {
      $name = $name . " " . $specaff;
    }
    if ( defined( $takestrainname ) ) {
      $name = $name . " " . $takestrainname;
    }
  }

  # now let's look if the name already exists
  my $Genomearr = $dbmaster->Genome->get_objects( { 'name'   => $name } );

  my $genomeAliasArr = $dbmaster->GenomeAlias->get_objects( { 'name' => $name } );

  # get the taxid here
  my $taxid;
  if ( defined( $genomeAliasArr->[0] ) ) {
    $taxid = $genomeAliasArr->[0]->taxid;
  }
  # now lets look at things where we have a subspecies
  if ( $name =~ /(.+ .+) (.+)/ ) {
    my $newname = $1." subsp. ".$2;
    my $genomeAliasArr2 = $dbmaster->GenomeAlias->get_objects( { 'name' => $newname } );
    if ( defined( $genomeAliasArr2->[0] ) ) {
      $taxid = $genomeAliasArr2->[0]->taxid;
    }
  }
  # what if it's a constructed name due to another subspecies?
  if ( $name =~ /(.+) (.+) (.+)/ ) {
    if ( $2 eq $3 ) {
      my $newname = $1." ".$2;
      my $genomeAliasArr2 = $dbmaster->GenomeAlias->get_objects( { 'name' => $newname } );
      if ( defined( $genomeAliasArr2->[0] ) ) {
	$taxid = $genomeAliasArr2->[0]->taxid;
      }
    }
  }
  # now lets remove things in brackets
  if ( $name =~ /(.+) \(.+\) (.+)/ ) {
    my $newname = $1.' '.$2;
    my $genomeAliasArr2 = $dbmaster->GenomeAlias->get_objects( { 'name' => $newname } );
    if ( defined( $genomeAliasArr2->[0] ) ) {
      $taxid = $genomeAliasArr2->[0]->taxid;
    }
  }
  
  # if there is already a genome with that name, take it and 
  # put the taxid and the strainAliases in
  if ( defined( $Genomearr->[0] ) ) {
    my $thisgenome = $Genomearr->[0];
    if ( defined( $strains ) ) {
      $thisgenome->strainAliases( $strains );
    }
    $thisgenome->taxid( $taxid );
    return $thisgenome;
  }
  
  # You only get here if there exists no genome yet. 
  # So let's create a new one
  my $Genome = $dbmaster->Genome->create( { 'name'           => $name,
					    'Species'        => $Species,
					    'strainAliases'  => $strains,
					    'taxid'          => $taxid } );
  $Genome->strainAliases( $strains );
  return $Genome;

}

sub createGenomeSequenceObject {

  my ( $dbmaster, $Genome, $size ) = @_;

  
  my $Genomearr = $dbmaster->GenomeSequence->get_objects( { 'sequenceLength' => $size,
							    'Genome'         => $Genome } );
  if ( defined( $Genomearr->[0] ) ) {
    return $Genomearr->[0];
  }

  my $GenomeSequence = $dbmaster->GenomeSequence->create( { 'sequenceLength' => $size,
							    'Genome'         => $Genome } );
  return $GenomeSequence;
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3