inprogress
[jalview.git] / forester / java / src / org / forester / ws / seqdb / EbiDbEntry.java
1 // $Id:
2 // forester -- software libraries and applications
3 // for genomics and evolutionary biology research.
4 //
5 // Copyright (C) 2010 Christian M Zmasek
6 // Copyright (C) 2010 Sanford-Burnham Medical Research Institute
7 // All rights reserved
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 //
23 // Contact: phylosoft @ gmail . com
24 // WWW: https://sites.google.com/site/cmzmasek/home/software/forester
25
26 package org.forester.ws.seqdb;
27
28 import java.util.List;
29 import java.util.SortedSet;
30 import java.util.TreeSet;
31 import java.util.regex.Matcher;
32 import java.util.regex.Pattern;
33
34 import org.forester.go.GoTerm;
35 import org.forester.phylogeny.data.Accession;
36 import org.forester.phylogeny.data.Annotation;
37 import org.forester.util.ForesterUtil;
38
39 public final class EbiDbEntry implements SequenceDatabaseEntry {
40
41     //    public static SequenceDatabaseEntry createInstanceFromPlainText( final List<String> lines ) {
42     //        final EbiDbEntry e = new EbiDbEntry();
43     //        for( final String line : lines ) {
44     //            if ( line.startsWith( "PA" ) ) {
45     //                e.setPA( SequenceDbWsTools.extractFrom( line, "PA" ) );
46     //            }
47     //            else if ( line.startsWith( "DE" ) ) {
48     //                e.setDe( SequenceDbWsTools.extractFrom( line, "DE" ) );
49     //            }
50     //            else if ( line.startsWith( "OS" ) ) {
51     //                if ( line.indexOf( "(" ) > 0 ) {
52     //                    e.setOs( SequenceDbWsTools.extractFromTo( line, "OS", "(" ) );
53     //                }
54     //                else {
55     //                    e.setOs( SequenceDbWsTools.extractFrom( line, "OS" ) );
56     //                }
57     //            }
58     //            else if ( line.startsWith( "OX" ) ) {
59     //                if ( line.indexOf( "NCBI_TaxID=" ) > 0 ) {
60     //                    e.setTaxId( SequenceDbWsTools.extractFromTo( line, "NCBI_TaxID=", ";" ) );
61     //                }
62     //            }
63     //        }
64     //        return e;
65     //    }
66     public static SequenceDatabaseEntry createInstanceFromPlainTextForRefSeq( final List<String> lines ) {
67         final Pattern X_PATTERN = Pattern.compile( "^[A-Z]+" );
68         final Pattern chromosome_PATTERN = Pattern.compile( "\\s+/chromosome=\"(\\w+)\"" );
69         final Pattern map_PATTERN = Pattern.compile( "\\s+/map=\"([\\w+\\.])\"" );
70         final Pattern gene_PATTERN = Pattern.compile( "\\s+/gene=\"(.+)\"" );
71         final Pattern mim_PATTERN = Pattern.compile( "\\s+/db_xref=\"MIM:(\\d+)\"" );
72         final Pattern taxon_PATTERN = Pattern.compile( "\\s+/db_xref=\"taxon:(\\d+)\"" );
73         final Pattern interpro_PATTERN = Pattern.compile( "\\s+/db_xref=\"InterPro:([A-Z0-9]+)\"" );
74         final Pattern uniprot_PATTERN = Pattern.compile( "\\s+/db_xref=\"UniProtKB/[A-Za-z-]*:(\\w+)\"" );
75         final Pattern hgnc_PATTERN = Pattern.compile( "\\s+/db_xref=\"[A-Z:]*HGNC:(\\d+)\"" );
76         final Pattern geneid_PATTERN = Pattern.compile( "\\s+/db_xref=\"GeneID:(\\d+)\"" );
77         final Pattern pdb_PATTERN = Pattern.compile( "\\s+/db_xref=\"PDB:([A-Z0-9]+)\"" );
78         final Pattern ec_PATTERN = Pattern.compile( "\\s+/EC_number=\"([\\.\\-\\d]+)\"" );
79         final Pattern product_PATTERN = Pattern.compile( "\\s+/product=\"(\\w{1,10})\"" );
80         final EbiDbEntry e = new EbiDbEntry();
81         final StringBuilder def = new StringBuilder();
82         boolean in_definition = false;
83         boolean in_features = false;
84         boolean in_source = false;
85         boolean in_gene = false;
86         boolean in_cds = false;
87         boolean in_mrna = false;
88         boolean in_protein = false;
89         for( final String line : lines ) {
90             if ( line.startsWith( "ACCESSION " ) ) {
91                 e.setAccession( SequenceDbWsTools.extractFrom( line, "ACCESSION" ) );
92                 in_definition = false;
93             }
94             else if ( line.startsWith( "ID " ) ) {
95                 e.setAccession( SequenceDbWsTools.extractFromTo( line, "ID", ";" ) );
96                 in_definition = false;
97             }
98             else if ( line.startsWith( "DEFINITION " ) || ( line.startsWith( "DE " ) ) ) {
99                 boolean definiton = false;
100                 if ( line.startsWith( "DEFINITION " ) ) {
101                     definiton = true;
102                 }
103                 if ( line.indexOf( "[" ) > 0 ) {
104                     if ( definiton ) {
105                         x( def, ( SequenceDbWsTools.extractFromTo( line, "DEFINITION", "[" ) ) );
106                     }
107                     else {
108                         x( def, ( SequenceDbWsTools.extractFromTo( line, "DE", "[" ) ) );
109                     }
110                 }
111                 else if ( line.indexOf( "." ) > 0 ) {
112                     if ( definiton ) {
113                         x( def, ( SequenceDbWsTools.extractFromTo( line, "DEFINITION", "." ) ) );
114                     }
115                     else {
116                         x( def, ( SequenceDbWsTools.extractFromTo( line, "DE", "." ) ) );
117                     }
118                 }
119                 else {
120                     if ( definiton ) {
121                         x( def, ( SequenceDbWsTools.extractFrom( line, "DEFINITION" ) ) );
122                     }
123                     else {
124                         x( def, ( SequenceDbWsTools.extractFrom( line, "DE" ) ) );
125                     }
126                 }
127                 if ( definiton ) {
128                     in_definition = true;
129                 }
130             }
131             else if ( line.startsWith( "  ORGANISM " ) ) {
132                 if ( line.indexOf( "(" ) > 0 ) {
133                     e.setTaxonomyScientificName( SequenceDbWsTools.extractFromTo( line, "  ORGANISM", "(" ) );
134                 }
135                 else {
136                     e.setTaxonomyScientificName( SequenceDbWsTools.extractFrom( line, "  ORGANISM" ) );
137                 }
138                 //  in_def = false;
139             }
140             else if ( line.startsWith( "OS " ) ) {
141                 if ( line.indexOf( "(" ) > 0 ) {
142                     e.setTaxonomyScientificName( SequenceDbWsTools.extractFromTo( line, "OS", "(" ) );
143                 }
144                 else {
145                     e.setTaxonomyScientificName( SequenceDbWsTools.extractFrom( line, "OS" ) );
146                 }
147             }
148             else if ( line.startsWith( " " ) && in_definition ) {
149                 def.append( " " );
150                 if ( line.indexOf( "[" ) > 0 ) {
151                     def.append( SequenceDbWsTools.extractTo( line, "[" ) );
152                 }
153                 else if ( line.indexOf( "." ) > 0 ) {
154                     def.append( SequenceDbWsTools.extractTo( line, "." ) );
155                 }
156                 else {
157                     def.append( line.trim() );
158                 }
159             }
160             else {
161                 in_definition = false;
162             }
163             if ( !line.startsWith( "FT " ) && X_PATTERN.matcher( line ).find() ) {
164                 in_features = false;
165                 in_source = false;
166                 in_gene = false;
167                 in_cds = false;
168                 in_mrna = false;
169                 in_protein = false;
170                 // in_def = false;
171             }
172             if ( line.startsWith( "FEATURES " ) || line.startsWith( "FT " ) ) {
173                 in_features = true;
174             }
175             if ( in_features && ( line.startsWith( "     source " ) || line.startsWith( "FT   source " ) ) ) {
176                 in_source = true;
177                 in_gene = false;
178                 in_cds = false;
179                 in_mrna = false;
180                 in_protein = false;
181             }
182             if ( in_features && ( line.startsWith( "     gene " ) || line.startsWith( "FT   gene " ) ) ) {
183                 in_source = false;
184                 in_gene = true;
185                 in_cds = false;
186                 in_mrna = false;
187                 in_protein = false;
188             }
189             if ( in_features && ( line.startsWith( "     CDS " ) || line.startsWith( "FT   CDS " ) ) ) {
190                 in_source = false;
191                 in_gene = false;
192                 in_cds = true;
193                 in_mrna = false;
194                 in_protein = false;
195             }
196             if ( in_features && ( line.startsWith( "     Protein " ) || line.startsWith( "FT   Protein " ) ) ) {
197                 in_source = false;
198                 in_gene = false;
199                 in_cds = false;
200                 in_mrna = false;
201                 in_protein = true;
202             }
203             if ( in_features && ( line.startsWith( "     mRNA " ) || line.startsWith( "FT   mRNA " ) ) ) {
204                 in_source = false;
205                 in_gene = false;
206                 in_cds = false;
207                 in_mrna = true;
208                 in_protein = false;
209             }
210             if ( in_source ) {
211                 final Matcher ti = taxon_PATTERN.matcher( line );
212                 if ( ti.find() ) {
213                     e.setTaxId( ti.group( 1 ) );
214                 }
215                 final Matcher chr = chromosome_PATTERN.matcher( line );
216                 if ( chr.find() ) {
217                     e.setChromosome( chr.group( 1 ) );
218                 }
219                 final Matcher map = map_PATTERN.matcher( line );
220                 if ( map.find() ) {
221                     e.setMap( map.group( 1 ) );
222                 }
223             }
224             if ( in_cds || in_gene ) {
225                 final Matcher hgnc = hgnc_PATTERN.matcher( line );
226                 if ( hgnc.find() ) {
227                     e.addCrossReference( new Accession( hgnc.group( 1 ), "hgnc" ) );
228                 }
229                 final Matcher geneid = geneid_PATTERN.matcher( line );
230                 if ( geneid.find() ) {
231                     e.addCrossReference( new Accession( geneid.group( 1 ), "geneid" ) );
232                 }
233             }
234             if ( in_protein || in_cds || in_gene || in_mrna ) {
235                 final Matcher ec = ec_PATTERN.matcher( line );
236                 if ( ec.find() ) {
237                     e.addAnnotation( new Annotation( "EC", ec.group( 1 ) ) );
238                 }
239                 final Matcher gene = gene_PATTERN.matcher( line );
240                 if ( gene.find() ) {
241                     e.setGeneName( gene.group( 1 ) );
242                 }
243                 final Matcher uniprot = uniprot_PATTERN.matcher( line );
244                 if ( uniprot.find() ) {
245                     e.addCrossReference( new Accession( uniprot.group( 1 ), "uniprot" ) );
246                 }
247                 final Matcher interpro = interpro_PATTERN.matcher( line );
248                 if ( interpro.find() ) {
249                     e.addCrossReference( new Accession( interpro.group( 1 ), "interpro" ) );
250                 }
251                 final Matcher mim = mim_PATTERN.matcher( line );
252                 if ( mim.find() ) {
253                     e.addCrossReference( new Accession( mim.group( 1 ), "mim" ) );
254                 }
255                 final Matcher product = product_PATTERN.matcher( line );
256                 if ( product.find() ) {
257                     e.setSequenceSymbol( product.group( 1 ) );
258                 }
259                 final Matcher pdb = pdb_PATTERN.matcher( line );
260                 if ( pdb.find() ) {
261                     e.addCrossReference( new Accession( pdb.group( 1 ), "pdb" ) );
262                 }
263             }
264         }
265         if ( def.length() > 0 ) {
266             e.setSequenceName( def.toString().trim() );
267         }
268         return e;
269     }
270     private String _map;
271     private String _chromosome;
272
273     private void setMap( final String map ) {
274         _map = map;
275     }
276
277     private void setChromosome( final String chromosome ) {
278         _chromosome = chromosome;
279     }
280
281     @Override
282     public String getMap() {
283         return _map;
284     }
285
286     @Override
287     public String getChromosome() {
288         return _chromosome;
289     }
290
291     private static void x( final StringBuilder sb, final String s ) {
292         if ( sb.length() > 0 ) {
293             sb.append( " " );
294         }
295         sb.append( s.trim() );
296     }
297     // FIXME actually this is NCBI entry
298     //http://www.ebi.ac.uk/Tools/dbfetch/dbfetch/emb/AAR37336/
299     private String                _pa;
300     private String                _de;
301     private String                _os;
302     private String                _tax_id;
303     private String                _symbol;
304     private String                _provider;
305     private SortedSet<Accession>  _cross_references;
306     private SortedSet<Annotation> _annotations;
307     private String                _gene_name;
308
309     // TODO  PUBMED   15798186
310     //TODO  (FEATURES) 
311     // source /db_xref="taxon:9606"
312     // gene            1..2881  
313     // /gene="RBM39" 
314     //
315     // /db_xref="MIM:604739"  
316     // CDS
317     // /gene="RBM39"
318     // /db_xref="MIM:604739"
319     // /db_xref="InterPro:IPR002475"
320     // /product="Bcl-2"
321     // /db_xref="UniProtKB/TrEMBL:Q5J7V1" <- reparse?
322     //
323     // Protein
324     /*
325     LOCUS       NM_184234               2881 bp    mRNA    linear   PRI 16-JUN-2013
326     DEFINITION  Homo sapiens RNA binding motif protein 39 (RBM39), transcript
327             variant 1, mRNA.
328     ACCESSION   NM_184234
329     VERSION     NM_184234.2  GI:336176061
330     KEYWORDS    RefSeq.
331     SOURCE      Homo sapiens (human)
332     ORGANISM  Homo sapiens
333             Eukaryota; Metazoa; Chordata; Craniata; Vertebrata; Euteleostomi;
334             Mammalia; Eutheria; Euarchontoglires; Primates; Haplorrhini;
335             Catarrhini; Hominidae; Homo.
336     REFERENCE   1  (bases 1 to 2881)
337     AUTHORS   Sillars-Hardebol,A.H., Carvalho,B., Belien,J.A., de Wit,M.,
338             Delis-van Diemen,P.M., Tijssen,M., van de Wiel,M.A., Ponten,F.,
339             Meijer,G.A. and Fijneman,R.J.
340     TITLE     CSE1L, DIDO1 and RBM39 in colorectal adenoma to carcinoma
341             progression
342     JOURNAL   Cell Oncol (Dordr) 35 (4), 293-300 (2012)
343     PUBMED   22711543
344     REMARK    GeneRIF: Data show that CSE1L, DIDO1 and RBM39 mRNA expression
345             levels correlated with chromosome 20q DNA copy number status.
346     REFERENCE   2  (bases 1 to 2881)
347     AUTHORS   Huang,G., Zhou,Z., Wang,H. and Kleinerman,E.S.
348     TITLE     CAPER-alpha alternative splicing regulates the expression of
349             vascular endothelial growth factor(1)(6)(5) in Ewing sarcoma cells
350     JOURNAL   Cancer 118 (8), 2106-2116 (2012)
351     PUBMED   22009261
352     REMARK    GeneRIF: Increased VEGF(165) expression is secondary to the
353             down-regulation of CAPER-alpha by EWS/FLI-1. CAPER-alpha mediates
354             alternative splicing and controls the shift from VEGF(189) to
355             VEGF(165) .
356     REFERENCE   3  (bases 1 to 2881)
357     AUTHORS   Han,B., Stockwin,L.H., Hancock,C., Yu,S.X., Hollingshead,M.G. and
358             Newton,D.L.
359     TITLE     Proteomic analysis of nuclei isolated from cancer cell lines
360             treated with indenoisoquinoline NSC 724998, a novel topoisomerase I
361             inhibitor
362     JOURNAL   J. Proteome Res. 9 (8), 4016-4027 (2010)
363     PUBMED   20515076
364     REMARK    Erratum:[J Proteome Res. 2011 Apr 1;10(4):2128]
365     REFERENCE   4  (bases 1 to 2881)
366     AUTHORS   Zhang,J.Y., Looi,K.S. and Tan,E.M.
367     TITLE     Identification of tumor-associated antigens as diagnostic and
368             predictive biomarkers in cancer
369     JOURNAL   Methods Mol. Biol. 520, 1-10 (2009)
370     PUBMED   19381943
371     REFERENCE   5  (bases 1 to 2881)
372     AUTHORS   Dutta,J., Fan,G. and Gelinas,C.
373     TITLE     CAPERalpha is a novel Rel-TAD-interacting factor that inhibits
374             lymphocyte transformation by the potent Rel/NF-kappaB oncoprotein
375             v-Rel
376     JOURNAL   J. Virol. 82 (21), 10792-10802 (2008)
377     PUBMED   18753212
378     REMARK    GeneRIF: this study identifies CAPERalpha (RNA binding motif
379             protein 39) as a new transcriptional coregulator for v-Rel and
380             reveals an important role in modulating Rel's oncogenic activity.
381     REFERENCE   6  (bases 1 to 2881)
382     AUTHORS   Cazalla,D., Newton,K. and Caceres,J.F.
383     TITLE     A novel SR-related protein is required for the second step of
384             Pre-mRNA splicing
385     JOURNAL   Mol. Cell. Biol. 25 (8), 2969-2980 (2005)
386     PUBMED   15798186
387     REFERENCE   7  (bases 1 to 2881)
388     AUTHORS   Dowhan,D.H., Hong,E.P., Auboeuf,D., Dennis,A.P., Wilson,M.M.,
389             Berget,S.M. and O'Malley,B.W.
390     TITLE     Steroid hormone receptor coactivation and alternative RNA splicing
391             by U2AF65-related proteins CAPERalpha and CAPERbeta
392     JOURNAL   Mol. Cell 17 (3), 429-439 (2005)
393     PUBMED   15694343
394     REFERENCE   8  (bases 1 to 2881)
395     AUTHORS   Sun,N.N., Fastje,C.D., Wong,S.S., Sheppard,P.R., Macdonald,S.J.,
396             Ridenour,G., Hyde,J.D. and Witten,M.L.
397     TITLE     Dose-dependent transcriptome changes by metal ores on a human acute
398             lymphoblastic leukemia cell line
399     JOURNAL   Toxicol Ind Health 19 (7-10), 157-163 (2003)
400     PUBMED   15747776
401     REMARK    GeneRIF: 10 genes were down-regulated following treatment of the
402             T-ALL cells with 0.15 and 1.5 microg/mL of metal ores at 72 h
403     REFERENCE   9  (bases 1 to 2881)
404     AUTHORS   Jung,D.J., Na,S.Y., Na,D.S. and Lee,J.W.
405     TITLE     Molecular cloning and characterization of CAPER, a novel
406             coactivator of activating protein-1 and estrogen receptors
407     JOURNAL   J. Biol. Chem. 277 (2), 1229-1234 (2002)
408     PUBMED   11704680
409     REMARK    GeneRIF: This paper describes the mouse gene.
410     REFERENCE   10 (bases 1 to 2881)
411     AUTHORS   Imai,H., Chan,E.K., Kiyosawa,K., Fu,X.D. and Tan,E.M.
412     TITLE     Novel nuclear autoantigen with splicing factor motifs identified
413             with antibody from hepatocellular carcinoma
414     JOURNAL   J. Clin. Invest. 92 (5), 2419-2426 (1993)
415     PUBMED   8227358
416     COMMENT     REVIEWED REFSEQ: This record has been curated by NCBI staff. The
417             reference sequence was derived from DC346351.1, BC141835.1 and
418             C75555.1.
419             On Jun 16, 2011 this sequence version replaced gi:35493810.
420             
421             Summary: This gene encodes a member of the U2AF65 family of
422             proteins. The encoded protein is found in the nucleus, where it
423             co-localizes with core spliceosomal proteins. It has been shown to
424             play a role in both steroid hormone receptor-mediated transcription
425             and alternative splicing, and it is also a transcriptional
426             coregulator of the viral oncoprotein v-Rel. Multiple transcript
427             variants have been observed for this gene. A related pseudogene has
428             been identified on chromosome X. [provided by RefSeq, Aug 2011].
429             
430             Transcript Variant: This variant (1) encodes the longest isoform
431             (a, also called CC1.4).
432             
433             Publication Note:  This RefSeq record includes a subset of the
434             publications that are available for this gene. Please see the Gene
435             record to access additional publications.
436             
437             ##Evidence-Data-START##
438             Transcript exon combination :: BC141835.1, L10911.1 [ECO:0000332]
439             RNAseq introns              :: mixed/partial sample support
440                                            ERS025081, ERS025082 [ECO:0000350]
441             ##Evidence-Data-END##
442             COMPLETENESS: complete on the 3' end.
443     PRIMARY     REFSEQ_SPAN         PRIMARY_IDENTIFIER PRIMARY_SPAN        COMP
444             1-578               DC346351.1         3-580
445             579-2872            BC141835.1         429-2722
446             2873-2881           C75555.1           1-9                 c
447     FEATURES             Location/Qualifiers
448      source          1..2881
449                      /organism="Homo sapiens"
450                      /mol_type="mRNA"
451                      /db_xref="taxon:9606"
452                      /chromosome="20"
453                      /map="20q11.22"
454      gene            1..2881
455                      /gene="RBM39"
456                      /gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
457                      /note="RNA binding motif protein 39"
458                      /db_xref="GeneID:9584"
459                      /db_xref="HGNC:15923"
460                      /db_xref="HPRD:09201"
461                      /db_xref="MIM:604739"
462      exon            1..396
463                      /gene="RBM39"
464                      /gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
465                      /inference="alignment:Splign:1.39.8"
466      STS             35..262
467                      /gene="RBM39"
468                      /gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
469                      /standard_name="REN58946"
470                      /db_xref="UniSTS:383746"
471      misc_feature    221..223
472                      /gene="RBM39"
473                      /gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
474                      /note="upstream in-frame stop codon"
475      STS             299..453
476                      /gene="RBM39"
477                      /gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
478                      /standard_name="G64285"
479                      /db_xref="UniSTS:158667"
480      exon            397..460
481                      /gene="RBM39"
482                      /gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
483                      /inference="alignment:Splign:1.39.8"
484      CDS             410..2002
485                      /gene="RBM39"
486                      /gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
487                      /note="isoform a is encoded by transcript variant 1;
488                      coactivator of activating protein-1 and estrogen
489                      receptors; functional spliceosome-associated protein 59;
490                      RNA-binding region (RNP1, RRM) containing 2;
491                      hepatocellular carcinoma protein 1; splicing factor HCC1"
492                      /codon_start=1
493                      /product="RNA-binding protein 39 isoform a"
494                      /protein_id="NP_909122.1"
495                      /db_xref="GI:35493811"
496                      /db_xref="CCDS:CCDS13266.1"
497                      /db_xref="GeneID:9584"
498                      /db_xref="HGNC:15923"
499                      /db_xref="HPRD:09201"
500                      /db_xref="MIM:604739"
501                      /translation="MADDIDIEAMLEAPYKKDENKLSSANGHEERSKKRKKSKSRSRS
502                      HERKRSKSKERKRSRDRERKKSKSRERKRSRSKERRRSRSRSRDRRFRGRYRSPYSGP
503                      KFNSAIRGKIGLPHSIKLSRRRSRSKSPFRKDKSPVREPIDNLTPEERDARTVFCMQL
504                      AARIRPRDLEEFFSTVGKVRDVRMISDRNSRRSKGIAYVEFVDVSSVPLAIGLTGQRV
505                      LGVPIIVQASQAEKNRAAAMANNLQKGSAGPMRLYVGSLHFNITEDMLRGIFEPFGRI
506                      ESIQLMMDSETGRSKGYGFITFSDSECAKKALEQLNGFELAGRPMKVGHVTERTDASS
507                      ASSFLDSDELERTGIDLGTTGRLQLMARLAEGTGLQIPPAAQQALQMSGSLAFGAVAE
508                      FSFVIDLQTRLSQQTEASALAAAASVQPLATQCFQLSNMFNPQTEEEVGWDTEIKDDV
509                      IEECNKHGGVIHIYVDKNSAQGNVYVKCPSIAAAIAAVNALHGRWFAGKMITAAYVPL
510                      PTYHNLFPDSMTATQLLVPSRR"
511      misc_feature    413..415
512                      /gene="RBM39"
513                      /gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
514                      /experiment="experimental evidence, no additional details
515                      recorded"
516                      /note="N-acetylalanine; propagated from
517                      UniProtKB/Swiss-Prot (Q14498.2); acetylation site"
518      
519      exon            461..510
520                      /gene="RBM39"
521                      /gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
522                      /inference="alignment:Splign:1.39.8"
523     
524      exon            1902..2874
525                      /gene="RBM39"
526                      /gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
527                      /inference="alignment:Splign:1.39.8"
528      STS             1956..2182
529                      /gene="RBM39"
530                      /gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
531                      /standard_name="REN58786"
532                      /db_xref="UniSTS:383586"
533      STS             2104..2148
534                      /gene="RBM39"
535                      /gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
536                      /standard_name="D19S1033"
537                      /db_xref="UniSTS:154759"
538      STS             2145..2400
539                      /gene="RBM39"
540                      /gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
541                      /standard_name="REN58785"
542                      /db_xref="UniSTS:383585"
543     
544      polyA_signal    2851..2856
545                      /gene="RBM39"
546                      /gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
547      polyA_site      2874
548                      /gene="RBM39"
549                      /gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
550     ORIGIN      
551         1 atttggagct tggggcagct tctcgcgaga gcccgtgctg agggctctgt gaggccccgt
552        61 gtgtttgtgt gtgtgtatgt gtgctggtga atgtgagtac agggaagcag cggccgccat
553       121 ttcagggagc ttgtcgacgc tgtcgcaggg gtggatcctg agctgccgaa gccgccgtcc
554       181 tgctctcccg cgtgggcttc tctaattcca ttgttttttt tagattctct cgggcctagc
555       241 cgtccttgga acccgatatt cgggctgggc ggttccgcgg cctgggccta ggggcttaac
556     
557     
558     
559     */
560     private EbiDbEntry() {
561     }
562
563     private void addCrossReference( final Accession accession ) {
564         if ( _cross_references == null ) {
565             _cross_references = new TreeSet<Accession>();
566         }
567         System.out.println( "XREF ADDED: " + accession );
568         _cross_references.add( accession );
569     }
570
571     @Override
572     public Object clone() throws CloneNotSupportedException {
573         throw new CloneNotSupportedException();
574     }
575
576     @Override
577     public String getAccession() {
578         return _pa;
579     }
580
581     @Override
582     public SortedSet<Accession> getCrossReferences() {
583         return _cross_references;
584     }
585
586     @Override
587     public String getGeneName() {
588         return _gene_name;
589     }
590
591     @Override
592     public SortedSet<GoTerm> getGoTerms() {
593         return null;
594     }
595
596     @Override
597     public String getProvider() {
598         return _provider;
599     }
600
601     @Override
602     public String getSequenceName() {
603         return _de;
604     }
605
606     @Override
607     public String getSequenceSymbol() {
608         return _symbol;
609     }
610
611     private void setSequenceSymbol( final String symbol ) {
612         _symbol = symbol;
613     }
614
615     @Override
616     public String getTaxonomyIdentifier() {
617         return _tax_id;
618     }
619
620     @Override
621     public String getTaxonomyScientificName() {
622         return _os;
623     }
624
625     @Override
626     public boolean isEmpty() {
627         return ( ForesterUtil.isEmpty( getAccession() ) && ForesterUtil.isEmpty( getSequenceName() )
628                 && ForesterUtil.isEmpty( getTaxonomyScientificName() )
629                 && ForesterUtil.isEmpty( getTaxonomyIdentifier() ) && ForesterUtil.isEmpty( getSequenceSymbol() ) );
630     }
631
632     private void setSequenceName( final String rec_name ) {
633         if ( _de == null ) {
634             _de = rec_name;
635         }
636     }
637
638     private void setGeneName( final String gene_name ) {
639         if ( _gene_name == null ) {
640             _gene_name = gene_name;
641         }
642     }
643
644     private void setTaxonomyScientificName( final String os ) {
645         if ( _os == null ) {
646             _os = os;
647         }
648     }
649
650     private void setAccession( final String pa ) {
651         if ( _pa == null ) {
652             _pa = pa;
653         }
654     }
655
656     public void setProvider( final String provider ) {
657         _provider = provider;
658     }
659
660     private void setTaxId( final String tax_id ) {
661         if ( _tax_id == null ) {
662             _tax_id = tax_id;
663         }
664     }
665
666     @Override
667     public SortedSet<Annotation> getAnnotations() {
668         return _annotations;
669     }
670
671     private void addAnnotation( final Annotation annotation ) {
672         if ( _annotations == null ) {
673             _annotations = new TreeSet<Annotation>();
674         }
675         _annotations.add( annotation );
676     }
677 }