Package ubic.gemma.core.util.test
Class PersistentDummyObjectHelper
- java.lang.Object
-
- ubic.gemma.core.util.test.PersistentDummyObjectHelper
-
@Component @Transactional public class PersistentDummyObjectHelper extends Object
Used to generate test data.- Author:
- pavlidis
-
-
Constructor Summary
Constructors Constructor Description PersistentDummyObjectHelper()
-
Method Summary
-
-
-
Method Detail
-
resetSeed
public void resetSeed()
-
getTestNonPersistentBioSequence
public BioSequence getTestNonPersistentBioSequence(Taxon taxon)
-
getTestNonPersistentGeneProduct
public GeneProduct getTestNonPersistentGeneProduct(Gene gene)
-
getTestNonPersistentQuantitationType
public QuantitationType getTestNonPersistentQuantitationType()
Note that if you want a 'preferred' qt or other special properties you have to set it yourself.- Returns:
- QT
-
addTestAnalyses
public Collection<Analysis> addTestAnalyses(ExpressionExperiment ee)
-
getExperimentalDesign
public ExperimentalDesign getExperimentalDesign(Collection<FactorValue> allFactorValues)
- Parameters:
allFactorValues
- all factor values- Returns:
- Non-persistent ED
-
getExperimentalFactors
public Collection<ExperimentalFactor> getExperimentalFactors(ExperimentalDesign ed)
-
getFactorValues
public Collection<FactorValue> getFactorValues(ExperimentalFactor ef)
-
getTestElementCollectionSize
public int getTestElementCollectionSize()
-
setTestElementCollectionSize
public void setTestElementCollectionSize(int testElementCollectionSize)
Override the number of elements made in collections. By default this is quite small, so you can increase it. But please call 'reset' afterwards.- Parameters:
testElementCollectionSize
- new size
-
getTestExpressionExperimentWithAllDependencies
public ExpressionExperiment getTestExpressionExperimentWithAllDependencies()
Add an expressionExperiment to the database for testing purposes. Includes associations.- Returns:
- EE
-
getTestExpressionExperimentWithAllDependencies
public ExpressionExperiment getTestExpressionExperimentWithAllDependencies(ExpressionExperiment prototype)
-
getTestExpressionExperimentWithAllDependencies
public ExpressionExperiment getTestExpressionExperimentWithAllDependencies(boolean doSequence)
Add an expressionExperiment to the database for testing purposes. Includes associations- Parameters:
doSequence
- Should the array design get all the sequence information filled in? (true = slower)- Returns:
- EE
-
getTestExpressionExperimentWithAnalysisAndResults
public ExpressionExperiment getTestExpressionExperimentWithAnalysisAndResults()
Create a test EE with analysis results. The design is simple: two conditions: healthy and sick with 3 replicates Random statistics will be generated for all the probes defined in the providedArrayDesign
.
-
getTestPersistentGene
public Gene getTestPersistentGene()
- Returns:
- with default taxon
-
getTestPersistentArrayDesign
public ArrayDesign getTestPersistentArrayDesign(int numCompositeSequences, boolean randomNames, boolean doSequence)
Convenience method to provide an ArrayDesign that can be used to fill non-nullable associations in test objects. The ArrayDesign is provided with some CompositeSequence DesignElements if desired. If composite sequences are created, they are each associated with a single generated Reporter.- Parameters:
numCompositeSequences
- The number of CompositeSequences to populate the ArrayDesign with.randomNames
- If true, probe names will be random strings; otherwise they will be 0_probe_at....N_probe_atdoSequence
- If true, biosequences and biosequence2GeneProduct associations are filled in (slower).- Returns:
- ArrayDesign
-
getTestPersistentBasicExpressionExperiment
public ExpressionExperiment getTestPersistentBasicExpressionExperiment()
-
getTestPersistentBasicExpressionExperiment
public ExpressionExperiment getTestPersistentBasicExpressionExperiment(ArrayDesign arrayDesign)
- Parameters:
arrayDesign
- AD- Returns:
- A lighter-weight EE, with no data, and the ADs have no sequences.
-
getTestPersistentBibliographicReference
public BibliographicReference getTestPersistentBibliographicReference(String accession)
-
getTestPersistentBioAssay
public BioAssay getTestPersistentBioAssay(ArrayDesign ad)
-
getTestPersistentBioAssay
public BioAssay getTestPersistentBioAssay(ArrayDesign ad, BioMaterial bm)
Convenience method to provide a DatabaseEntry that can be used to fill non-nullable associations in test objects.- Parameters:
ad
- ADbm
- BM- Returns:
- BA
-
getTestPersistentBioMaterial
public BioMaterial getTestPersistentBioMaterial()
-
getTestPersistentBioMaterial
public BioMaterial getTestPersistentBioMaterial(Taxon tax)
-
getTestPersistentBioSequence
public BioSequence getTestPersistentBioSequence()
-
getTestPersistentBioSequence
public BioSequence getTestPersistentBioSequence(Taxon taxon)
-
getTestPersistentBioSequence2GeneProducts
public Set<BioSequence2GeneProduct> getTestPersistentBioSequence2GeneProducts(BioSequence bioSequence)
- Parameters:
bioSequence
- bio sequence- Returns:
- bio sequence to gene products
-
getTestPersistentBlatResult
public BlatResult getTestPersistentBlatResult(BioSequence querySequence, Taxon taxon)
-
getTestPersistentContact
public Contact getTestPersistentContact()
Convenience method to provide a Contact that can be used to fill non-nullable associations in test objects.- Returns:
- contact
-
getTestPersistentDatabaseEntry
public DatabaseEntry getTestPersistentDatabaseEntry(ExternalDatabase ed)
Convenience method to provide a DatabaseEntry that can be used to fill non-nullable associations in test objects. The accession is set to a random string- Parameters:
ed
- ED- Returns:
- db entry
-
getTestPersistentDatabaseEntry
public DatabaseEntry getTestPersistentDatabaseEntry(String accession, ExternalDatabase ed)
Convenience method to provide a DatabaseEntry that can be used to fill non-nullable associations in test objects. The accession and ExternalDatabase name are set to random strings.- Parameters:
ed
- EDaccession
- accession- Returns:
- db entry
-
getTestPersistentDatabaseEntry
public DatabaseEntry getTestPersistentDatabaseEntry(String accession, String databaseName)
- Parameters:
databaseName
- GEO or PubMed (others could be supported)accession
- accession- Returns:
- db entry
-
getTestPersistentExpressionExperiment
public ExpressionExperiment getTestPersistentExpressionExperiment()
Convenience method to provide an ExpressionExperiment that can be used to fill non-nullable associations in test objects. This implementation does NOT fill in associations of the created object.- Returns:
- EE
-
getTestPersistentExpressionExperiment
public ExpressionExperiment getTestPersistentExpressionExperiment(Taxon taxon)
Convenience method to provide an ExpressionExperiment that can be used to fill non-nullable associations in test objects. This implementation does NOT fill in associations of the created object except for the creation of persistent BioMaterials and BioAssays so that database taxon lookups for this experiment will work.- Parameters:
taxon
- the experiment will have this taxon- Returns:
- EE
-
getTestPersistentGeneProduct
public GeneProduct getTestPersistentGeneProduct(Gene gene)
-
getTestPersistentQuantitationType
public QuantitationType getTestPersistentQuantitationType()
Convenience method to provide a QuantitationType that can be used to fill non-nullable associations in test objects.- Returns:
- QT
-
getTestPersistentTaxon
public Taxon getTestPersistentTaxon()
-
resetTestElementCollectionSize
public void resetTestElementCollectionSize()
-
getFactorValues
protected Set<FactorValue> getFactorValues(ExperimentalFactor ef, Collection<FactorValue> allFactorValues)
-
getTestCharacteristic
protected Characteristic getTestCharacteristic(String name, String value)
-
-