in progress
authorcmzmasek <cmzmasek@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Sat, 19 Oct 2013 05:08:44 +0000 (05:08 +0000)
committercmzmasek <cmzmasek@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Sat, 19 Oct 2013 05:08:44 +0000 (05:08 +0000)
forester/java/src/org/forester/test/Test.java
forester/java/src/org/forester/ws/seqdb/EbiDbEntry.java

index 0701b66..e829be9 100644 (file)
@@ -11170,6 +11170,22 @@ public final class Test {
             if ( !entry4.getAccession().equals( "AAA36557" ) ) {
                 return false;
             }
+            if ( !entry4.getTaxonomyScientificName().equals( "Homo sapiens" ) ) {
+                System.out.println( entry4.getTaxonomyScientificName() );
+                return false;
+            }
+            if ( !entry4.getSequenceName().equals( "Homo sapiens (human) ras protein" ) ) {
+                System.out.println( entry4.getSequenceName() );
+                return false;
+            }
+            if ( !entry4.getTaxonomyIdentifier().equals( "9606" ) ) {
+                System.out.println( entry4.getTaxonomyIdentifier() );
+                return false;
+            }
+            if ( !entry4.getGeneName().equals( "ras" ) ) {
+                System.out.println( entry4.getGeneName() );
+                return false;
+            }
             //
             //TODO fails:
             //            final SequenceDatabaseEntry entry5 = SequenceDbWsTools.obtainEntry( "M30539" );
index f3ae59c..418d099 100644 (file)
@@ -71,9 +71,12 @@ public final class EbiDbEntry implements SequenceDatabaseEntry {
         final Pattern mim_PATTERN = Pattern.compile( "\\s+/db_xref=\"MIM:(\\d+)\"" );
         final Pattern taxon_PATTERN = Pattern.compile( "\\s+/db_xref=\"taxon:(\\d+)\"" );
         final Pattern interpro_PATTERN = Pattern.compile( "\\s+/db_xref=\"InterPro:([A-Z0-9]+)\"" );
-        final Pattern uniprot_PATTERN = Pattern.compile( "\\s+/db_xref=\"UniProtKB/TrEMBL:(\\w+)\"" );
-        final Pattern hgnc_PATTERN = Pattern.compile( "\\s+/db_xref=\"HGNC:(\\d+)\"" );
+        final Pattern uniprot_PATTERN = Pattern.compile( "\\s+/db_xref=\"UniProtKB/[A-Za-z-]*:(\\w+)\"" );
+        final Pattern hgnc_PATTERN = Pattern.compile( "\\s+/db_xref=\"[A-Z:]*HGNC:(\\d+)\"" );
         final Pattern geneid_PATTERN = Pattern.compile( "\\s+/db_xref=\"GeneID:(\\d+)\"" );
+        final Pattern pdb_PATTERN = Pattern.compile( "\\s+/db_xref=\"PDB:([A-Z0-9]+)\"" );
+        
+        
         final Pattern ec_PATTERN = Pattern.compile( "\\s+/EC_number=\"([\\.\\-\\d]+)\"" );
         final Pattern product_PATTERN = Pattern.compile( "\\s+/product=\"(\\w{1,10})\"" );
         final EbiDbEntry e = new EbiDbEntry();
@@ -247,6 +250,10 @@ public final class EbiDbEntry implements SequenceDatabaseEntry {
                 if ( product.find() ) {
                     e.setSequenceSymbol( product.group( 1 ) );
                 }
+                final Matcher pdb = pdb_PATTERN.matcher( line );
+                if ( pdb.find() ) {
+                    e.addCrossReference( new Accession( pdb.group( 1 ), "pdb" ) );
+                }
             }
         }
         if ( def.length() > 0 ) {