-
Notifications
You must be signed in to change notification settings - Fork 0
Kpmp 6335 fix dupes #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Kpmp 6335 fix dupes #206
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
296 changes: 148 additions & 148 deletions
296
src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,148 +1,148 @@ | ||
| package org.kpmp.geneExpression; | ||
| import java.io.Serializable; | ||
| import jakarta.persistence.Column; | ||
| import jakarta.persistence.Entity; | ||
| import jakarta.persistence.Id; | ||
| import jakarta.persistence.Table; | ||
| @Entity | ||
| @Table(name = "rt_segments") | ||
| public class RTExpressionDataAllSegments implements RTExpressionData, Serializable { | ||
| private static final long serialVersionUID = 9029734049386312455L; | ||
| @Id | ||
| @Column(name = "id") | ||
| private Integer id; | ||
| @Column(name = "gene_symbol") | ||
| private String geneSymbol; | ||
| @Column(name = "segment") | ||
| private String segment; | ||
| @Column(name = "segment_name") | ||
| private String segmentName; | ||
| @Column(name = "fold_change") | ||
| private Double foldChange; | ||
| @Column(name = "p_val") | ||
| private Double pVal; | ||
| @Column(name = "std_dev") | ||
| private Double stdDev; | ||
| @Column(name = "p_val_log10") | ||
| private Double pValLog10; | ||
| @Column(name = "enrollment_category") | ||
| private String enrollmentCategory; | ||
| @Column(name = "adj_p_val") | ||
| private Double adjPVal; | ||
| @Column(name = "sample_count") | ||
| private Integer sampleCount; | ||
| @Override | ||
| public Integer getId() { | ||
| return id; | ||
| } | ||
| @Override | ||
| public void setId(Integer id) { | ||
| this.id = id; | ||
| } | ||
| @Override | ||
| public String getGeneSymbol() { | ||
| return geneSymbol; | ||
| } | ||
| @Override | ||
| public void setGeneSymbol(String geneSymbol) { | ||
| this.geneSymbol = geneSymbol; | ||
| } | ||
| @Override | ||
| public String getSegment() { | ||
| return segment; | ||
| } | ||
| @Override | ||
| public void setSegment(String segment) { | ||
| this.segment = segment; | ||
| } | ||
| @Override | ||
| public Double getFoldChange() { | ||
| return foldChange; | ||
| } | ||
| @Override | ||
| public void setFoldChange(Double foldChange) { | ||
| this.foldChange = foldChange; | ||
| } | ||
| @Override | ||
| public Double getPVal() { | ||
| return pVal; | ||
| } | ||
| @Override | ||
| public void setPVal(Double pVal) { | ||
| this.pVal = pVal; | ||
| } | ||
| @Override | ||
| public Double getStdDev() { | ||
| return stdDev; | ||
| } | ||
| @Override | ||
| public void setStdDev(Double stdDev) { | ||
| this.stdDev = stdDev; | ||
| } | ||
| @Override | ||
| public Double getPValLog10() { | ||
| return pValLog10; | ||
| } | ||
| @Override | ||
| public void setPValLog10(Double pValLog10) { | ||
| this.pValLog10 = pValLog10; | ||
| } | ||
| @Override | ||
| public String getEnrollmentCategory() { | ||
| return enrollmentCategory; | ||
| } | ||
| @Override | ||
| public void setEnrollmentCategory(String enrollmentCategory) { | ||
| this.enrollmentCategory = enrollmentCategory; | ||
| } | ||
| @Override | ||
| public Integer getSampleCount() { | ||
| return sampleCount; | ||
| } | ||
| @Override | ||
| public void setSampleCount(Integer sampleCount) { | ||
| this.sampleCount = sampleCount; | ||
| } | ||
| @Override | ||
| public String getSegmentName() { | ||
| return segmentName; | ||
| } | ||
| @Override | ||
| public void setSegmentName(String segmentName) { | ||
| this.segmentName = segmentName; | ||
| } | ||
| @Override | ||
| public Double getAdjPVal() { | ||
| return adjPVal; | ||
| } | ||
| @Override | ||
| public void setAdjPVal(Double adjPVal) { | ||
| this.adjPVal = adjPVal; | ||
| } | ||
| } | ||
| package org.kpmp.geneExpression; | ||
|
|
||
| import java.io.Serializable; | ||
|
|
||
| import jakarta.persistence.*; | ||
|
|
||
| @Entity | ||
| @Table(name = "rt_segments") | ||
| @IdClass(RTExpressionDataId.class) | ||
| public class RTExpressionDataAllSegments implements RTExpressionData, Serializable { | ||
|
|
||
| private static final long serialVersionUID = 9029734049386312455L; | ||
| @Id | ||
| @Column(name = "id") | ||
| private Integer id; | ||
| @Id | ||
| @Column(name = "gene_symbol") | ||
| private String geneSymbol; | ||
| @Column(name = "segment") | ||
| private String segment; | ||
| @Column(name = "segment_name") | ||
| private String segmentName; | ||
| @Column(name = "fold_change") | ||
| private Double foldChange; | ||
| @Id | ||
| @Column(name = "p_val") | ||
| private Double pVal; | ||
| @Column(name = "std_dev") | ||
| private Double stdDev; | ||
| @Column(name = "p_val_log10") | ||
| private Double pValLog10; | ||
| @Column(name = "enrollment_category") | ||
| private String enrollmentCategory; | ||
| @Column(name = "adj_p_val") | ||
| private Double adjPVal; | ||
| @Column(name = "sample_count") | ||
| private Integer sampleCount; | ||
|
|
||
| @Override | ||
| public Integer getId() { | ||
| return id; | ||
| } | ||
|
|
||
| @Override | ||
| public void setId(Integer id) { | ||
| this.id = id; | ||
| } | ||
|
|
||
| @Override | ||
| public String getGeneSymbol() { | ||
| return geneSymbol; | ||
| } | ||
|
|
||
| @Override | ||
| public void setGeneSymbol(String geneSymbol) { | ||
| this.geneSymbol = geneSymbol; | ||
| } | ||
|
|
||
| @Override | ||
| public String getSegment() { | ||
| return segment; | ||
| } | ||
|
|
||
| @Override | ||
| public void setSegment(String segment) { | ||
| this.segment = segment; | ||
| } | ||
|
|
||
| @Override | ||
| public Double getFoldChange() { | ||
| return foldChange; | ||
| } | ||
|
|
||
| @Override | ||
| public void setFoldChange(Double foldChange) { | ||
| this.foldChange = foldChange; | ||
| } | ||
|
|
||
| @Override | ||
| public Double getPVal() { | ||
| return pVal; | ||
| } | ||
|
|
||
| @Override | ||
| public void setPVal(Double pVal) { | ||
| this.pVal = pVal; | ||
| } | ||
|
|
||
| @Override | ||
| public Double getStdDev() { | ||
| return stdDev; | ||
| } | ||
|
|
||
| @Override | ||
| public void setStdDev(Double stdDev) { | ||
| this.stdDev = stdDev; | ||
| } | ||
|
|
||
| @Override | ||
| public Double getPValLog10() { | ||
| return pValLog10; | ||
| } | ||
|
|
||
| @Override | ||
| public void setPValLog10(Double pValLog10) { | ||
| this.pValLog10 = pValLog10; | ||
| } | ||
|
|
||
| @Override | ||
| public String getEnrollmentCategory() { | ||
| return enrollmentCategory; | ||
| } | ||
|
|
||
| @Override | ||
| public void setEnrollmentCategory(String enrollmentCategory) { | ||
| this.enrollmentCategory = enrollmentCategory; | ||
| } | ||
|
|
||
| @Override | ||
| public Integer getSampleCount() { | ||
| return sampleCount; | ||
| } | ||
|
|
||
| @Override | ||
| public void setSampleCount(Integer sampleCount) { | ||
| this.sampleCount = sampleCount; | ||
| } | ||
|
|
||
| @Override | ||
| public String getSegmentName() { | ||
| return segmentName; | ||
| } | ||
|
|
||
| @Override | ||
| public void setSegmentName(String segmentName) { | ||
| this.segmentName = segmentName; | ||
| } | ||
|
|
||
| @Override | ||
| public Double getAdjPVal() { | ||
| return adjPVal; | ||
| } | ||
|
|
||
| @Override | ||
| public void setAdjPVal(Double adjPVal) { | ||
| this.adjPVal = adjPVal; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/main/java/org/kpmp/geneExpression/RTExpressionDataId.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| package org.kpmp.geneExpression; | ||
|
|
||
| import java.io.Serializable; | ||
| import java.util.Objects; | ||
|
|
||
| public class RTExpressionDataId implements Serializable { | ||
|
|
||
| private Integer id; | ||
| private String geneSymbol; | ||
| private Double pVal; | ||
|
|
||
| public RTExpressionDataId() {} | ||
|
|
||
| public RTExpressionDataId(Integer id, String geneSymbol, Double pVal) { | ||
| this.id = id; | ||
| this.geneSymbol = geneSymbol; | ||
| this.pVal = pVal; | ||
| } | ||
|
|
||
| public Integer getId() { return id; } | ||
| public void setId(Integer id) { this.id = id; } | ||
| public String getGeneSymbol() { return geneSymbol; } | ||
| public void setGeneSymbol(String geneSymbol) { this.geneSymbol = geneSymbol; } | ||
| public Double getPVal() { return pVal; } | ||
| public void setPVal(Double pVal) { this.pVal = pVal; } | ||
|
|
||
| @Override | ||
| public boolean equals(Object o) { | ||
| if (this == o) return true; | ||
| if (o == null || getClass() != o.getClass()) return false; | ||
| RTExpressionDataId that = (RTExpressionDataId) o; | ||
| return Objects.equals(id, that.id) && Objects.equals(geneSymbol, that.geneSymbol) && Objects.equals(pVal, that.pVal); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash(id, geneSymbol, pVal); | ||
| } | ||
| } |
46 changes: 46 additions & 0 deletions
46
src/test/java/org/kpmp/geneExpression/RTExpressionDataIdTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| package org.kpmp.geneExpression; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.assertEquals; | ||
| import static org.junit.jupiter.api.Assertions.assertNotEquals; | ||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| class RTExpressionDataIdTest { | ||
|
|
||
| @Test | ||
| void testGettersAndSetters() { | ||
| RTExpressionDataId idData = new RTExpressionDataId(); | ||
|
|
||
| idData.setId(101); | ||
| idData.setGeneSymbol("SOD1"); | ||
| idData.setPVal(0.05); | ||
|
|
||
| assertEquals(101, idData.getId()); | ||
| assertEquals("SOD1", idData.getGeneSymbol()); | ||
| assertEquals(0.05, idData.getPVal()); | ||
| } | ||
|
|
||
| @Test | ||
| void testConstructor() { | ||
| RTExpressionDataId idData = new RTExpressionDataId(202, "GAPDH", 0.001); | ||
|
|
||
| assertEquals(202, idData.getId()); | ||
| assertEquals("GAPDH", idData.getGeneSymbol()); | ||
| assertEquals(0.001, idData.getPVal()); | ||
| } | ||
|
|
||
| @Test | ||
| void testEqualsAndHashCode() { | ||
| RTExpressionDataId id1 = new RTExpressionDataId(1, "ALB", 0.01); | ||
| RTExpressionDataId id2 = new RTExpressionDataId(1, "ALB", 0.01); | ||
| RTExpressionDataId id3 = new RTExpressionDataId(2, "ALB", 0.01); | ||
| RTExpressionDataId id4 = new RTExpressionDataId(1, "INS", 0.01); | ||
|
|
||
| assertEquals(id1, id2); | ||
| assertNotEquals(id1, id3); | ||
| assertNotEquals(id1, id4); | ||
| assertNotEquals(null, id1); | ||
|
|
||
| assertEquals(id1.hashCode(), id2.hashCode()); | ||
| assertNotEquals(id1.hashCode(), id3.hashCode()); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.