diff --git a/docs/schema_description/README b/docs/schema_description/README index c7b99a25ba15f46055f3806472f6aa4690c42b48..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/docs/schema_description/README +++ b/docs/schema_description/README @@ -1,23 +0,0 @@ -Generating the Schema Descriptions - -The tables.txt and tables.html files are generated automatically from -the tables.xml. This requires an XML processor called Saxon which can -be downloaded from http://saxon.sourceforge.net/ - -When Saxon has been downloaded and installed, edit process-saxon.sh -and make sure that the -jar argument in each of the two Java calls -points to the location of your saxon7.jar file. - -Then run the process-saxon.sh shell script and the .txt and .html -files will be created. - - -Editing the Schema Description - -If you need to edit the schema description, edit tables.xml (according -to the rules in schema_description.dtd) and re-run the processing -stage as above to regenerate the .html and .txt files. - -The XML stylesheets for creating the HTML and text (Wiki format) from -the XML are in xml2html.xsl and xml2wiki.xsl - you shouldn't need to -edit these unless you are adding a new feature to the processing step. diff --git a/misc-scripts/regulatory_regions/RegulatoryFeatureParser/miranda.pm b/misc-scripts/regulatory_regions/RegulatoryFeatureParser/miranda.pm index 5ed9f7abf90178c73b5ff6ebc4b22aa133e99c2c..9f8079e92ccbc13c0baef1ebac83ecf353029522 100644 --- a/misc-scripts/regulatory_regions/RegulatoryFeatureParser/miranda.pm +++ b/misc-scripts/regulatory_regions/RegulatoryFeatureParser/miranda.pm @@ -50,7 +50,7 @@ sub parse { my %feature; - my ($group, $seq, $method, $feature, $chr, $start, $end, $str, $phase, $score, $type, $id_ignore, $id) = split; + my ($group, $seq, $method, $feature, $chr, $start, $end, $str, $phase, $score, $pvalue, $type, $id_ignore, $id) = split; my $strand = ($str =~ /\+/ ? 1 : -1); $id =~ s/[\"\']//g; # strip quotes diff --git a/misc-scripts/regulatory_regions/load_regulatory.pl b/misc-scripts/regulatory_regions/load_regulatory.pl index 53793d5a6b136124aa6aa3e9ec8d1addf51d15c9..74564a3d75853fda8ed159548fc2d0b590f8c0d6 100755 --- a/misc-scripts/regulatory_regions/load_regulatory.pl +++ b/misc-scripts/regulatory_regions/load_regulatory.pl @@ -68,6 +68,8 @@ Usage: perl $0 <options> -port Database port to connect to + -dbname Database name to use + -user Database username -pass Password for user diff --git a/misc-scripts/test/multidb_sql.pl b/misc-scripts/test/multidb_sql.pl index ef156cb1377b884b4fbded9b0f201d092feeb7a7..0bd7e42130e78689903e2930195eb1502a8643ec 100644 --- a/misc-scripts/test/multidb_sql.pl +++ b/misc-scripts/test/multidb_sql.pl @@ -90,6 +90,7 @@ for my $dbname ( @dbnames ) { } elsif( $expression =~ /^\s*select/i || $expression =~ /^\s*show/i || $expression =~ /^\s*desc/i ) { +print "### HERE"; my $res = $db->selectall_arrayref( $expression ); my @results = map { join( " ", @$_ ) } @$res ; my $db_name_off = 0 ; diff --git a/misc-scripts/xref_mapping/XrefMapper/BasicMapper.pm b/misc-scripts/xref_mapping/XrefMapper/BasicMapper.pm index 74f295b0fd2e64d528d470bab33ab4e6799268a9..226fcc98a1f4adff0e456733c30cea72ec089d61 100644 --- a/misc-scripts/xref_mapping/XrefMapper/BasicMapper.pm +++ b/misc-scripts/xref_mapping/XrefMapper/BasicMapper.pm @@ -363,7 +363,6 @@ sub dump_subset{ $final_clause = " AND ((" . join(") OR (", @or_list) . "))" unless ($use_all) ; - for my $sequence_type ('dna', 'peptide') { my $filename = $xref->dir() . "/xref_" . $index . "_" . $sequence_type . ".fasta"; diff --git a/misc-scripts/xref_mapping/XrefMapper/Methods/ExonerateBasic.pm b/misc-scripts/xref_mapping/XrefMapper/Methods/ExonerateBasic.pm index bd38c75a8587784492cdf4539c6ec2dc57029021..3672cd6eb071bce0bdc2f7689bb299f3c38ddc18 100644 --- a/misc-scripts/xref_mapping/XrefMapper/Methods/ExonerateBasic.pm +++ b/misc-scripts/xref_mapping/XrefMapper/Methods/ExonerateBasic.pm @@ -166,6 +166,7 @@ EOF if (($reader = open(BSUB_READER, '-|'))) { while (<BSUB_READER>) { + if (/^Job <(\d+)> is submitted/) { $jobid = $1; print "LSF job ID for main mapping job: $jobid (job array with $num_jobs jobs)\n" diff --git a/misc-scripts/xref_mapping/XrefMapper/mus_musculus.pm b/misc-scripts/xref_mapping/XrefMapper/mus_musculus.pm index 0552742f4a70b100e9d9fbd017a32435cb6edaad..d5cc373c8749f5d24ee247a24f4ddefa136e0c38 100644 --- a/misc-scripts/xref_mapping/XrefMapper/mus_musculus.pm +++ b/misc-scripts/xref_mapping/XrefMapper/mus_musculus.pm @@ -12,9 +12,10 @@ sub get_set_lists { return [["ExonerateGappedBest1", ["mus_musculus","*"]]]; } + sub consortium { - return "MarkerSymbol"; # Default to something that won't be matched as a source + return "MarkerSymbol"; } diff --git a/misc-scripts/xref_mapping/XrefParser/BaseParser.pm b/misc-scripts/xref_mapping/XrefParser/BaseParser.pm index 47b9426bff65ed7397b01913e31dfd7b48cbd92e..d1818edd1e47cdb67de9f7e2b3a309df534babe3 100644 --- a/misc-scripts/xref_mapping/XrefParser/BaseParser.pm +++ b/misc-scripts/xref_mapping/XrefParser/BaseParser.pm @@ -381,10 +381,33 @@ sub get_source_id_for_source_name { return $source_id; } + + +# -------------------------------------------------------------------------------- +# Get a set of source IDs matching a source name pattern + +sub get_source_ids_for_source_name_pattern { + + my ($self, $source_name) = @_; + + my $sql = "SELECT source_id FROM source WHERE upper(name) LIKE '%".uc($source_name)."%'"; + + my $sth = dbi()->prepare($sql); + my @sources; + $sth->execute(); + while(my @row = $sth->fetchrow_array()){ + push @sources,$row[0]; + } + $sth->finish; + + return @sources; + +} + sub get_source_name_for_source_id { my ($self, $source_id) = @_; my $source_name; - + my $sql = "SELECT name FROM source WHERE source_id= '" . $source_id. "'"; my $sth = dbi()->prepare($sql); $sth->execute(); @@ -537,6 +560,39 @@ sub get_valid_codes{ } # -------------------------------------------------------------------------------- + + + +# -------------------------------------------------------------------------------- + + + +sub get_existing_mappings { + + my ($self, $from_source_name, $to_source_name, $species_id) =@_; + + my %mappings; + + my $from_source = get_source_id_for_source_name($from_source_name); + my $to_source = get_source_id_for_source_name($to_source_name); + +print "from source: $from_source_name id $from_source\t\tto source: $to_source_name id $to_source\n"; + + my $sql = "SELECT dx.dependent_xref_id, x1.accession as dependent, dx.master_xref_id, x2.accession as master FROM dependent_xref dx, xref x1, xref x2 WHERE x1.xref_id=dx.dependent_xref_id AND x2.xref_id=dx.master_xref_id AND x2.source_id=? AND x1.source_id=? AND x1.species_id=? AND x2.species_id=?"; + + my $sth = dbi()->prepare($sql); + $sth->execute($to_source_name, $from_source_name, $species_id, $species_id); + while(my @row = $sth->fetchrow_array()){ + $mappings{$row[0]} = $row[1]; + } + + print "Got " . scalar(keys(%mappings)) . " $from_source_name -> $to_source_name mappings\n"; + + return \%mappings; + +} + +# -------------------------------------------------------------------------------- # Upload xrefs to the database sub upload_xref_object_graphs { diff --git a/misc-scripts/xref_mapping/XrefParser/GOParser.pm b/misc-scripts/xref_mapping/XrefParser/GOParser.pm index 5cdcacc867648350ce8065b19970b61c45426056..e61eb752a79a44046d8cac2da46a7cd8da9c83e2 100644 --- a/misc-scripts/xref_mapping/XrefParser/GOParser.pm +++ b/misc-scripts/xref_mapping/XrefParser/GOParser.pm @@ -1,3 +1,5 @@ + + package XrefParser::GOParser; use strict; @@ -43,6 +45,12 @@ sub run { my (%swiss) = %{XrefParser::BaseParser->get_valid_codes("uniprot",$species_id)}; my (%refseq) = %{XrefParser::BaseParser->get_valid_codes("refseq",$species_id)}; + + # complication with GO xrefs from JAX - linked to MGI symbols, which are themselves + # dependent, so we need to get the MGI->Uniprot mapping and store the *Uniprot* + # as the master xref + my (%mgi_to_uniprot) = %{XrefParser::BaseParser->get_existing_mappings("MarkerSymbol", "Uniprot/Swissprot", $species_id)}; + my %worm; my %worm_label; my $wormset; @@ -127,6 +135,14 @@ sub run { $count++; } } + + elsif($array[0] =~ /MGI/){ + if($mgi_to_uniprot{$array[1]}){ + XrefParser::BaseParser->add_to_xrefs($mgi_to_uniprot{$array[1]},$array[4],'',$array[4],'',$array[6],$source_id,$species_id); + $count++; + } + } + elsif(!defined($wrongtype{$array[0]})){ print STDERR "WARNING: unknown type ".$array[0]."\n"; $wrongtype{$array[0]} = 1; diff --git a/misc-scripts/xref_mapping/XrefParser/ZFINParser.pm b/misc-scripts/xref_mapping/XrefParser/ZFINParser.pm index bf21b4c7b31492fbaade7cb740057e9edb6f5dca..4875998fe4672c9cf3affcefa2c4da3a46e58b4f 100644 --- a/misc-scripts/xref_mapping/XrefParser/ZFINParser.pm +++ b/misc-scripts/xref_mapping/XrefParser/ZFINParser.pm @@ -55,14 +55,15 @@ sub run { #ZDB-GENE-000112-34 couptf4 O42534 - my $count =0; + my $spcount =0; + my $rscount =0; my $mismatch=0; while (<SWISSPROT>) { chomp; my ($zfin, $label, $acc) = split (/\s+/,$_); if(defined($swiss{$acc})){ XrefParser::BaseParser->add_to_xrefs($swiss{$acc},$zfin,'',$label,'','',$source_id,$species_id); - $count++; + $spcount++; } else{ $mismatch++; @@ -82,14 +83,14 @@ sub run { my ($zfin, $label, $acc) = split (/\s+/,$_); if(defined($refseq{$acc})){ XrefParser::BaseParser->add_to_xrefs($refseq{$acc},$zfin,'',$label,'','',$source_id,$species_id); - $count++; + $rscount++; } else{ $mismatch++; } } close REFSEQ; - print "\t$count xrefs succesfully loaded\n"; + print "\t$spcount xrefs from Swissprot and $rscount xrefs from RefSeq succesfully loaded\n"; print "\t$mismatch xrefs ignored\n"; return 0; } diff --git a/misc-scripts/xref_mapping/sql/populate_metadata.sql b/misc-scripts/xref_mapping/sql/populate_metadata.sql index fc6229ccabb07d6a5cfed9946e33b9f5ed27f7b9..4130b381f7fb462516956d516ed845e8914f1523 100644 --- a/misc-scripts/xref_mapping/sql/populate_metadata.sql +++ b/misc-scripts/xref_mapping/sql/populate_metadata.sql @@ -285,7 +285,7 @@ INSERT INTO source_url (source_id, species_id, url, checksum, file_modified_date ## UniGene INSERT INTO source_url (source_id, species_id, url, checksum, file_modified_date, upload_date, parser) VALUES (6, 9606,'ftp://ftp.ncbi.nih.gov/repository/UniGene/Homo_sapiens/Hs.seq.uniq.gz ftp://ftp.ncbi.nih.gov/repository/UniGene/Homo_sapiens/Hs.data.gz', '', now(), now(), "UniGeneParser"); -## ncRNA's presently inhouse. +## ncRNAs presently inhouse. INSERT INTO source_url (source_id, species_id, url, checksum, file_modified_date, upload_date, parser) VALUES (4000, 9606,'LOCAL:ncRNA/ncRNA.txt', '', now(), now(), "ncRNAParser"); # -------------------------------------------------------------------------------- @@ -308,7 +308,7 @@ INSERT INTO source_url (source_id, species_id, url, checksum, file_modified_date INSERT INTO source_url (source_id, species_id, url, checksum, file_modified_date, upload_date, parser) VALUES (1080, 10090,'ftp://ftp.informatics.jax.org/pub/reports/MRK_SwissProt_TrEMBL.rpt ftp://ftp.informatics.jax.org/pub/reports/MRK_Synonym.sql.rpt', '', now(), now(), "MGDParser"); ## GO -INSERT INTO source_url (source_id, species_id, url, checksum, file_modified_date, upload_date, parser) VALUES (1070, 10090,'ftp://ftp.ebi.ac.uk/pub/databases/GO/goa/MOUSE/gene_association.goa_mouse.gz', '', now(), now(), "GOParser"); +INSERT INTO source_url (source_id, species_id, url, checksum, file_modified_date, upload_date, parser) VALUES (1070, 10090,'http://www.geneontology.org/cgi-bin/downloadGOGA.pl/gene_association.mgi.gz', '', now(), now(), "GOParser"); ## IPI INSERT INTO source_url (source_id, species_id, url, checksum, file_modified_date, upload_date, parser) VALUES (5, 10090,'ftp://ftp.ebi.ac.uk/pub/databases/IPI/current/ipi.MOUSE.fasta.gz', '', now(), now(), "IPIParser"); diff --git a/misc-scripts/xref_mapping/xref_mapper.input b/misc-scripts/xref_mapping/xref_mapper.input index 27b1bab4da3d79adb3e30557c59394d514a23934..f0c321251863463736a947bb67af876ec89385b0 100644 --- a/misc-scripts/xref_mapping/xref_mapper.input +++ b/misc-scripts/xref_mapping/xref_mapper.input @@ -1,15 +1,39 @@ xref host=ecs4 port=3350 -dbname=glenn_test_xref +dbname=gp1_mouse_xrefs user=ensadmin password=ensembl dir=/nfs/acari/gp1/work/ensembl/misc-scripts/xref_mapping/xref -species=homo_sapiens -host=ecs2 -port=3364 -dbname=homo_sapiens_core_26_35 -user=ensro -password= -dir=/nfs/acari/gp1/work/ensembl/misc-scripts/xref_mapping/test +species=mus_musculus +host=ecs4 +port=3350 +dbname=gp1_mus_musculus_core_37_34e +user=ensadmin +password=ensembl +dir=/nfs/acari/gp1/work/ensembl/misc-scripts/xref_mapping/mouse + +#species=gallus_gallus +#host=ecs4 +#port=3350 +#dbname=glenn_gallus_gallus_core_31_1g +#user=ensadmin +#password=ensembl +#dir=/nfs/acari/gp1/work/ensembl/misc-scripts/xref_mapping/chicken + +#species=mus_musculus +#host=ecs4 +#port=3350 +#dbname=ianl_mus_musculus_core_31_33g +#user=ensadmin +#password=ensembl +#dir=/nfs/acari/gp1/work/ensembl/misc-scripts/xref_mapping/mouse + +#species=drosophila_melanogaster +#host=ia64g +#port=3306 +#dbname=glenn_drosophila_melanogaster_core_NEW +#user=ensadmin +#password=ensembl +#dir=/nfs/acari/gp1/work/ensembl/misc-scripts/xref_mapping/drosophila diff --git a/misc-scripts/xref_projection/project_display_xrefs.pl b/misc-scripts/xref_projection/project_display_xrefs.pl index c94d254878132afbad86a84573aff3b9fe61604f..da495f41b364794c699ce0aaea94423a43349694 100644 --- a/misc-scripts/xref_projection/project_display_xrefs.pl +++ b/misc-scripts/xref_projection/project_display_xrefs.pl @@ -58,8 +58,8 @@ foreach my $to_species (@to_multi) { my $to_ga = Bio::EnsEMBL::Registry->get_adaptor($to_species, 'core', 'Gene'); my $to_dbea = Bio::EnsEMBL::Registry->get_adaptor($to_species, 'core', 'DBEntry'); - delete_names() if ($delete_names); - delete_go_terms() if ($delete_go_terms); + delete_names($to_ga) if ($delete_names); + delete_go_terms($to_ga) if ($delete_go_terms); my $mlss = $mlssa->fetch_by_method_link_type_registry_aliases($method_link_type, [$from_species, $to_species]); @@ -130,14 +130,13 @@ sub project_display_names { my ($to_ga, $to_dbea, $ma, $from_member, $to_member, %db_to_type) = @_; my $to_gene = $to_ga->fetch_by_stable_id($to_member->stable_id()); + my $from_gene = $from_ga->fetch_by_stable_id($from_member->stable_id()); + my $dbEntry = $from_gene->display_xref(); + my $to_source = $to_gene->display_xref()->dbname() if ($to_gene->display_xref()); + my $from_source = $from_gene->display_xref()->dbname() if ($from_gene->display_xref()); # if no display name set, do the projection - if (!$to_gene->external_name()) { - - my $from_gene = $from_ga->fetch_by_stable_id($from_member->stable_id()); - my $dbEntry = $from_gene->display_xref(); - - # TODO only do this for certain types of DBEntry? + if (check_overwrite_display_xref($to_gene, $from_source, $to_source)) { if ($dbEntry) { @@ -275,6 +274,9 @@ sub get_stats { $count = count_rows($to_ga, "SELECT COUNT(*) FROM gene g, xref x WHERE g.display_xref_id=x.xref_id AND x.display_label LIKE '%[from%'"); $str .= sprintf(" projected %d (%3.1f\%)" , $count, (100 * $count / $total_genes)); + $count = count_rows($to_ga, "SELECT COUNT(*) FROM gene g, xref x, external_db e WHERE g.display_xref_id=x.xref_id AND x.external_db_id=e.external_db_id AND e.db_name IN ('RefSeq_dna_predicted', 'RefSeq_peptide_predicted')"); + $str .= sprintf(" predicted %d (%3.1f\%)" , $count, (100 * $count / $total_genes)); + $count = count_rows($to_ga, "SELECT COUNT(*) FROM gene g WHERE display_xref_id IS NOT NULL"); $str .= sprintf(" total genes with names %d (%3.1f\%)" , $count, (100 * $count / $total_genes)); @@ -359,6 +361,37 @@ sub delete_go_terms { # ---------------------------------------------------------------------- +# Decide if a gene name should be overwritten +# Criteria: overwrite if: +# - no existing display_xref +# or +# - existing display_xref is RefSeq_*_predicted +# AND from_gene is from "best" source external db, +# e.g. HGNC in human, MGI in mouse + +sub check_overwrite_display_xref { + + my ($to_gene, $from_dbname, $to_dbname) = @_; + + return 1 if (!$to_gene->external_name()); + + if ($to_dbname eq "RefSeq_dna_predicted" || $to_dbname eq "RefSeq_peptide_predicted") { + + if (($from_species eq "human" && $from_dbname eq "HUGO") || + ($from_species eq "mouse" && $from_dbname eq "MarkerSymbol")) { + + return 1; + + } + + } + + return 0; + +} + +# ---------------------------------------------------------------------- + sub usage { print << "EOF"; diff --git a/modules/Bio/EnsEMBL/AffyArray.pm b/modules/Bio/EnsEMBL/AffyArray.pm index b3a1056442148e5db6417088af432442b76d3355..bf707a296a764095f33918d7005a54570e210aa9 100644 --- a/modules/Bio/EnsEMBL/AffyArray.pm +++ b/modules/Bio/EnsEMBL/AffyArray.pm @@ -112,7 +112,7 @@ sub get_all_AffyProbes { if( $self->adaptor() && $self->dbID() ) { my $probeAdaptor = $self->adaptor()->db()->get_AffyProbeAdaptor(); - my $probes = $probeAdaptor->fetch_all_by_AffyArray( $self ); + my $probes = $probeAdaptor->fetch_by_AffyArray( $self ); return $probes; } else { warning( "Need database connection to retrieve Probes" ); diff --git a/modules/Bio/EnsEMBL/DBEntry.pm b/modules/Bio/EnsEMBL/DBEntry.pm index 971cae42c76b7746d0880911f4caa6c5a7af0c08..9382690fd165d5b23478e631654b4e254574081c 100644 --- a/modules/Bio/EnsEMBL/DBEntry.pm +++ b/modules/Bio/EnsEMBL/DBEntry.pm @@ -149,6 +149,7 @@ sub primary_id { if( defined $arg ) { $self->{primary_id} = $arg; } + return $self->{primary_id}; } diff --git a/modules/Bio/EnsEMBL/DBSQL/DBEntryAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/DBEntryAdaptor.pm index 85f5bd9dd4210b853c9ec03b24404bec6df2cd0b..1b6fc54fd90fe25ca539bfde361ca5b72a7e1f5e 100644 --- a/modules/Bio/EnsEMBL/DBSQL/DBEntryAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/DBEntryAdaptor.pm @@ -276,6 +276,7 @@ sub store { $sth->bind_param(4,$exObj->description,SQL_VARCHAR); $sth->bind_param(5,$dbRef,SQL_INTEGER); $sth->execute(); + $dbX = $sth->{'mysql_insertid'}; $sth->finish(); # @@ -859,13 +860,13 @@ sub _type_by_external_id{ } my @queries = ( "select $ID_sql - from $from_sql xref, object_xref as oxr + from $from_sql xref, object_xref as oxr where $where_sql xref.dbprimary_acc = ? and - xref.xref_id = oxr.xref_id and oxr.ensembl_object_type= ?", + xref.xref_id = oxr.xref_id and oxr.ensembl_object_type= ?", "select $ID_sql - from $from_sql xref, object_xref as oxr + from $from_sql xref, object_xref as oxr where $where_sql xref.display_label = ? and - xref.xref_id = oxr.xref_id and oxr.ensembl_object_type= ?", + xref.xref_id = oxr.xref_id and oxr.ensembl_object_type= ?", "select $ID_sql from $from_sql object_xref as oxr, external_synonym as syn where $where_sql syn.synonym = ? and @@ -880,6 +881,7 @@ sub _type_by_external_id{ my @result = (); foreach( @queries ) { + my $sth = $self->prepare( $_ ); $sth->bind_param(1,"$name",SQL_VARCHAR); $sth->bind_param(2,$ensType,SQL_VARCHAR); diff --git a/modules/Bio/EnsEMBL/DBSQL/RegulatoryFeatureAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/RegulatoryFeatureAdaptor.pm index 54bfe4d90cf8daf8f3c14233f10bd579a69f7cb5..5041b4ab553669b2235c4abc9afda6496bd46c2a 100644 --- a/modules/Bio/EnsEMBL/DBSQL/RegulatoryFeatureAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/RegulatoryFeatureAdaptor.pm @@ -373,7 +373,7 @@ sub store { my( $self, $feature, $ensObjs, $influence, $evidence ) = @_; if( ref( $ensObjs ) ne 'ARRAY' ){ - warning( "Use of sralar args is deprecated - please use a listref" ); + warning( "Use of scalar args is deprecated - please use a listref" ); $ensObjs = [[$ensObjs, $influence, $evidence]]; } diff --git a/modules/Bio/EnsEMBL/Gene.pm b/modules/Bio/EnsEMBL/Gene.pm index 07e196b2664809f90c299b23572c87089efb3b06..c1d26785256de173c5ab93b5cae62d21bd36e90a 100755 --- a/modules/Bio/EnsEMBL/Gene.pm +++ b/modules/Bio/EnsEMBL/Gene.pm @@ -125,7 +125,7 @@ sub new { Args : none Example : none - Description: returns true if this gene has a display_xref + Description: returns true if this gene has a status of KNOWN Returntype : 0,1 Exceptions : none Caller : general diff --git a/modules/Bio/EnsEMBL/Slice.pm b/modules/Bio/EnsEMBL/Slice.pm index 3ef9e963a23b860cd0b4eeabfd07f713b8c56a5c..05bb7bd926fdafb1f2ebeae2caf8d4777f31109d 100644 --- a/modules/Bio/EnsEMBL/Slice.pm +++ b/modules/Bio/EnsEMBL/Slice.pm @@ -69,9 +69,9 @@ use Bio::EnsEMBL::ProjectionSegment; use Bio::EnsEMBL::Registry; use Bio::EnsEMBL::DBSQL::MergedAdaptor; -use Bio::EnsEMBL::StrainSlice; -use Bio::EnsEMBL::IndividualSlice; -use Bio::EnsEMBL::IndividualSliceFactory; +#use Bio::EnsEMBL::StrainSlice; +#use Bio::EnsEMBL::IndividualSlice; +#use Bio::EnsEMBL::IndividualSliceFactory; use Bio::EnsEMBL::Mapper::RangeRegistry; use Data::Dumper; diff --git a/modules/t/attributeAdaptor.t b/modules/t/attributeAdaptor.t index 46d55f7d5959baf0f7ef7b605f8a2c4d91ad48a6..1fc31491ffd1044659e180c4f1bc2901de85d9e8 100644 --- a/modules/t/attributeAdaptor.t +++ b/modules/t/attributeAdaptor.t @@ -193,6 +193,7 @@ $count = $db->dbc->db_handle->selectall_arrayref ok($count == 1); @attribs = @{$aa->fetch_all_by_Slice($slice)}; +print "attribs: " . scalar(@attribs) . "\n"; ok(@attribs == 1); diff --git a/modules/t/dbEntries.t b/modules/t/dbEntries.t index 006e4158d88272652b8c6c97e99391ca7f54ba6f..16a8a0eb022ced7387ba217cef7c6981b52bc03c 100644 --- a/modules/t/dbEntries.t +++ b/modules/t/dbEntries.t @@ -67,11 +67,13 @@ debug( " $goxref_count GoXrefs, $ident_count identityXrefs." ); # # 3 as many dblinks as entries in object_xref # + ok( $db_entry_count == $xref_count ); # # 4,5 correct number of GoXrefs and IdentityXrefs # +print $goxref_count . " " . $ident_count . "\n"; ok( $goxref_count == 48 ); ok( $ident_count == 32 ); @@ -122,8 +124,6 @@ my $gene = $ga->fetch_by_dbID( $all_gene_ids->[0] ); my $tr = $gene->get_all_Transcripts()->[0]; my $tl = $tr->translation(); - - $dbEntryAdaptor->store( $xref, $gene, "Gene" ); $dbEntryAdaptor->store( $xref, $tr, "Transcript" ); $dbEntryAdaptor->store( $goref, $tl, "Translation" ); @@ -140,7 +140,6 @@ $oxr_count = count_rows($db, 'object_xref'); debug( "object_xref_count = $oxr_count" ); ok( $oxr_count == 5 ); - $xref_count = count_rows($db, 'xref'); $sth->finish(); @@ -150,7 +149,6 @@ $sth->finish(); debug( "Number of xrefs = $xref_count" ); ok( $xref_count == 3 ); - # # 8 number of go entries right # diff --git a/modules/t/densityFeatureAdaptor.t b/modules/t/densityFeatureAdaptor.t index abf011cf18eb56f3c38e175320415766733d96c2..da292afefdeebc358c6eb3e8adbd6b31727060ec 100644 --- a/modules/t/densityFeatureAdaptor.t +++ b/modules/t/densityFeatureAdaptor.t @@ -183,6 +183,7 @@ ok( $stored_features[0]->length() > 10000 ); @stored_features = @{$dfa->fetch_all_by_Slice( $sub_Slice, 'GeneDensityTest', 10 )}; ok( $stored_features[0]->length() > 10000 ); @stored_features = @{$dfa->fetch_all_by_Slice( $sub_Slice, 'GeneDensityTest', 100 )}; +print $stored_features[0]->length() . "\n"; ok( $stored_features[0]->length() == 1000 ); diff --git a/modules/t/gene.t b/modules/t/gene.t index f8f7c85748b68ac8993841507ebb3fc24a1433de..ebafd84af8edfa5bedcd0ce6ebde0a176e453fe7 100644 --- a/modules/t/gene.t +++ b/modules/t/gene.t @@ -583,7 +583,9 @@ ok($gene->end() == 400); # target_slice = sliceAdaptor->fetch_by_region( "alt_chrom", "gap_map_test" ); my $gene = $ga->fetch_by_dbID( 18274 ); +print ":::: Gene: $gene\n"; my $new_gene = $gene->transform( "alt_chrom" ); +print ":::: New Gene $new_gene\n"; my $trans_orig = $gene->get_all_Transcripts()->[0]; my $trans_mapped = $new_gene->get_all_Transcripts()->[0]; ok( $trans_orig->spliced_seq() eq diff --git a/modules/t/transcript.t b/modules/t/transcript.t index 8fc6910e98b399ae90eb8ff8a0938af2ed752b77..167edabfbedb5b9caaab0888b73bca90e1701e54 100644 --- a/modules/t/transcript.t +++ b/modules/t/transcript.t @@ -97,7 +97,7 @@ my $stable_ids = $ta->list_stable_ids(); ok (@{$stable_ids}); my $tr = $ta->fetch_by_display_label( "DNMT3B" ); -ok( $tr->dbID() == 21737 ); +ok($tr && $tr->dbID() == 21737 ); $tr = $ta->fetch_by_stable_id( "ENST00000217347" ); @@ -625,9 +625,10 @@ my $transcript = $transcript_adaptor->fetch_by_dbID(21717); my @factors = @{$transcript->fetch_coded_for_regulatory_factors()}; ok($factors[0]->dbID() == 2); - +sleep 10; # test fetching by supporting evidence - +#$transcripts = $transcript_adaptor->fetch_all_by_exon_supporting_evidence(hit,feat); +#$transcripts = $transcript_adaptor->fetch_all_by_exon_supporting_evidence(hit,feat,anal); sub print_coords { my $coords = shift; diff --git a/sql/patch_27_28.sql b/sql/patch_27_28.sql index 35eaf43c5dd74ccf560f6793b30a3f8bae3211f3..91093e5778b9cd0e362e0db06dcffd1d22780fb6 100644 --- a/sql/patch_27_28.sql +++ b/sql/patch_27_28.sql @@ -3,6 +3,10 @@ # Now have 2 separate RefSeq external_db entries UPDATE external_db SET db_name='RefSeq_dna' WHERE db_name='RefSeq'; +# Add Flybase external_db entries +INSERT INTO external_db VALUES (803, 'flybase_polypeptide_id', 1, 'KNOWNXREF'); +INSERT INTO external_db VALUES (805, 'flybase_annotation_id', 1, 'KNOWNXREF'); + # Modify column definition of xref.dbprimary_acc to remove binary property ALTER TABLE xref MODIFY dbprimary_acc VARCHAR(40) NOT NULL; diff --git a/sql/table.sql b/sql/table.sql index c809b989a483e58b92127ad23ebc4072dce41ff9..e7564a329508666df9d1a7c1b01d9e9f34866dbf 100755 --- a/sql/table.sql +++ b/sql/table.sql @@ -685,7 +685,7 @@ CREATE TABLE external_db ( external_db_id INT not null, db_name VARCHAR(27) NOT NULL, - release VARCHAR(40) NOT NULL, + release VARCHAR(40) NOT NULL, status ENUM ('KNOWNXREF','KNOWN','XREF','PRED','ORTH', 'PSEUDO') not null, dbprimary_acc_linkable BOOLEAN DEFAULT 1 NOT NULL,