Changeset 2683


Ignore:
Timestamp:
03/08/10 16:12:38 (2 years ago)
Author:
rwagner
Message:
 
Location:
molgenis_projects/col7a1/handwritten/java
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • molgenis_projects/col7a1/handwritten/java/plugin/ui/SearchPlugin.ftl

    r2666 r2683  
    3232</tr> 
    3333<tr> 
    34         <td><input type="text" name="variation" value="${screen.variation}"></td> 
     34        <td>Variation: <input type="text" name="variation" size="10" value="${screen.queryParametersVO.mutationName}"></td> 
    3535        <td>or</td> 
    36         <td><select name="mutation" size="1"><option value="" selected="selected" disabled="disabled">Select mutations</option><#list screen.mutations as mutation><option value="${mutation.id}">${mutation.cdna_notation}</option></#list></select></td> 
    37         <td>GenBank Acc No. <input type="text" name="genbankid" value="${screen.genbankId}"/></td> 
     36        <td><select name="mutation" size="1"><option value="">Select mutations</option><#list screen.mutationService.mutations as mutation><option value="${mutation.id}"<#if mutation.id == screen.queryParametersVO.mutationId> selected</#if>>${mutation.cdna_notation}</option></#list></select></td> 
     37        <td>GenBank Acc No. <input type="text" name="genbankid" value="${screen.queryParametersVO.genbankAccNo}"/></td> 
    3838</tr> 
    3939<tr> 
    40         <td><input type="text" name="nuclno" value="${screen.nuclNo}"></td> 
     40        <td>Nucleotide No: <input type="text" name="nuclno" size="3" value="${screen.queryParametersVO.mutationPosition}"></td> 
    4141        <td colspan="3">&nbsp;</td> 
    4242</tr> 
    4343<tr> 
    44         <td><input type="text" name="aano" value="${screen.aaNo}"></td> 
     44        <td>Amino Acid No: <input type="text" name="aano" size="3" value="${screen.queryParametersVO.aaNo}"></td> 
    4545        <td colspan="3">&nbsp;</td> 
    4646</tr> 
     
    4949</tr> 
    5050<tr> 
    51         <td><input type="text" name="exon" value="${screen.exon}"></td> 
     51        <td>Exon/Intron: <input type="text" name="exon" size="3" value="${screen.queryParametersVO.exonNumber}"></td> 
    5252        <td>or</td> 
    53         <td><select name="exonlist" size="1"><option value="" selected="selected" disabled="disabled">Select exon/intron</option><#list screen.exons as exon><option value="${exon.id}">${exon.name}</option></#list></select></td> 
     53        <td><select name="exonlist" size="1"><option value="">Select exon/intron</option><#list screen.mutationService.exons as exon><option value="${exon.id}"<#if exon.id == screen.queryParametersVO.exonId> selected</#if>>${exon.name}</option></#list></select></td> 
    5454        <td>&nbsp;</td> 
    5555</tr> 
    5656<tr> 
    57         <td><select name="type" size="1"><option value="" selected="selected" disabled="disabled">Select mutation type</option><#list screen.types as type><option value="${type}">${type}</option></#list></select></td> 
     57        <td>Mutation Type: <select name="type" size="1"><option value="">Select</option><#list screen.mutationService.mutationTypes as type><option value="${type}"<#if type == screen.queryParametersVO.mutationType> selected</#if>>${type}</option></#list></select></td> 
    5858        <td colspan="3">&nbsp;</td> 
    5959</tr> 
    6060<tr> 
    61         <td><select name="domain" size="1"><option value="" selected="selected" disabled="disabled">Select protein domain</option><#list screen.proteinDomains as domain><option value="${domain.id}">${domain.name}</option></#list></select></td> 
     61        <td>Protein Domain: <select name="domain" size="1"><option value="">Select</option><#list screen.mutationService.proteinDomains as domain><option value="${domain.id}"<#if domain.id == screen.queryParametersVO.proteinDomainId> selected</#if>>${domain.name}</option></#list></select></td> 
    6262        <td colspan="3">&nbsp;</td> 
    6363</tr> 
    6464<tr> 
    65         <td colspan="3"><input type="checkbox" name="snpbool" value="1">show single nucleotide polymorphisms (dbSNP)</td> 
     65        <td colspan="3"><input type="checkbox" name="snpbool" value="1"<#if screen.queryParametersVO.showSNP> checked</#if>>show single nucleotide polymorphisms (dbSNP)</td> 
    6666        <td><input type="submit" value="Go" onclick="__action.value='findMutations'"></td> 
    6767</tr> 
     
    7171<tr> 
    7272        <td colspan="4"><table border="1"><tr> 
    73                 <#list screen.proteinDomains as domain><td bgcolor="#ffdddd">${domain.name} (exon ${screen.getFirstExon(domain).number_}-${screen.getLastExon(domain).number_})</td></#list> 
     73                <#list screen.mutationService.proteinDomains as domain> 
     74                <#assign firstExonVO = screen.mutationService.findExonsByProteinDomainId(domain.id)?first> 
     75                <#assign lastExonVO = screen.mutationService.findExonsByProteinDomainId(domain.id)?last> 
     76                <td style="background-color:#ffdddd;">${domain.name} (exon ${firstExonVO.number_}-${lastExonVO.number_}) 
     77                </td> 
     78                </#list> 
    7479        </tr></table></td> 
    7580</tr> 
     
    7984<hr/> 
    8085 
     86<#if screen.exonVOResult?size == 0 && screen.mutationVOResult?size == 0> 
     87No results found. You might want to formulate a less restrictive query. 
     88</#if> 
     89 
     90<!-- 
     91<iframe src="http://www.heise.de/" width="100%" height="200" name="ExonView"> 
     92</iframe> 
     93--> 
     94 
     95<#if screen.exonVOResult?size &gt; 0> 
     96<#list screen.exonVOResult as exonVO> 
    8197<p> 
     98${exonVO.name} 
     99<pre> 
     100${exonVO.sequence} 
     101<#list screen.mutationVOResult as mutationVO> 
     102<#if exonVO.id == mutationVO.exonId> 
     103<#list 2..mutationVO.position as i> </#list>|${mutationVO.cdna_notation} 
     104</#if> 
     105</#list> 
     106</pre> 
     107</p> 
     108</#list> 
     109</#if> 
     110 
    82111<#if screen.mutationVOResult?size &gt; 0> 
    83 Results (${screen.mutationVOResult?size}): 
     112<p> 
     113${screen.mutationVOResult?size} results found: 
    84114<#list screen.mutationVOResult as mutationVO> 
    85115<table border="1"> 
    86 <tr bgcolor="#eeeeee"> 
     116<tr style="background-color:#eeeeee;"> 
    87117<td>cDNA</td> 
    88118<td>gDNA</td> 
     
    98128<td>Founder domain</td> 
    99129<td>Population</td> 
    100 <td>Other mutations at this position</td> 
    101 <td>Associated phenotypes</td> 
     130<td>Associated phenotype</td> 
    102131<td>References</td> 
    103132</tr> 
     
    107136<td>${mutationVO.codon_change}</td> 
    108137<td>(to be implemented)</td> 
    109 <td>${mutationVO.exon}</td> 
     138<td>${mutationVO.exonName}</td> 
    110139<td>${mutationVO.consequence}</td> 
    111140<td>${mutationVO.dominance}</td> 
     
    116145<td>${mutationVO.founderMutation?string("yes", "no")}</td> 
    117146<td>${mutationVO.population}</td> 
    118 <td>${mutationVO.exon}</td> 
    119147<td>${mutationVO.phenotype}</td> 
    120148<td><#list mutationVO.publications as publication>${publication}<br/></#list></td> 
    121149</tr> 
     150<#if screen.mutationVOResult?size == 1> 
     151<#if screen.mutationVOOther?size &gt; 0> 
     152<tr> 
     153<td></td> 
     154<td colspan="14"> 
     155Other mutations at this position<br/> 
     156<table border="1"> 
     157<tr style="background-color:#eeeeee;"> 
     158<td>cDNA</td> 
     159<td>Protein</td> 
     160<td>Exon</td> 
     161<td>Consequence</td> 
     162<td>Associated phenotypes</td> 
     163<td>References</td> 
     164</tr> 
     165<#list screen.mutationVOOther as othermutationVO> 
     166<tr> 
     167<td>${othermutationVO.cdna_notation}</td> 
     168<td>(to be implemented)</td> 
     169<td>${othermutationVO.exonName}</td> 
     170<td>${othermutationVO.consequence}</td> 
     171<td>${othermutationVO.phenotype}</td> 
     172<td><#list othermutationVO.publications as publication>${publication}<br/></#list></td> 
     173</tr> 
     174</#list> 
    122175</table> 
    123 <!-- 
    124 <table> 
    125 <tr><td>cDNA</td><td>${mutationVO.cdna_notation}</td></tr> 
    126 <tr><td>gDNA</td><td>${mutationVO.gdna_notation}</td></tr> 
    127 <tr><td>Codon change</td><td>${mutationVO.codon_change}</td></tr> 
    128 <tr><td>Protein</td><td>(to be implemented)</td></tr> 
    129 <tr><td>Exon</td><td>${mutationVO.exon}</td></tr> 
    130 <tr><td>Consequence</td><td>${mutationVO.consequence}</td></tr> 
    131 <tr><td>Dominant or recessive</td><td>(to be implemented)</td></tr> 
    132 <tr><td>Reported as SNP</td><td>${mutationVO.reportedSNP?string("yes", "no")}</td></tr> 
    133 <tr><td>Conserved amino acid</td><td>${mutationVO.conservedAA?string("yes", "no")}</td></tr> 
    134 <tr><td>Predicted effect on splicing</td><td>${mutationVO.effectOnSplicing?string("yes", "no")}</td></tr> 
    135 <tr><td>Protein domain</td><td>${mutationVO.proteinDomain}</td></tr> 
    136 <tr><td>Founder domain</td><td>${mutationVO.founderMutation?string("yes", "no")}</td></tr> 
    137 <tr><td>Population</td><td>${mutationVO.population}</td></tr> 
    138 <tr><td>Other mutations at this position</td><td>${mutationVO.exon}</td></tr> 
    139 <tr><td>Associated phenotypes</td><td>${mutationVO.phenotype}</td></tr> 
    140 <tr><td>References</td><td><#list mutationVO.publications as publication>${publication}<br/></#list></td></tr> 
     176</td> 
     177</#if> 
     178</#if> 
    141179</table> 
    142 --> 
    143180</#list> 
     181</p> 
    144182</#if> 
    145 </p> 
    146183 
    147184<#--<input name="myinput" value="${screen.getMyValue()}"> 
  • molgenis_projects/col7a1/handwritten/java/plugin/ui/SearchPlugin.java

    r2666 r2683  
    2323import vo.MutationVO; 
    2424import vo.ProteinDomainVO; 
     25import vo.QueryParametersVO; 
    2526 
    2627import col7a1.Exon; 
     
    2930public class SearchPlugin extends PluginModel 
    3031{ 
    31         private final String VARIATION = "Type variation"; 
    32         private final String GENBANKID = "NM_000094.3"; 
    33         private final String NUCLNO    = "Type nucleotide no"; 
    34         private final String AANO      = "Type amino acid no"; 
    35         private final String EXON      = "Type exon/intron"; 
     32        private MutationService mutationService; 
     33        private QueryParametersVO queryParametersVO; 
    3634         
    37         private MutationService mutationService; 
    38  
    39         private String param_variation; 
    40         private List<MutationVO> param_mutations; 
    41         private String param_genbankId; 
    42         private String param_nuclNo; 
    43         private String param_aaNo; 
    44         private String param_exon; 
    45         private List<ExonVO> param_exons; 
    46         private List<String> param_types; 
    47         private List<ProteinDomainVO> param_domains; 
    48         private HashMap<Integer, List<ExonVO>> exonsPerDomainId; 
    49          
     35        private List<ExonVO> exonVOResult; 
    5036        private List<MutationVO> mutationVOResult; 
     37        private List<MutationVO> mutationVOOther; 
    5138         
    5239        public SearchPlugin(String name, ScreenModel parent) 
     
    5845        private void init() 
    5946        { 
    60                 this.param_variation  = VARIATION; 
    61                 this.param_genbankId  = GENBANKID; 
    62                 this.param_nuclNo     = NUCLNO; 
    63                 this.param_aaNo       = AANO; 
    64                 this.param_exon       = EXON; 
    65                 this.exonsPerDomainId = new HashMap<Integer, List<ExonVO>>(); 
    66                 this.mutationVOResult = new ArrayList<MutationVO>(); 
     47                this.queryParametersVO = new QueryParametersVO(); 
     48 
     49                this.exonVOResult      = new ArrayList<ExonVO>(); 
     50                this.mutationVOResult  = new ArrayList<MutationVO>(); 
     51                this.mutationVOOther   = new ArrayList<MutationVO>(); 
    6752        } 
    6853 
     
    9479//                      this.mutationVOResult = mutationService.findMutations(id, cdna_notation, type, reportedSNP, exonId); 
    9580                         
     81                        String action = request.getAction(); 
     82                         
     83                         
     84                        if (request.getString("snpbool").equals("1")) 
     85                                this.queryParametersVO.setShowSNP(true); 
     86                         
    9687                        if (StringUtils.isNotEmpty(request.getString("mutation"))) 
    9788                        { 
    98                                 this.mutationVOResult = mutationService.findMutationById(Integer.valueOf(request.getString("mutation"))); 
     89                                this.queryParametersVO.setMutationId(Integer.valueOf(request.getString("mutation"))); 
     90                                this.mutationVOResult = mutationService.findMutationById(this.queryParametersVO.getMutationId(), request.getBool("snpbool")); 
     91                                for (MutationVO mutationVO : this.mutationVOResult) 
     92                                        this.mutationVOOther.addAll(mutationService.findMutationsByPosition(mutationVO.getPosition(), request.getBool("snpbool"))); 
    9993                        } 
    10094                        else if (StringUtils.isNotEmpty(request.getString("variation")) && 
    101                                         !StringUtils.equals(request.getString("variation"), this.param_variation)) 
     95                                        !StringUtils.equals(request.getString("variation"), this.queryParametersVO.getMutationName())) 
    10296                        { 
    103                                 this.param_variation  = request.getString("variation"); 
    104                                 this.mutationVOResult = mutationService.findMutationByCdna_notation(request.getString("variation")); 
     97                                this.queryParametersVO.setMutationName(request.getString("variation")); 
     98                                this.mutationVOResult = mutationService.findMutationByCdna_notation(this.queryParametersVO.getMutationName(), request.getBool("snpbool")); 
     99                                for (MutationVO mutationVO : this.mutationVOResult) 
     100                                        this.mutationVOOther.addAll(mutationService.findMutationsByPosition(mutationVO.getPosition(), request.getBool("snpbool"))); 
    105101                        } 
    106102                        else if (StringUtils.isNotEmpty(request.getString("nuclno")) && 
    107                                         !StringUtils.equals(request.getString("nuclno"), this.param_nuclNo)) 
     103                                        !StringUtils.equals(request.getString("nuclno"), this.queryParametersVO.getMutationPosition().toString())) 
    108104                        { 
    109                                 this.param_nuclNo           = request.getString("nuclno"); 
    110                                 //TODO 
     105                                this.queryParametersVO.setMutationPosition(request.getString("nuclno")); 
     106                                this.mutationVOResult = mutationService.findMutationsByPosition(Integer.valueOf(this.queryParametersVO.getMutationPosition()), request.getBool("snpbool")); 
     107                                for (MutationVO mutationVO : mutationVOResult) 
     108                                        this.exonVOResult.add(mutationService.findExonById(mutationVO.getExonId())); 
     109                                for (MutationVO mutationVO : this.mutationVOResult) 
     110                                        this.mutationVOOther.addAll(mutationService.findMutationsByPosition(mutationVO.getPosition(), request.getBool("snpbool"))); 
    111111                        } 
    112112                        else if (StringUtils.isNotEmpty(request.getString("aano")) && 
    113                                         !StringUtils.equals(request.getString("aano"), this.param_aaNo)) 
     113                                        !StringUtils.equals(request.getString("aano"), this.queryParametersVO.getAaNo())) 
    114114                        { 
    115                                 this.param_aaNo             = request.getString("aaNo"); 
     115                                this.queryParametersVO.setAaNo(request.getString("aaNo")); 
    116116                                //TODO 
    117117                        } 
    118118                        else if (StringUtils.isNotEmpty(request.getString("exon")) && 
    119                                         !StringUtils.equals(request.getString("exon"), this.param_exon)) 
     119                                        !StringUtils.equals(request.getString("exon"), this.queryParametersVO.getExonNumber().toString())) 
    120120                        { 
    121                                 //TODO 
     121                                this.queryParametersVO.setExonNumber(request.getString("exon")); 
     122                                this.exonVOResult     = mutationService.findExonsByNumber(Integer.valueOf(this.queryParametersVO.getExonNumber())); 
     123                                for (ExonVO exonVO : this.exonVOResult) 
     124                                        this.mutationVOResult.addAll(mutationService.findMutationByExonId(exonVO.getId(), request.getBool("snpbool"))); 
    122125                        } 
    123126                        else if (StringUtils.isNotEmpty(request.getString("exonlist"))) 
    124127                        { 
    125                                 this.mutationVOResult = mutationService.findMutationByExon(Integer.valueOf(request.getString("exonlist"))); 
     128                                this.queryParametersVO.setExonId(Integer.valueOf(request.getString("exonlist"))); 
     129                                ExonVO exonVO         = mutationService.findExonById(this.queryParametersVO.getExonId()); 
     130                                this.exonVOResult.add(exonVO); 
     131                                this.mutationVOResult = mutationService.findMutationByExonId(exonVO.getId(), request.getBool("snpbool")); 
    126132                        } 
    127133                        else if (StringUtils.isNotEmpty(request.getString("type"))) 
    128134                        { 
    129                                 this.mutationVOResult = mutationService.findMutationByType(request.getString("type")); 
     135                                this.queryParametersVO.setMutationType(request.getString("type")); 
     136                                this.mutationVOResult = mutationService.findMutationByType(this.queryParametersVO.getMutationType(), request.getBool("snpbool")); 
    130137                        } 
    131138                        else if (StringUtils.isNotEmpty(request.getString("domain"))) 
    132139                        { 
    133                                 //TODO 
     140                                this.queryParametersVO.setProteinDomainId(Integer.valueOf(request.getString("domain"))); 
     141                                this.exonVOResult     = mutationService.findExonsByProteinDomainId(this.queryParametersVO.getProteinDomainId()); 
    134142                        } 
    135143                } 
     
    144152        { 
    145153                this.mutationService = new MutationService(db); 
    146                 try 
    147                 { 
    148                         this.param_mutations = this.mutationService.getMutations(); 
    149                         this.param_exons     = this.mutationService.getExons(); 
    150                          
    151                         this.param_types     = this.mutationService.getMutationTypes(); 
    152                         this.param_domains   = this.mutationService.getProteinDomains(); 
    153                          
    154                         for (ProteinDomainVO domainVO : this.param_domains) 
    155                         { 
    156                                 if (!this.exonsPerDomainId.containsKey(domainVO.getId())) 
    157                                         this.exonsPerDomainId.put(domainVO.getId(), new ArrayList<ExonVO>()); 
    158                                 for (ExonVO exonVO : this.mutationService.findExonsByProteinDomainId(domainVO.getId())) 
    159                                         this.exonsPerDomainId.get(domainVO.getId()).add(exonVO); 
    160                         } 
    161                         //do something 
    162                 } 
    163                 catch(Exception e) 
    164                 { 
    165                         //TODO: What to do here? 
    166                 } 
    167154        } 
    168155         
     
    176163        } 
    177164         
    178         public String getVariation() 
     165        public MutationService getMutationService() 
    179166        { 
    180                 return this.param_variation; 
    181         } 
    182          
    183         public List<MutationVO> getMutations() 
    184         { 
    185                 return this.param_mutations; 
     167                return this.mutationService; 
    186168        } 
    187169 
    188         public String getGenbankId() 
     170        public QueryParametersVO getQueryParametersVO() 
    189171        { 
    190                 return this.param_genbankId; 
    191         } 
    192          
    193         public String getNuclNo() 
    194         { 
    195                 return this.param_nuclNo; 
    196         } 
    197          
    198         public String getAaNo() 
    199         { 
    200                 return this.param_aaNo; 
    201         } 
    202          
    203         public String getExon() 
    204         { 
    205                 return this.param_exon; 
    206         } 
    207          
    208         public List<ExonVO> getExons() 
    209         { 
    210                 return this.param_exons; 
     172                return this.queryParametersVO; 
    211173        } 
    212174 
    213         public List<ExonVO> getExons(ProteinDomainVO domainVO) 
     175        public List<ExonVO> getExonVOResult() 
    214176        { 
    215                 return this.exonsPerDomainId.get(domainVO.getId()); 
     177                return this.exonVOResult; 
    216178        } 
    217179 
    218         public ExonVO getFirstExon(ProteinDomainVO domainVO) 
    219         { 
    220                 return this.exonsPerDomainId.get(domainVO.getId()).get(0); 
    221         } 
    222  
    223         public ExonVO getLastExon(ProteinDomainVO domainVO) 
    224         { 
    225                 return this.exonsPerDomainId.get(domainVO.getId()).get(this.exonsPerDomainId.get(domainVO.getId()).size() - 1); 
    226         } 
    227          
    228         public List<String> getTypes() 
    229         { 
    230                 return this.param_types; 
    231         } 
    232          
    233         public List<ProteinDomainVO> getProteinDomains() 
    234         { 
    235                 return this.param_domains; 
    236         } 
    237          
    238180        public List<MutationVO> getMutationVOResult() 
    239181        { 
    240182                return this.mutationVOResult; 
    241183        } 
     184         
     185        public List<MutationVO> getMutationVOOther() 
     186        { 
     187                return this.mutationVOOther; 
     188        } 
    242189} 
  • molgenis_projects/col7a1/handwritten/java/service/MutationService.java

    r2666 r2683  
    88import org.apache.commons.lang.StringUtils; 
    99import org.molgenis.framework.db.Database; 
    10 import org.molgenis.framework.db.Query; 
    1110 
    1211import vo.ExonVO; 
     
    3029        } 
    3130 
     31        public ExonVO findExonById(Integer id) throws Exception 
     32        { 
     33                Exon exon = this.db.findById(Exon.class, id); 
     34                return this.toExonVO(exon); 
     35        } 
     36        public List<ExonVO> findExonsByNumber(Integer number) throws Exception 
     37        { 
     38                List<Exon> exons = this.db.query(Exon.class).equals("number_", number).find(); 
     39                return this.toExonVOList(exons); 
     40        } 
     41 
    3242        public List<ExonVO> findExonsByProteinDomainId(Integer proteinDomainId) throws Exception 
    3343        { 
     
    3848        public List<MutationVO> findMutations(Integer id, String cdna_notation, String type, Boolean reportedSNP, Integer exonId) throws Exception 
    3949        { 
    40                 return this.findMutationById(id); 
     50                return this.findMutationById(id, reportedSNP); 
    4151//              Query<Mutation> query = this.db.query(Mutation.class).equals("id", id); 
    4252                 
     
    5767        } 
    5868 
    59         public List<MutationVO> findMutationById(Integer id) throws Exception 
    60         { 
    61                 List<Mutation> mutations = this.db.query(Mutation.class).equals("id", id).find(); 
    62                 return this.toMutationVOList(mutations); 
    63         } 
    64          
    65         public List<MutationVO> findMutationByCdna_notation(String cdna_notation) throws Exception 
    66         { 
    67                 List<Mutation> mutations = this.db.query(Mutation.class).equals("cdna_notation", cdna_notation).find(); 
    68                 return this.toMutationVOList(mutations); 
    69         } 
    70          
    71         public List<MutationVO> findMutationByExon(Integer id) throws Exception 
    72         { 
    73                 List<Mutation> mutations = this.db.query(Mutation.class).equals("exon", id).find(); 
    74                 return this.toMutationVOList(mutations); 
    75         } 
    76          
    77         public List<MutationVO> findMutationByType(String type) throws Exception 
    78         { 
    79                 List<Mutation> mutations = this.db.query(Mutation.class).equals("type_", type).find(); 
     69        public List<MutationVO> findMutationById(Integer id, Boolean reportedSNP) throws Exception 
     70        { 
     71                List<Mutation> mutations = this.db.query(Mutation.class).equals("id", id).equals("reportedSNP", reportedSNP).find(); 
     72                return this.toMutationVOList(mutations); 
     73        } 
     74         
     75        public List<MutationVO> findMutationByCdna_notation(String cdna_notation, Boolean reportedSNP) throws Exception 
     76        { 
     77                List<Mutation> mutations = this.db.query(Mutation.class).equals("cdna_notation", cdna_notation).equals("reportedSNP", reportedSNP).find(); 
     78                return this.toMutationVOList(mutations); 
     79        } 
     80         
     81        public List<MutationVO> findMutationByExonId(Integer id, Boolean reportedSNP) throws Exception 
     82        { 
     83                List<Mutation> mutations = this.db.query(Mutation.class).equals("exon", id).equals("reportedSNP", reportedSNP).find(); 
     84                return this.toMutationVOList(mutations); 
     85        } 
     86         
     87        public List<MutationVO> findMutationsByPosition(Integer position, Boolean reportedSNP) throws Exception 
     88        { 
     89                List<Mutation> mutations = this.db.query(Mutation.class).equals("position", position).equals("reportedSNP", reportedSNP).find(); 
     90                return this.toMutationVOList(mutations); 
     91        } 
     92         
     93        public List<MutationVO> findMutationByExonNumber(Integer number, Boolean reportedSNP) throws Exception 
     94        { 
     95                List<Exon> exons         = this.db.query(Exon.class).equals("number_", number).find(); 
     96                List<Mutation> mutations = new ArrayList<Mutation>(); 
     97                for (Exon exon : exons) 
     98                        mutations.addAll(this.db.query(Mutation.class).equals("exon", exon.getId()).equals("reportedSNP", reportedSNP).find()); 
     99                return this.toMutationVOList(mutations); 
     100        } 
     101         
     102        public List<MutationVO> findMutationByType(String type, Boolean reportedSNP) throws Exception 
     103        { 
     104                List<Mutation> mutations = this.db.query(Mutation.class).equals("type_", type).equals("reportedSNP", reportedSNP).find(); 
    80105                return this.toMutationVOList(mutations); 
    81106        } 
     
    118143                        exonVO.setCdna_position(exon.getCdna_position()); 
    119144                        exonVO.setGdna_position(exon.getGdna_position()); 
    120                         exonVO.setGene(gene.getName()); 
     145                        exonVO.setGeneName(gene.getName()); 
     146                        exonVO.setSequence(StringUtils.substring(gene.getSequence(), exon.getCdna_position() - 1, exon.getCdna_position() - 1 + exon.getLength())); 
    121147                        exonVO.setId(exon.getId()); 
    122148                        exonVO.setLength(exon.getLength()); 
     
    165191                        mutationVO.setConservedAA(mutation.getConservedAA()); 
    166192                        mutationVO.setEffectOnSplicing(mutation.getEffectOnSplicing()); 
    167                         mutationVO.setExon(exon.getName()); 
     193                        mutationVO.setExonId(exon.getId()); 
     194                        mutationVO.setExonName(exon.getName()); 
    168195                        mutationVO.setFounderMutation(mutation.getFounderMutation()); 
    169196                        mutationVO.setGdna_notation(mutation.getGdna_notation()); 
    170197                        mutationVO.setGene(gene.getName()); 
     198                        mutationVO.setLength_(mutation.getLength_()); 
    171199                        mutationVO.setPhenotype(phenotype.getName()); 
    172200                        mutationVO.setPopulation(mutation.getPopulation()); 
     201                        mutationVO.setPosition(mutation.getPosition()); 
    173202                        mutationVO.setPublications(publications); 
    174203                        mutationVO.setProteinDomain(proteinDomain.getName()); 
  • molgenis_projects/col7a1/handwritten/java/vo/ExonVO.java

    r2666 r2683  
    1212        private Integer _gdna_position = null; 
    1313        private Integer _length = null; 
    14         private String _gene = null; 
     14        private String _geneName = null; 
     15        private String _sequence = null; 
    1516        private String _proteinDomain = null; 
    1617         
     
    124125 
    125126        /** 
    126          * Get the gene. 
    127          * @return gene. 
     127         * Get the gene name. 
     128         * @return gene name. 
    128129         */ 
    129         public String getGene() 
     130        public String getGeneName() 
    130131        { 
    131                 return this._gene; 
     132                return this._geneName; 
    132133        } 
    133134         
    134135        /** 
    135          * Set the gene. 
    136          * @param _gene 
     136         * Set the gene name. 
     137         * @param _gene name 
    137138         */ 
    138         public void setGene(String _gene) 
     139        public void setGeneName(String _geneName) 
    139140        { 
    140                 this._gene = _gene; 
     141                this._geneName = _geneName; 
    141142        } 
    142143 
    143144        /** 
     145         * Get the gene sequence. 
     146         * @return gene sequence. 
     147         */ 
     148        public String getSequence() 
     149        { 
     150                return this._sequence; 
     151        } 
     152         
     153        /** 
     154         * Set the gene sequence. 
     155         * @param _gene sequence 
     156         */ 
     157        public void setSequence(String _sequence) 
     158        { 
     159                this._sequence = _sequence; 
     160        } 
     161 
     162        /**§ 
    144163         * Get the proteinDomain. 
    145164         * @return proteinDomain. 
  • molgenis_projects/col7a1/handwritten/java/vo/MutationVO.java

    r2666 r2683  
    77{ 
    88        private Integer _id = null; 
     9        private Integer _position = null; 
     10        private Integer _length_ = null; 
    911        private String _codon_change = null; 
    1012        private String _cdna_notation = null; 
    1113        private String _gdna_notation = null; 
    1214        private String _aa_notation = null; 
    13         private String _exon = null; 
     15        private Integer _exonId = null; 
     16        private String _exonName = null; 
    1417        private String _consequence = null; 
    1518        private String _dominance = null; 
     
    3538 
    3639        /** 
     40         * Get the Position in bp inside of the exon.. 
     41         * @return position. 
     42         */ 
     43        public Integer getPosition() 
     44        { 
     45                return this._position; 
     46        } 
     47         
     48        /** 
     49         * Set the Position in bp inside of the exon.. 
     50         * @param _position 
     51         */ 
     52        public void setPosition(Integer _position) 
     53        { 
     54                this._position = _position; 
     55        } 
     56 
     57        /** 
     58         * Get the Length of the mutation.. 
     59         * @return length_. 
     60         */ 
     61        public Integer getLength_() 
     62        { 
     63                return this._length_; 
     64        } 
     65         
     66        /** 
     67         * Set the Length of the mutation.. 
     68         * @param _length_ 
     69         */ 
     70        public void setLength_(Integer _length_) 
     71        { 
     72                this._length_ = _length_; 
     73        } 
     74 
     75        /** 
    3776         * Get the A description of the change of the codon.. 
    3877         * @return codon_change. 
     
    107146 
    108147        /** 
    109          * Get the Exon. Should be calculated automatically.. 
    110          * @return exon. 
    111          */ 
    112         public String getExon() 
    113         { 
    114                 return this._exon; 
    115         } 
    116  
    117         /** 
    118          * Set the Exon. Should be calculated automatically.. Automatically calls this.setExon(exon.getId); 
    119          * @param _exon 
    120          */ 
    121         public void setExon(String exon) 
    122         { 
    123                 this._exon = exon; 
     148         * Get the Exon id. 
     149         * @return exon id. 
     150         */ 
     151        public Integer getExonId() 
     152        { 
     153                return this._exonId; 
     154        } 
     155 
     156        /** 
     157         * Set the Exon id. 
     158         * @param _exonId 
     159         */ 
     160        public void setExonId(Integer exonId) 
     161        { 
     162                this._exonId = exonId; 
     163        }        
     164 
     165        /** 
     166         * Get the Exon name. 
     167         * @return exonName. 
     168         */ 
     169        public String getExonName() 
     170        { 
     171                return this._exonName; 
     172        } 
     173 
     174        /** 
     175         * Set the Exon name. 
     176         * @param _exonName 
     177         */ 
     178        public void setExonName(String exonName) 
     179        { 
     180                this._exonName = exonName; 
    124181        }        
    125182 
Note: See TracChangeset for help on using the changeset viewer.