-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
113 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module LinkAdaptors | ||
class FusionVariant < Variant | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
class DiseasesWithoutEids < Report | ||
attr_reader :diseases_without_associations | ||
|
||
def self.name | ||
"Diseases Without Assertions or EIDs" | ||
end | ||
|
||
def self.description | ||
"Generate a report of diseases that have no assertions or evidence items associated with them." | ||
end | ||
|
||
def setup | ||
@diseases_without_associations = Disease | ||
.left_joins(:assertions, :evidence_items) | ||
.group('diseases.id') | ||
.having('COUNT(assertions.id) = 0 AND COUNT(evidence_items.id) = 0') | ||
.where(deprecated: false) | ||
.distinct | ||
end | ||
|
||
def headers | ||
['ID', 'DOID', 'Name'] | ||
end | ||
|
||
def execute | ||
diseases_without_associations.each do |disease| | ||
data << [disease.id, disease.doid, disease.name] | ||
end | ||
end | ||
end |
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,37 @@ | ||
class DuplicateDiseaseNames < Report | ||
attr_reader :duplicate_name_groups | ||
|
||
def self.name | ||
"Duplicate Disease Names" | ||
end | ||
|
||
def self.description | ||
"Generate a report of diseases with duplicate names." | ||
end | ||
|
||
def setup | ||
@duplicate_name_groups = Disease | ||
.select('name, COUNT(*) as disease_count') | ||
.where.not(name: nil) | ||
.where(deprecated: false) | ||
.group(:name) | ||
.having('COUNT(*) > 1') | ||
.each_with_object({}) do |disease_group, hash| | ||
hash[disease_group.name] = Disease.where(name: disease_group.name, deprecated: false) | ||
end | ||
end | ||
|
||
def headers | ||
['ID', 'DOID', 'Name', 'Assertion Count', 'EID Count'] | ||
end | ||
|
||
def execute | ||
duplicate_name_groups.each do |name, diseases| | ||
diseases.each do |disease| | ||
num_assertions = disease.assertions.count | ||
num_evidence_items = disease.evidence_items.count | ||
data << [disease.id, disease.doid, disease.name, num_assertions, num_evidence_items] | ||
end | ||
end | ||
end | ||
end |
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,37 @@ | ||
class DuplicateDoids < Report | ||
attr_reader :duplicate_doid_groups | ||
|
||
def self.name | ||
"Duplicate DOIDs" | ||
end | ||
|
||
def self.description | ||
"Generate a report of diseases with duplicate DOIDs." | ||
end | ||
|
||
def setup | ||
@duplicate_doid_groups = Disease | ||
.select('doid, COUNT(*) as disease_count') | ||
.where.not(doid: nil) | ||
.where(deprecated: false) | ||
.group(:doid) | ||
.having('COUNT(*) > 1') | ||
.each_with_object({}) do |disease_group, hash| | ||
hash[disease_group.doid] = Disease.where(doid: disease_group.doid, deprecated: false) | ||
end | ||
end | ||
|
||
def headers | ||
['ID', 'DOID', 'Name', 'Assertion Count', 'EID Count'] | ||
end | ||
|
||
def execute | ||
duplicate_doid_groups.each do |doid, diseases| | ||
diseases.each do |disease| | ||
num_assertions = disease.assertions.count | ||
num_evidence_items = disease.evidence_items.count | ||
data << [disease.id, disease.doid, disease.name, num_assertions, num_evidence_items] | ||
end | ||
end | ||
end | ||
end |
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