Search in sources :

Example 6 with SupportDetails

use of ubic.gemma.model.analysis.expression.coexpression.SupportDetails in project Gemma by PavlidisLab.

the class CoexpressionDaoImpl method updateModifiedSupportDetails.

// Possible external use
@SuppressWarnings({ "unused", "WeakerAccess" })
public void updateModifiedSupportDetails(BioAssaySet experiment, Collection<SupportDetails> supportDetailsToDelete, Collection<SupportDetails> supportDetailsToUpdate) {
    int count;
    int BATCH_SIZE = 1024;
    Session sess = this.getSessionFactory().getCurrentSession();
    /*
         * no cascade, so we have to make sure these get updated.
         */
    count = 0;
    for (SupportDetails sd : supportDetailsToUpdate) {
        sess.update(sd);
        if (++count % 10000 == 0) {
            CoexpressionDaoImpl.log.info("Updated  " + count + " support details relevant to " + experiment + "...");
        }
        if (count % BATCH_SIZE == 0) {
            sess.flush();
            sess.clear();
        }
    }
    CoexpressionDaoImpl.log.info("Updated " + count + " support details relevant to " + experiment + "...");
    sess.flush();
    sess.clear();
    count = 0;
    for (SupportDetails sd : supportDetailsToDelete) {
        sess.delete(sd);
        if (++count % 10000 == 0) {
            CoexpressionDaoImpl.log.info("Removed support details for " + count + " links for " + experiment + "...");
        }
        if (count % BATCH_SIZE == 0) {
            sess.flush();
            sess.clear();
        }
    }
    // finish deletes of the sd (this is not really necessary here, but trying to be consistent)
    sess.flush();
    sess.clear();
}
Also used : SupportDetails(ubic.gemma.model.analysis.expression.coexpression.SupportDetails)

Aggregations

SupportDetails (ubic.gemma.model.analysis.expression.coexpression.SupportDetails)6 Gene2GeneCoexpression (ubic.gemma.model.association.coexpression.Gene2GeneCoexpression)5 Gene (ubic.gemma.model.genome.Gene)2 BigInteger (java.math.BigInteger)1 StopWatch (org.apache.commons.lang3.time.StopWatch)1 Transactional (org.springframework.transaction.annotation.Transactional)1 IdArrayValueObject (ubic.gemma.model.analysis.expression.coexpression.IdArrayValueObject)1 GeneCoexpressionNodeDegreeValueObject (ubic.gemma.model.association.coexpression.GeneCoexpressionNodeDegreeValueObject)1 NonPersistentNonOrderedCoexpLink (ubic.gemma.persistence.service.association.coexpression.NonPersistentNonOrderedCoexpLink)1