-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #177 from tcezard/EVA3475_release_count_v2
EVA-3475 - Release count endpoints v2
- Loading branch information
Showing
22 changed files
with
1,484 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
62 changes: 62 additions & 0 deletions
62
eva-release/src/main/java/uk/ac/ebi/eva/release/controllers/ReleaseStatsV2Controller.java
This file contains 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,62 @@ | ||
/* | ||
* Copyright 2020 EMBL - European Bioinformatics Institute | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package uk.ac.ebi.eva.release.controllers; | ||
|
||
import io.swagger.annotations.Api; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import uk.ac.ebi.eva.release.dto.ReleaseStatsPerAssemblyV2Dto; | ||
import uk.ac.ebi.eva.release.dto.ReleaseStatsPerSpeciesV2Dto; | ||
import uk.ac.ebi.eva.release.services.ReleaseStatsServiceV2; | ||
|
||
@RestController | ||
@RequestMapping(value = "/v2/stats", produces = "application/json") | ||
@Api(tags = {"RS Release Statistics"}) | ||
public class ReleaseStatsV2Controller { | ||
|
||
private final ReleaseStatsServiceV2 releaseStatsService; | ||
|
||
public ReleaseStatsV2Controller(ReleaseStatsServiceV2 releaseStatsService) { | ||
this.releaseStatsService = releaseStatsService; | ||
} | ||
|
||
@GetMapping("/per-species") | ||
public Iterable<ReleaseStatsPerSpeciesV2Dto> getReleaseStatsPerSpecies( | ||
@RequestParam(name = "releaseVersion", required = false) Integer releaseVersion, | ||
@RequestParam(name = "excludeUnmappedOnly", required = false) boolean excludeUnmappedOnly) { | ||
return releaseStatsService.getReleaseStatsPerSpecies(releaseVersion, excludeUnmappedOnly); | ||
} | ||
|
||
@GetMapping("/per-species/new") | ||
public Iterable<ReleaseStatsPerSpeciesV2Dto> getSpeciesWithNewRsIds( | ||
@RequestParam(name = "releaseVersion") Integer releaseVersion) { | ||
return releaseStatsService.getSpeciesWithNewRsIds(releaseVersion); | ||
} | ||
|
||
@GetMapping("/per-assembly") | ||
public Iterable<ReleaseStatsPerAssemblyV2Dto> getReleaseStatsPerAssemblies( | ||
@RequestParam(name = "releaseVersion", required = false) Integer releaseVersion) { | ||
return releaseStatsService.getReleaseStatsPerAssembly(releaseVersion); | ||
} | ||
|
||
@GetMapping("/per-assembly/new") | ||
public Iterable<ReleaseStatsPerAssemblyV2Dto> getAssembliesWithNewRsIds( | ||
@RequestParam(name = "releaseVersion") Integer releaseVersion) { | ||
return releaseStatsService.getReleaseStatsPerAssemblyWithNewRsIds(releaseVersion); | ||
} | ||
} |
91 changes: 91 additions & 0 deletions
91
eva-release/src/main/java/uk/ac/ebi/eva/release/dto/ReleaseStatsPerAssemblyV2Dto.java
This file contains 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,91 @@ | ||
/* | ||
* Copyright 2022 EMBL - European Bioinformatics Institute | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package uk.ac.ebi.eva.release.dto; | ||
|
||
import java.util.Objects; | ||
|
||
public class ReleaseStatsPerAssemblyV2Dto extends ReleaseStatsV2Dto { | ||
|
||
private String assemblyAccession; | ||
|
||
private int[] taxonomyIds; | ||
|
||
private String[] taxonomyLinks; | ||
|
||
public ReleaseStatsPerAssemblyV2Dto() { | ||
} | ||
|
||
public int[] getTaxonomyIds() { | ||
return taxonomyIds; | ||
} | ||
|
||
public void setTaxonomyIds(int[] taxonomyIds) { | ||
this.taxonomyIds = taxonomyIds; | ||
} | ||
|
||
public String getAssemblyAccession() { | ||
return assemblyAccession; | ||
} | ||
|
||
public void setAssemblyAccession(String assemblyAccession) { | ||
this.assemblyAccession = assemblyAccession; | ||
} | ||
|
||
public String[] getTaxonomyLinks() { | ||
return taxonomyLinks; | ||
} | ||
|
||
public void setTaxonomyLinks(String[] taxonomyLinks) { | ||
this.taxonomyLinks = taxonomyLinks; | ||
} | ||
|
||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
ReleaseStatsPerAssemblyV2Dto that = (ReleaseStatsPerAssemblyV2Dto) o; | ||
return releaseVersion == that.releaseVersion && | ||
Objects.equals(assemblyAccession, that.assemblyAccession); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(assemblyAccession, releaseVersion); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "ReleaseStatsPerAssemblyDto{" + | ||
"assemblyAccession='" + assemblyAccession + '\'' + | ||
", releaseVersion=" + releaseVersion + | ||
", taxonomyIds=" + taxonomyIds + | ||
", releaseFolder='" + releaseFolder + '\'' + | ||
", currentRs=" + getCurrentRs() + | ||
", multiMappedRs=" + getMultiMappedRs() + | ||
", mergedRs=" + getMergedRs() + | ||
", deprecatedRs=" + getDeprecatedRs() + | ||
", mergedDeprecatedRs=" + getMergedDeprecatedRs() + | ||
", newCurrentRs=" + getNewCurrentRs() + | ||
", newMultiMappedRs=" + getNewMultiMappedRs() + | ||
", newMergedRs=" + getNewMergedRs() + | ||
", newDeprecatedRs=" + getNewDeprecatedRs() + | ||
", newMergedDeprecatedRs=" + getNewMergedDeprecatedRs() + | ||
", releaseLink='" + releaseLink + '\'' + | ||
", taxonomyLinks='" + taxonomyLinks + '\'' + | ||
'}'; | ||
} | ||
} |
130 changes: 130 additions & 0 deletions
130
eva-release/src/main/java/uk/ac/ebi/eva/release/dto/ReleaseStatsPerSpeciesV2Dto.java
This file contains 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,130 @@ | ||
/* | ||
* Copyright 2020 EMBL - European Bioinformatics Institute | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package uk.ac.ebi.eva.release.dto; | ||
|
||
import java.util.Objects; | ||
|
||
public class ReleaseStatsPerSpeciesV2Dto extends ReleaseStatsV2Dto { | ||
|
||
private int taxonomyId; | ||
|
||
private String[] assemblyAccessions; | ||
|
||
private String taxonomyLink; | ||
|
||
private String scientificName; | ||
|
||
private String commonName; | ||
|
||
public ReleaseStatsPerSpeciesV2Dto() { | ||
} | ||
|
||
public int getTaxonomyId() { | ||
return taxonomyId; | ||
} | ||
|
||
public void setTaxonomyId(int taxonomyId) { | ||
this.taxonomyId = taxonomyId; | ||
} | ||
|
||
public String getScientificName() { | ||
return scientificName; | ||
} | ||
|
||
public void setScientificName(String scientificName) { | ||
this.scientificName = scientificName; | ||
} | ||
|
||
public String getCommonName() { | ||
return commonName; | ||
} | ||
|
||
public void setCommonName(String commonName) { | ||
this.commonName = commonName; | ||
} | ||
|
||
public String getTaxonomyLink() { | ||
return taxonomyLink; | ||
} | ||
|
||
public void setTaxonomyLink(String taxonomyLink) { | ||
this.taxonomyLink = taxonomyLink; | ||
} | ||
|
||
public String[] getAssemblyAccessions() { | ||
return assemblyAccessions; | ||
} | ||
|
||
public void setAssemblyAccessions(String[] assemblyAccessions) { | ||
this.assemblyAccessions = assemblyAccessions; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
ReleaseStatsPerSpeciesV2Dto that = (ReleaseStatsPerSpeciesV2Dto) o; | ||
return taxonomyId == that.taxonomyId && | ||
releaseVersion == that.releaseVersion && | ||
Objects.equals(scientificName, that.scientificName) && | ||
Objects.equals(releaseFolder, that.releaseFolder) && | ||
Objects.equals(currentRs, that.currentRs) && | ||
Objects.equals(multiMappedRs, that.multiMappedRs) && | ||
Objects.equals(mergedRs, that.mergedRs) && | ||
Objects.equals(deprecatedRs, that.deprecatedRs) && | ||
Objects.equals(mergedDeprecatedRs, that.mergedDeprecatedRs) && | ||
Objects.equals(unmappedRs, that.unmappedRs) && | ||
Objects.equals(newCurrentRs, that.newCurrentRs) && | ||
Objects.equals(newMultiMappedRs, that.newMultiMappedRs) && | ||
Objects.equals(newMergedRs, that.newMergedRs) && | ||
Objects.equals(newDeprecatedRs, that.newDeprecatedRs) && | ||
Objects.equals(newMergedDeprecatedRs, that.newMergedDeprecatedRs) && | ||
Objects.equals(newUnmappedRs, that.newUnmappedRs) && | ||
Objects.equals(releaseLink, that.releaseLink) && | ||
Objects.equals(taxonomyLink, that.taxonomyLink); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(taxonomyId, releaseVersion, scientificName, releaseFolder, currentRs, multiMappedRs, | ||
mergedRs, deprecatedRs, mergedDeprecatedRs, unmappedRs, newCurrentRs, newMultiMappedRs, newMergedRs, | ||
newDeprecatedRs, newMergedDeprecatedRs, newUnmappedRs, releaseLink, taxonomyLink); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "ReleaseStatsPerSpeciesDto{" + | ||
"taxonomyId=" + taxonomyId + | ||
", releaseVersion=" + releaseVersion + | ||
", scientificName='" + scientificName + '\'' + | ||
", releaseFolder='" + releaseFolder + '\'' + | ||
", currentRs=" + getCurrentRs() + | ||
", multiMappedRs=" + getMultiMappedRs() + | ||
", mergedRs=" + getMergedRs() + | ||
", deprecatedRs=" + getDeprecatedRs() + | ||
", mergedDeprecatedRs=" + getMergedDeprecatedRs() + | ||
", unmappedRs=" + getUnmappedRs() + | ||
", newCurrentRs=" + getNewCurrentRs() + | ||
", newMultiMappedRs=" + getNewMultiMappedRs() + | ||
", newMergedRs=" + getNewMergedRs() + | ||
", newDeprecatedRs=" + getNewDeprecatedRs() + | ||
", newMergedDeprecatedRs=" + getNewMergedDeprecatedRs() + | ||
", newUnmappedRs=" + getNewUnmappedRs() + | ||
", releaseLink='" + releaseLink + '\'' + | ||
", taxonomyLink='" + taxonomyLink + '\'' + | ||
'}'; | ||
} | ||
} |
Oops, something went wrong.