Skip to content

Commit

Permalink
Merge pull request #82 from KPMP/KPMP-4001_GetRepoCounts
Browse files Browse the repository at this point in the history
Kpmp 4001 get repo counts
  • Loading branch information
zwright authored Feb 22, 2023
2 parents e1dd8d2 + 95c1872 commit 16fa10b
Show file tree
Hide file tree
Showing 56 changed files with 1,950 additions and 526 deletions.
621 changes: 617 additions & 4 deletions .classpath

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ build
.settings
bin
.gradle
.DS_Store
20 changes: 9 additions & 11 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,27 @@
<projectDescription>
<name>pegasus-data</name>
<comment></comment>
<projects>
</projects>
<projects/>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
<arguments/>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
<arguments/>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<linkedResources/>
<filteredResources>
<filter>
<id>1</id>
<name></name>
<type>30</type>
<name/>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,11 @@ Repository for the Atlas Explorer Tool service layer
2. Update .env ENV_MYSQL_PASSWORD to the password for QA KE
3. Add your IP address to a new security group called sg-0597e054f11d2e31a (Developer to KE Mariadb)
4. Restart your knowledge-environment (don't worry that you have your own copy of mariadb, it'll be ignored)

If you have already followed these steps and are still having trouble connecting, check to see if your ip address has changed, you may need to update the security group rules

# Talking to GraphQL

1. Start up your atlas/knowledge-environment server
2. Open a tool like GraphQLPlayground and connect to "http://localhost:3030/graphql"
3. Write and execute your query
22 changes: 16 additions & 6 deletions src/main/java/org/kpmp/Query.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
import org.kpmp.cellType.CellTypeService;
import org.kpmp.cellTypeSummary.ClusterHierarchy;
import org.kpmp.cellTypeSummary.ClusterHierarchyService;
import org.kpmp.dataSummary.AtlasRepoSummaryResult;
import org.kpmp.dataSummary.DataSummaryService;
import org.kpmp.datasetSummary.DatasetSummary;
import org.kpmp.dataSummary.DataTypeSummary;
import org.kpmp.gene.GeneService;
import org.kpmp.gene.MyGeneInfoHit;
import org.kpmp.geneExpression.RTExpressionByTissueType;
Expand All @@ -20,9 +21,9 @@
import org.kpmp.geneExpressionSummary.GeneExpressionSummary;
import org.kpmp.geneExpressionSummary.GeneExpressionSummaryService;
import org.kpmp.participant.ParticipantDataTypeSummary;
import org.kpmp.participant.ParticipantTissueTypeSummary;
import org.kpmp.participant.ParticipantService;
import org.kpmp.participant.ParticipantSummaryDataset;
import org.kpmp.participant.ParticipantTissueTypeSummary;
import org.kpmp.umap.PlotData;
import org.kpmp.umap.UmapDataService;
import org.slf4j.Logger;
Expand Down Expand Up @@ -100,7 +101,7 @@ public PlotData getUmapPlotData(String dataType, String geneSymbol, String tissu
}
}

public List<DatasetSummary> getGeneDatasetInformation(String geneSymbol) throws Exception {
public List<DataTypeSummary> getGeneDatasetInformation(String geneSymbol) throws Exception {
try {
return geneExpressionSummaryService.getGeneDatasetInformation(geneSymbol);
} catch (Exception e) {
Expand All @@ -109,7 +110,7 @@ public List<DatasetSummary> getGeneDatasetInformation(String geneSymbol) throws
}
}

public List<DatasetSummary> getSummaryData() throws Exception {
public List<DataTypeSummary> getSummaryData() throws Exception {
try {
return dataSummaryService.getSummaryData();
} catch (Exception e) {
Expand Down Expand Up @@ -170,9 +171,18 @@ public ParticipantSummaryDataset participantClinicalDataset(String redcap_id) th
public List<ParticipantTissueTypeSummary> getTissueTypeSummaryData() throws Exception {
try {
return participantService.getTissueData();
}catch (Exception e) {
} catch (Exception e) {
logger.error(e.getMessage());
throw e;
}
}
}

public AtlasRepoSummaryResult getAtlasSummaryRows() throws Exception {
try {
return dataSummaryService.getAtlasRepoSummary();
} catch (Exception e) {
logger.error("Unable to get Atlas Summary data: ", e.getMessage());
throw e;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

public class AutocompleteResult implements Serializable {

private static final long serialVersionUID = 762733408490639258L;
private String value;
private String name;
private String id;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/kpmp/cellType/CellType.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
@Table(name = "cell_type")
public class CellType implements Serializable {

private static final long serialVersionUID = -7240769211757430938L;

@Id
@Column(name = "cell_type_id")
private int cellTypeId;
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/org/kpmp/cellType/CellTypeHierarchy.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

@Component
public class CellTypeHierarchy implements Serializable {


private static final long serialVersionUID = 4174487460309851924L;
private Map<String, CellTypeStructureRegion> cellTypeRegionMap = new HashMap<>();

public List<CellTypeStructureRegion> getCellTypeRegions() {
Expand All @@ -20,7 +21,7 @@ public List<CellTypeStructureRegion> getCellTypeRegions() {
}

public void addCellTypeStructureRegion(CellTypeStructureRegion region) {

if (cellTypeRegionMap.containsKey(region.getRegionName())) {
CellTypeStructureRegion existingRegion = cellTypeRegionMap.get(region.getRegionName());
List<CellTypeStructureSubregion> subregions = region.getCellTypeSubregions();
Expand All @@ -32,7 +33,4 @@ public void addCellTypeStructureRegion(CellTypeStructureRegion region) {
}
}



}

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

public class CellTypeStructureRegion implements Serializable {

private static final long serialVersionUID = 3141535632314917816L;
private String regionName;
private Map<String, CellTypeStructureSubregion> subregionMap = new HashMap<>();
private List<String> subregionOrderdList = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

public class CellTypeStructureSubregion implements Serializable {

private static final long serialVersionUID = 1366955014710403152L;
private String subregionName;
private List<CellType> cellTypes = new ArrayList<>();

Expand Down
51 changes: 27 additions & 24 deletions src/main/java/org/kpmp/cellType/CellTypeSynonym.java
Original file line number Diff line number Diff line change
@@ -1,45 +1,48 @@
package org.kpmp.cellType;

import javax.persistence.FetchType;
import javax.persistence.Id;
import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import java.io.Serializable;

@Entity
@Table(name = "celltype_synonym")
@IdClass(CellTypeSynonymId.class)
public class CellTypeSynonym implements Serializable {

@Id
@Column(name="cell_type_id")
private int cellTypeId;
private static final long serialVersionUID = -5650797130903696615L;

@Id
@Column(name = "cell_type_id")
private int cellTypeId;

@Id
@Column(name="cell_type_synonym")
private String cellTypeSynonym;
@Id
@Column(name = "cell_type_synonym")
private String cellTypeSynonym;

@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name="cell_type_id", nullable = false, insertable = false, updatable = false)
private CellType cellType;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "cell_type_id", nullable = false, insertable = false, updatable = false)
private CellType cellType;

public int getCellTypeId() {
return cellTypeId;
}
public int getCellTypeId() {
return cellTypeId;
}

public void setCellTypeId(int cellTypeId) {
this.cellTypeId = cellTypeId;
}
public void setCellTypeId(int cellTypeId) {
this.cellTypeId = cellTypeId;
}

public String getCellTypeSynonym() {
return cellTypeSynonym;
}
public String getCellTypeSynonym() {
return cellTypeSynonym;
}

public void setCellTypeSynonym(String cellTypeSynonym) {
this.cellTypeSynonym = cellTypeSynonym;
}
public void setCellTypeSynonym(String cellTypeSynonym) {
this.cellTypeSynonym = cellTypeSynonym;
}
}
56 changes: 29 additions & 27 deletions src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
package org.kpmp.cellTypeSummary;

import org.springframework.lang.Nullable;
import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;
import java.io.Serializable;

import org.springframework.lang.Nullable;

@Entity
@Table(name = "cluster_hierarchy_v")
@IdClass(ClusterHierarchyId.class)
public class ClusterHierarchy implements Serializable {

private static final long serialVersionUID = -7707637379989017634L;
@Id
@Column(name = "cell_type_id")
private int cellTypeId;
Expand All @@ -31,11 +33,11 @@ public class ClusterHierarchy implements Serializable {
@Column(name = "is_single_nuc")
private String isSingleNucCluster;
@Column(name = "is_rt")
private String isRegionalTranscriptomics;
private String isRegionalTranscriptomics;
@Column(name = "cell_type")
private String cellType;
@Column(name = "cell_type_order")
private Double cellTypeOrder;
private Double cellTypeOrder;

public int getCellTypeId() {
return cellTypeId;
Expand All @@ -45,7 +47,7 @@ public void setCellTypeId(int cellTypeId) {
this.cellTypeId = cellTypeId;
}

@Nullable
@Nullable
public int getClusterId() {
return clusterId;
}
Expand All @@ -62,7 +64,7 @@ public void setStructureRegion(String structureRegion) {
this.structureRegion = structureRegion;
}

@Nullable
@Nullable
public String getStructureSubregion() {
return structureSubregion;
}
Expand All @@ -71,7 +73,7 @@ public void setStructureSubregion(String structureSubregion) {
this.structureSubregion = structureSubregion;
}

@Nullable
@Nullable
public String getClusterName() {
return clusterName;
}
Expand All @@ -96,29 +98,29 @@ public void setIsSingleNucCluster(String isSingleNucCluster) {
this.isSingleNucCluster = isSingleNucCluster;
}

public String getIsRegionalTranscriptomics() {
return isRegionalTranscriptomics;
}
public String getIsRegionalTranscriptomics() {
return isRegionalTranscriptomics;
}

public void setIsRegionalTranscriptomics(String isRegionalTranscriptomics) {
this.isRegionalTranscriptomics = isRegionalTranscriptomics;
}
public void setIsRegionalTranscriptomics(String isRegionalTranscriptomics) {
this.isRegionalTranscriptomics = isRegionalTranscriptomics;
}

@Nullable
public Double getCellTypeOrder() {
return cellTypeOrder;
}
@Nullable
public Double getCellTypeOrder() {
return cellTypeOrder;
}

public void setCellTypeOrder(Double cellTypeOrder) {
this.cellTypeOrder = cellTypeOrder;
}
public void setCellTypeOrder(Double cellTypeOrder) {
this.cellTypeOrder = cellTypeOrder;
}

@Nullable
public String getCellType() {
return cellType;
}
@Nullable
public String getCellType() {
return cellType;
}

public void setCellType(String cellType) {
this.cellType = cellType;
}
public void setCellType(String cellType) {
this.cellType = cellType;
}
}
Loading

0 comments on commit 16fa10b

Please sign in to comment.