Changeset 2666
- Timestamp:
- 02/26/10 18:10:09 (2 years ago)
- Location:
- molgenis_projects/col7a1
- Files:
-
- 2 added
- 6 edited
-
handwritten/java/LoadExamples.java (modified) (1 diff)
-
handwritten/java/plugin/ui/SearchPlugin.ftl (modified) (2 diffs)
-
handwritten/java/plugin/ui/SearchPlugin.java (modified) (7 diffs)
-
handwritten/java/service/MutationService.java (modified) (7 diffs)
-
handwritten/java/vo/ExonVO.java (added)
-
handwritten/java/vo/MutationVO.java (modified) (2 diffs)
-
handwritten/java/vo/ProteinDomainVO.java (added)
-
molgenis_db.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
molgenis_projects/col7a1/handwritten/java/LoadExamples.java
r2659 r2666 125 125 mutation.setExon(exon1); 126 126 mutation.setConsequence("PTC"); 127 mutation.setDominance("dominant"); 127 128 mutation.setReportedSNP(true); 128 129 mutation.setConservedAA(true); -
molgenis_projects/col7a1/handwritten/java/plugin/ui/SearchPlugin.ftl
r2659 r2666 84 84 <#list screen.mutationVOResult as mutationVO> 85 85 <table border="1"> 86 <tr >86 <tr bgcolor="#eeeeee"> 87 87 <td>cDNA</td> 88 88 <td>gDNA</td> … … 109 109 <td>${mutationVO.exon}</td> 110 110 <td>${mutationVO.consequence}</td> 111 <td> (to be implemented)</td>111 <td>${mutationVO.dominance}</td> 112 112 <td>${mutationVO.reportedSNP?string("yes", "no")}</td> 113 113 <td>${mutationVO.conservedAA?string("yes", "no")}</td> -
molgenis_projects/col7a1/handwritten/java/plugin/ui/SearchPlugin.java
r2659 r2666 20 20 21 21 import service.MutationService; 22 import vo.ExonVO; 22 23 import vo.MutationVO; 24 import vo.ProteinDomainVO; 23 25 24 26 import col7a1.Exon; … … 41 43 private String param_aaNo; 42 44 private String param_exon; 43 private List<Exon > param_exons;45 private List<ExonVO> param_exons; 44 46 private List<String> param_types; 45 private List<ProteinDomain > param_domains;46 private HashMap<Integer, List<Exon >> exonsPerDomainId;47 private List<ProteinDomainVO> param_domains; 48 private HashMap<Integer, List<ExonVO>> exonsPerDomainId; 47 49 48 50 private List<MutationVO> mutationVOResult; … … 61 63 this.param_aaNo = AANO; 62 64 this.param_exon = EXON; 63 this.exonsPerDomainId = new HashMap<Integer, List<Exon >>();65 this.exonsPerDomainId = new HashMap<Integer, List<ExonVO>>(); 64 66 this.mutationVOResult = new ArrayList<MutationVO>(); 65 67 } … … 84 86 try 85 87 { 88 // Integer id = Integer.valueOf(request.getString("mutation")); 89 // String cdna_notation = request.getString("variation"); 90 // String type = request.getString("type"); 91 // Integer exonId = Integer.valueOf(request.getString("exonlist")); 92 // Boolean reportedSNP = request.getBoolean("snpbool"); 93 // 94 // this.mutationVOResult = mutationService.findMutations(id, cdna_notation, type, reportedSNP, exonId); 95 86 96 if (StringUtils.isNotEmpty(request.getString("mutation"))) 87 97 { … … 142 152 this.param_domains = this.mutationService.getProteinDomains(); 143 153 144 for (ProteinDomain domain: this.param_domains)145 { 146 if (!this.exonsPerDomainId.containsKey(domain .getId()))147 this.exonsPerDomainId.put(domain .getId(), new ArrayList<Exon>());148 for (Exon exon : this.mutationService.findExonsByProteinDomainId(domain.getId()))149 this.exonsPerDomainId.get(domain .getId()).add(exon);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); 150 160 } 151 161 //do something … … 196 206 } 197 207 198 public List<Exon > getExons()208 public List<ExonVO> getExons() 199 209 { 200 210 return this.param_exons; 201 211 } 202 212 203 public List<Exon > getExons(ProteinDomain domain)204 { 205 return this.exonsPerDomainId.get(domain .getId());206 } 207 208 public Exon getFirstExon(ProteinDomain domain)209 { 210 return this.exonsPerDomainId.get(domain .getId()).get(0);211 } 212 213 public Exon getLastExon(ProteinDomain domain)214 { 215 return this.exonsPerDomainId.get(domain .getId()).get(this.exonsPerDomainId.get(domain.getId()).size() - 1);213 public List<ExonVO> getExons(ProteinDomainVO domainVO) 214 { 215 return this.exonsPerDomainId.get(domainVO.getId()); 216 } 217 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); 216 226 } 217 227 … … 221 231 } 222 232 223 public List<ProteinDomain > getProteinDomains()233 public List<ProteinDomainVO> getProteinDomains() 224 234 { 225 235 return this.param_domains; -
molgenis_projects/col7a1/handwritten/java/service/MutationService.java
r2659 r2666 6 6 import java.util.List; 7 7 8 import org.apache.commons.lang.StringUtils; 8 9 import org.molgenis.framework.db.Database; 9 10 import org.molgenis.framework.db.Query; 11 12 import vo.ExonVO; 10 13 import vo.MutationVO; 14 import vo.ProteinDomainVO; 11 15 import col7a1.Exon; 12 16 import col7a1.Gene; … … 26 30 } 27 31 28 //TODO: Create VO 29 public List<Exon> findExonsByProteinDomainId(Integer proteinDomainId) throws Exception 30 { 31 return this.db.query(Exon.class).equals("proteinDomain", proteinDomainId).sortASC("number_").find(); 32 public List<ExonVO> findExonsByProteinDomainId(Integer proteinDomainId) throws Exception 33 { 34 List<Exon> exons = this.db.query(Exon.class).equals("proteinDomain", proteinDomainId).sortASC("number_").find(); 35 return this.toExonVOList(exons); 36 } 37 38 public List<MutationVO> findMutations(Integer id, String cdna_notation, String type, Boolean reportedSNP, Integer exonId) throws Exception 39 { 40 return this.findMutationById(id); 41 // Query<Mutation> query = this.db.query(Mutation.class).equals("id", id); 42 43 // if (id != null) 44 // query = query.equals("id", id); 45 // else if (StringUtils.isNotEmpty(cdna_notation)) 46 // query = query.equals("cdna_notation", cdna_notation); 47 // else if (StringUtils.isNotEmpty(type)) 48 // query = query.equals("type_", type); 49 // else if (exonId != null) 50 // query = query.equals("exon", exonId); 51 //TODO: Howto AND? 52 //if (reportedSNP) 53 // query = query.equals("reportedSNP", reportedSNP).and(); 54 55 // List<Mutation> mutations = query.find(); 56 // return this.toMutationVOList(mutations); 32 57 } 33 58 … … 56 81 } 57 82 58 //TODO: Create VO59 public List<Exon> getExons() throws Exception60 {61 return this. db.query(Exon.class).find();83 public List<ExonVO> getExons() throws Exception 84 { 85 List<Exon> exons = this.db.query(Exon.class).find(); 86 return this.toExonVOList(exons); 62 87 } 63 88 … … 68 93 } 69 94 70 //TODO: Create VO71 public List<ProteinDomain> getProteinDomains() throws Exception72 {73 return this. db.query(ProteinDomain.class).find();95 public List<ProteinDomainVO> getProteinDomains() throws Exception 96 { 97 List<ProteinDomain> domains = this.db.query(ProteinDomain.class).find(); 98 return this.toProteinDomainVOList(domains); 74 99 } 75 100 … … 83 108 } 84 109 85 public List<MutationVO> toMutationVOList(List<Mutation> mutations) 86 { 87 List<MutationVO> mutationVOs = new ArrayList<MutationVO>(); 88 89 for (Mutation mutation : mutations) 90 mutationVOs.add(this.toMutationVO(mutation)); 91 92 return mutationVOs; 110 public ExonVO toExonVO(Exon exon) 111 { 112 ExonVO exonVO = new ExonVO(); 113 114 try 115 { 116 Gene gene = this.db.findById(Gene.class, exon.getGene()); 117 ProteinDomain proteinDomain = this.db.findById(ProteinDomain.class, exon.getProteinDomain()); 118 exonVO.setCdna_position(exon.getCdna_position()); 119 exonVO.setGdna_position(exon.getGdna_position()); 120 exonVO.setGene(gene.getName()); 121 exonVO.setId(exon.getId()); 122 exonVO.setLength(exon.getLength()); 123 exonVO.setName(exon.getName()); 124 exonVO.setNumber_(exon.getNumber_()); 125 exonVO.setProteinDomain(proteinDomain.getName()); 126 } 127 catch (Exception e) 128 { 129 //TODO: What to do here? 130 } 131 132 return exonVO; 133 } 134 135 public List<ExonVO> toExonVOList(List<Exon> exons) 136 { 137 List<ExonVO> exonVOs = new ArrayList<ExonVO>(); 138 139 for (Exon exon : exons) 140 exonVOs.add(this.toExonVO(exon)); 141 142 return exonVOs; 93 143 } 94 144 … … 112 162 mutationVO.setCodon_change(mutation.getCodon_change()); 113 163 mutationVO.setConsequence(mutation.getConsequence()); 164 mutationVO.setDominance(mutation.getDominance()); 114 165 mutationVO.setConservedAA(mutation.getConservedAA()); 115 166 mutationVO.setEffectOnSplicing(mutation.getEffectOnSplicing()); … … 131 182 return mutationVO; 132 183 } 184 185 public List<MutationVO> toMutationVOList(List<Mutation> mutations) 186 { 187 List<MutationVO> mutationVOs = new ArrayList<MutationVO>(); 188 189 for (Mutation mutation : mutations) 190 mutationVOs.add(this.toMutationVO(mutation)); 191 192 return mutationVOs; 193 } 194 195 public ProteinDomainVO toProteinDomainVO(ProteinDomain domain) 196 { 197 ProteinDomainVO domainVO = new ProteinDomainVO(); 198 199 try 200 { 201 ProteinDomain superDomain = this.db.findById(ProteinDomain.class, domain.getSuperDomain()); 202 domainVO.setId(domain.getId()); 203 domainVO.setName(domain.getName()); 204 domainVO.setSuperDomain(superDomain.getName()); 205 } 206 catch (Exception e) 207 { 208 //TODO: What to do here? 209 } 210 211 return domainVO; 212 } 213 214 public List<ProteinDomainVO> toProteinDomainVOList(List<ProteinDomain> domains) 215 { 216 List<ProteinDomainVO> ProteinDomainVOs = new ArrayList<ProteinDomainVO>(); 217 218 for (ProteinDomain domain : domains) 219 ProteinDomainVOs.add(this.toProteinDomainVO(domain)); 220 221 return ProteinDomainVOs; 222 } 133 223 } -
molgenis_projects/col7a1/handwritten/java/vo/MutationVO.java
r2659 r2666 13 13 private String _exon = null; 14 14 private String _consequence = null; 15 private String _dominance = null; 15 16 private Boolean _reportedSNP = null; 16 17 private Boolean _conservedAA = null; … … 141 142 } 142 143 144 public String getDominance() 145 { 146 return this._dominance; 147 } 148 149 public void setDominance(String _dominance) 150 { 151 this._dominance = _dominance; 152 } 153 143 154 /** 144 155 * Get the Reported as SNP? Should be calculated automatically.. -
molgenis_projects/col7a1/molgenis_db.xml
r2660 r2666 102 102 <field name="exon" type="xref" xref_field="Exon.id" xref_label="name" description="Exon. Should be calculated automatically."/> 103 103 <field name="consequence" type="enum" enum_options="[PTC,No initiation,Altered splicing,Missense]"/> 104 <field name="dominance" type="enum" enum_options="[dominant,recessive]" description="Is the mutation dominant or recessive?"/> 104 105 <field name="reportedSNP" type="bool" description="Reported as SNP? Should be calculated automatically."/> 105 106 <field name="conservedAA" type="bool" description="Conserved amino acid.? Should be calculated automatically."/>
Note: See TracChangeset
for help on using the changeset viewer.