Class PhenotypeAssociationDaoImpl
- java.lang.Object
-
- ubic.gemma.persistence.service.AbstractDao<PhenotypeAssociation>
-
- ubic.gemma.persistence.service.association.phenotype.PhenotypeAssociationDaoImpl
-
- All Implemented Interfaces:
PhenotypeAssociationDao
,BaseDao<PhenotypeAssociation>
@Repository public class PhenotypeAssociationDaoImpl extends AbstractDao<PhenotypeAssociation> implements PhenotypeAssociationDao
deals with all basic queries used by Neurocarta- Author:
- Nicolas
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_PA_LIMIT
-
Fields inherited from class ubic.gemma.persistence.service.AbstractDao
elementClass
-
-
Constructor Summary
Constructors Constructor Description PhenotypeAssociationDaoImpl(SessionFactory sessionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Long
countEvidenceWithGeneDifferentialExpressionMetaAnalysis(Long geneDifferentialExpressionMetaAnalysisId)
counts the evidence that from neurocarta that came from a specific MetaAnalysisPhenotypeAssociation
find(PhenotypeAssociation entity)
Does a look up for the given entity in the persistent storage, usually looking for a specific identifier ( either id or a string property).Collection<CharacteristicValueObject>
findEvidenceCategoryTerms()
find category terms currently used in the database by evidenceCollection<String>
findEvidenceOwners()
return the list of the owners that have evidence in the systemCollection<PhenotypeAssociation>
findEvidencesWithExternalDatabaseName(String externalDatabaseName, int limit, int start)
loads all evidences from a specific external databaseCollection<PhenotypeAssociation>
findEvidencesWithoutExternalDatabaseName()
find all evidence that doesn't come from an external courseCollection<ExternalDatabase>
findExternalDatabasesWithEvidence()
Gets all External Databases that are used with evidenceMap<GeneValueObject,OntologyTerm>
findGenesForPhenotype(OntologyTerm term, Long taxon, boolean includeIEA)
Collection<GeneEvidenceValueObject>
findGenesWithPhenotypes(Set<String> phenotypeUris, Taxon taxon, boolean showOnlyEditable, Collection<Long> externalDatabaseIds)
Key method: find Genes link to a phenotype taking into account private and public evidence Here on the cases : 1- Admin - can see anything 2- user not logged in - only public data 3- user logged in only showing what he has read access - public, shared + owned 4- user logged in only showing what he has write access - owned.Collection<PhenotypeAssociation>
findPhenotypeAssociationForGeneId(Long geneId)
find all PhenotypeAssociation for a specific gene idCollection<PhenotypeAssociation>
findPhenotypeAssociationForGeneIdAndDatabases(Long geneId, Collection<Long> externalDatabaseIds)
find all PhenotypeAssociation for a specific gene id and external Databases idsCollection<PhenotypeAssociation>
findPhenotypeAssociationForGeneNCBI(Integer geneNCBI)
find all PhenotypeAssociation for a specific NCBI idCollection<PhenotypeAssociation>
findPhenotypeAssociationForGeneNCBI(Integer geneNCBI, Set<String> phenotype)
find all PhenotypeAssociation for a specific NCBI id and phenotypes valueUriCollection<PhenotypeAssociation>
findPhenotypeAssociationWithIds(Collection<Long> paIds)
find PhenotypeAssociation satisfying the given filters: paIds, taxonId and limitCollection<PhenotypeAssociation>
findPhenotypesForBibliographicReference(String pubMedID)
find PhenotypeAssociations associated with a BibliographicReferenceSet<Long>
findPrivateEvidenceId(Long taxonId, int limit)
Map<String,Set<Integer>>
findPrivatePhenotypesGenesAssociations(Taxon taxon, Set<String> valuesUri, boolean showOnlyEditable, Collection<Long> externalDatabaseIds, boolean noElectronicAnnotation)
find all private phenotypes associated with genes on a specific taxon and containing the valuesUriMap<String,Set<Integer>>
findPublicPhenotypesGenesAssociations(Taxon taxon, Set<String> valuesUri, boolean showOnlyEditable, Collection<Long> externalDatabaseIds, boolean noElectronicAnnotation)
find all public phenotypes associated with genes on a specific taxon and containing the valuesUriPhenotypeAssociation
load(Long id)
Loads the entity with given id from the persistent storage.Collection<PhenotypeValueObject>
loadAllNeurocartaPhenotypes()
find all phenotypes in Neurocarta, this was requested by AspireBDSet<String>
loadAllPhenotypesUri()
load all valueURI of Phenotype in the databaseCollection<DifferentialExpressionEvidence>
loadEvidenceWithGeneDifferentialExpressionMetaAnalysis(Long geneDifferentialExpressionMetaAnalysisId, int maxResults)
ExternalDatabaseStatisticsValueObject
loadStatisticsOnAllEvidence(String downloadFile)
Collection<ExternalDatabaseStatisticsValueObject>
loadStatisticsOnExternalDatabases(String downloadPath)
ExternalDatabaseStatisticsValueObject
loadStatisticsOnManualCuration(String downloadFile)
void
remove(PhenotypeAssociation entity)
Remove a persistent instanceint
removeAll()
void
removePhenotypePublication(PhenotypeAssociationPublication phenotypeAssociationPublication)
remove a PhenotypeAssociationPublication-
Methods inherited from class ubic.gemma.persistence.service.AbstractDao
countAll, create, create, findByProperty, findByPropertyIn, findOneByProperty, findOrCreate, getBatchSize, getElementClass, getIdentifierPropertyName, getSessionFactory, load, loadAll, loadReference, loadReference, remove, remove, save, save, update, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ubic.gemma.persistence.service.BaseDao
countAll, create, create, findOrCreate, getElementClass, getIdentifierPropertyName, load, loadAll, loadReference, loadReference, remove, remove, save, save, update, update
-
-
-
-
Field Detail
-
DEFAULT_PA_LIMIT
public static final int DEFAULT_PA_LIMIT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PhenotypeAssociationDaoImpl
@Autowired public PhenotypeAssociationDaoImpl(SessionFactory sessionFactory)
-
-
Method Detail
-
load
public PhenotypeAssociation load(Long id)
Description copied from interface:BaseDao
Loads the entity with given id from the persistent storage.- Specified by:
load
in interfaceBaseDao<PhenotypeAssociation>
- Overrides:
load
in classAbstractDao<PhenotypeAssociation>
- Parameters:
id
- the id of entity to load.- Returns:
- the entity with given ID, or null if such entity does not exist or if the passed ID was null
- See Also:
Session.get(Class, Serializable)
-
find
public PhenotypeAssociation find(PhenotypeAssociation entity)
Description copied from interface:BaseDao
Does a look up for the given entity in the persistent storage, usually looking for a specific identifier ( either id or a string property).- Specified by:
find
in interfaceBaseDao<PhenotypeAssociation>
- Overrides:
find
in classAbstractDao<PhenotypeAssociation>
- Parameters:
entity
- the entity to look for.- Returns:
- an entity that was found in the persistent storage, or null if no such entity was found.
-
countEvidenceWithGeneDifferentialExpressionMetaAnalysis
public Long countEvidenceWithGeneDifferentialExpressionMetaAnalysis(Long geneDifferentialExpressionMetaAnalysisId)
counts the evidence that from neurocarta that came from a specific MetaAnalysis- Specified by:
countEvidenceWithGeneDifferentialExpressionMetaAnalysis
in interfacePhenotypeAssociationDao
- Parameters:
geneDifferentialExpressionMetaAnalysisId
- id- Returns:
- count of the evidence that from neurocarta that came from a specific MetaAnalysis
-
findEvidenceCategoryTerms
public Collection<CharacteristicValueObject> findEvidenceCategoryTerms()
find category terms currently used in the database by evidence- Specified by:
findEvidenceCategoryTerms
in interfacePhenotypeAssociationDao
- Returns:
- category terms currently used in the database by evidence
-
findEvidenceOwners
public Collection<String> findEvidenceOwners()
return the list of the owners that have evidence in the system- Specified by:
findEvidenceOwners
in interfacePhenotypeAssociationDao
- Returns:
- the list of the owners that have evidence in the system
-
findEvidencesWithExternalDatabaseName
public Collection<PhenotypeAssociation> findEvidencesWithExternalDatabaseName(String externalDatabaseName, int limit, int start)
loads all evidences from a specific external database- Specified by:
findEvidencesWithExternalDatabaseName
in interfacePhenotypeAssociationDao
- Parameters:
externalDatabaseName
- external database namelimit
- limitstart
- start- Returns:
- all evidences from a specific external database
-
findEvidencesWithoutExternalDatabaseName
public Collection<PhenotypeAssociation> findEvidencesWithoutExternalDatabaseName()
find all evidence that doesn't come from an external course- Specified by:
findEvidencesWithoutExternalDatabaseName
in interfacePhenotypeAssociationDao
- Returns:
- all evidence that doesn't come from an external course
-
findExternalDatabasesWithEvidence
public Collection<ExternalDatabase> findExternalDatabasesWithEvidence()
Gets all External Databases that are used with evidence- Specified by:
findExternalDatabasesWithEvidence
in interfacePhenotypeAssociationDao
- Returns:
- all External Databases that are used with evidence
-
findGenesForPhenotype
public Map<GeneValueObject,OntologyTerm> findGenesForPhenotype(OntologyTerm term, Long taxon, boolean includeIEA)
- Specified by:
findGenesForPhenotype
in interfacePhenotypeAssociationDao
- Parameters:
term
- termtaxon
- taxonincludeIEA
- if false, electronic annotations will be omitted- Returns:
- map of gene value objects to the exact phenotype the gene was annotated to. (gives no indication of 'bag of terms')
-
findGenesWithPhenotypes
public Collection<GeneEvidenceValueObject> findGenesWithPhenotypes(Set<String> phenotypeUris, @Nullable Taxon taxon, boolean showOnlyEditable, @Nullable Collection<Long> externalDatabaseIds)
Key method: find Genes link to a phenotype taking into account private and public evidence Here on the cases :- 1- Admin - can see anything
- 2- user not logged in - only public data
- 3- user logged in only showing what he has read access - public, shared + owned
- 4- user logged in only showing what he has write access - owned.
- Specified by:
findGenesWithPhenotypes
in interfacePhenotypeAssociationDao
- Parameters:
phenotypeUris
- phenotype value uritaxon
- taxonshowOnlyEditable
- show only editableexternalDatabaseIds
- external db ids- Returns:
- Genes link to a phenotype
-
findPhenotypeAssociationForGeneId
public Collection<PhenotypeAssociation> findPhenotypeAssociationForGeneId(Long geneId)
find all PhenotypeAssociation for a specific gene id- Specified by:
findPhenotypeAssociationForGeneId
in interfacePhenotypeAssociationDao
- Parameters:
geneId
- gene id- Returns:
- all PhenotypeAssociation for a specific gene id
-
findPhenotypeAssociationForGeneIdAndDatabases
public Collection<PhenotypeAssociation> findPhenotypeAssociationForGeneIdAndDatabases(Long geneId, @Nullable Collection<Long> externalDatabaseIds)
find all PhenotypeAssociation for a specific gene id and external Databases ids- Specified by:
findPhenotypeAssociationForGeneIdAndDatabases
in interfacePhenotypeAssociationDao
- Parameters:
geneId
- gene idexternalDatabaseIds
- external db ids- Returns:
- all PhenotypeAssociation for a specific gene id and external Databases ids
-
findPhenotypeAssociationForGeneNCBI
public Collection<PhenotypeAssociation> findPhenotypeAssociationForGeneNCBI(Integer geneNCBI)
find all PhenotypeAssociation for a specific NCBI id- Specified by:
findPhenotypeAssociationForGeneNCBI
in interfacePhenotypeAssociationDao
- Parameters:
geneNCBI
- gene ncbi id- Returns:
- all PhenotypeAssociation for a specific NCBI id
-
findPhenotypeAssociationForGeneNCBI
public Collection<PhenotypeAssociation> findPhenotypeAssociationForGeneNCBI(Integer geneNCBI, Set<String> phenotype)
find all PhenotypeAssociation for a specific NCBI id and phenotypes valueUri- Specified by:
findPhenotypeAssociationForGeneNCBI
in interfacePhenotypeAssociationDao
- Parameters:
geneNCBI
- gene ncbi idphenotype
- phenotype- Returns:
- all PhenotypeAssociation for a specific NCBI id and phenotypes valueUri
-
findPhenotypeAssociationWithIds
public Collection<PhenotypeAssociation> findPhenotypeAssociationWithIds(Collection<Long> paIds)
find PhenotypeAssociation satisfying the given filters: paIds, taxonId and limit- Specified by:
findPhenotypeAssociationWithIds
in interfacePhenotypeAssociationDao
- Parameters:
paIds
- ids- Returns:
- PhenotypeAssociations satisfying the given filters: ids, taxonId and limit
-
findPhenotypesForBibliographicReference
public Collection<PhenotypeAssociation> findPhenotypesForBibliographicReference(String pubMedID)
find PhenotypeAssociations associated with a BibliographicReference- Specified by:
findPhenotypesForBibliographicReference
in interfacePhenotypeAssociationDao
- Parameters:
pubMedID
- pumbed id- Returns:
- PhenotypeAssociations associated with a BibliographicReference
-
findPrivateEvidenceId
public Set<Long> findPrivateEvidenceId(@Nullable Long taxonId, int limit)
- Specified by:
findPrivateEvidenceId
in interfacePhenotypeAssociationDao
- Parameters:
taxonId
- taxon idlimit
- limit- Returns:
- private evidence id that the user can modify or owns
-
findPrivatePhenotypesGenesAssociations
public Map<String,Set<Integer>> findPrivatePhenotypesGenesAssociations(@Nullable Taxon taxon, @Nullable Set<String> valuesUri, boolean showOnlyEditable, @Nullable Collection<Long> externalDatabaseIds, boolean noElectronicAnnotation)
find all private phenotypes associated with genes on a specific taxon and containing the valuesUri- Specified by:
findPrivatePhenotypesGenesAssociations
in interfacePhenotypeAssociationDao
- Parameters:
taxon
- taxonvaluesUri
- value urisshowOnlyEditable
- show only editableexternalDatabaseIds
- external db idsnoElectronicAnnotation
- no electronic annotation- Returns:
- ll private phenotypes associated with genes on a specific taxon and containing the valuesUri
-
findPublicPhenotypesGenesAssociations
public Map<String,Set<Integer>> findPublicPhenotypesGenesAssociations(@Nullable Taxon taxon, @Nullable Set<String> valuesUri, boolean showOnlyEditable, @Nullable Collection<Long> externalDatabaseIds, boolean noElectronicAnnotation)
find all public phenotypes associated with genes on a specific taxon and containing the valuesUri- Specified by:
findPublicPhenotypesGenesAssociations
in interfacePhenotypeAssociationDao
- Parameters:
taxon
- taxonvaluesUri
- values urishowOnlyEditable
- show only editableexternalDatabaseIds
- external database idsnoElectronicAnnotation
- no electronic annotation- Returns:
- all public phenotypes associated with genes on a specific taxon and containing the valuesUri
-
loadAllNeurocartaPhenotypes
public Collection<PhenotypeValueObject> loadAllNeurocartaPhenotypes()
find all phenotypes in Neurocarta, this was requested by AspireBD- Specified by:
loadAllNeurocartaPhenotypes
in interfacePhenotypeAssociationDao
- Returns:
- all phenotypes in Neurocarta
-
loadAllPhenotypesUri
public Set<String> loadAllPhenotypesUri()
load all valueURI of Phenotype in the database- Specified by:
loadAllPhenotypesUri
in interfacePhenotypeAssociationDao
- Returns:
- all valueURI of Phenotype in the database
-
loadEvidenceWithGeneDifferentialExpressionMetaAnalysis
public Collection<DifferentialExpressionEvidence> loadEvidenceWithGeneDifferentialExpressionMetaAnalysis(Long geneDifferentialExpressionMetaAnalysisId, int maxResults)
- Specified by:
loadEvidenceWithGeneDifferentialExpressionMetaAnalysis
in interfacePhenotypeAssociationDao
- Parameters:
geneDifferentialExpressionMetaAnalysisId
- idmaxResults
- max results- Returns:
- a Collection for a geneDifferentialExpressionMetaAnalysisId if one exists (can be used to find the threshold and phenotypes for a GeneDifferentialExpressionMetaAnalysis)
-
loadStatisticsOnAllEvidence
public ExternalDatabaseStatisticsValueObject loadStatisticsOnAllEvidence(String downloadFile)
- Specified by:
loadStatisticsOnAllEvidence
in interfacePhenotypeAssociationDao
- Parameters:
downloadFile
- path- Returns:
- statistics all evidences
-
loadStatisticsOnExternalDatabases
public Collection<ExternalDatabaseStatisticsValueObject> loadStatisticsOnExternalDatabases(String downloadPath)
- Specified by:
loadStatisticsOnExternalDatabases
in interfacePhenotypeAssociationDao
- Parameters:
downloadPath
- path- Returns:
- all external databases statistics used in neurocarta
-
loadStatisticsOnManualCuration
public ExternalDatabaseStatisticsValueObject loadStatisticsOnManualCuration(String downloadFile)
- Specified by:
loadStatisticsOnManualCuration
in interfacePhenotypeAssociationDao
- Parameters:
downloadFile
- file- Returns:
- find statistics for manual curation (numGene, numPhenotypes, etc.)
-
removePhenotypePublication
public void removePhenotypePublication(PhenotypeAssociationPublication phenotypeAssociationPublication)
Description copied from interface:PhenotypeAssociationDao
remove a PhenotypeAssociationPublication- Specified by:
removePhenotypePublication
in interfacePhenotypeAssociationDao
- Parameters:
phenotypeAssociationPublicationId
- remove a PhenotypeAssociationPublication
-
removeAll
public int removeAll()
- Specified by:
removeAll
in interfacePhenotypeAssociationDao
-
remove
public void remove(PhenotypeAssociation entity)
Description copied from interface:BaseDao
Remove a persistent instance- Specified by:
remove
in interfaceBaseDao<PhenotypeAssociation>
- Overrides:
remove
in classAbstractDao<PhenotypeAssociation>
- Parameters:
entity
- the entity to be removed
-
-