<commit_before>package ubic.gemma.loader.genome.gene;

import java.io.InputStream;
import java.util.Collection;
import java.util.zip.GZIPInputStream;

import ubic.gemma.apps.Blat;
import ubic.gemma.loader.expression.arrayDesign.ArrayDesignProbeMapperService;
import ubic.gemma.loader.expression.arrayDesign.ArrayDesignProbeMapperServiceIntegrationTest;
import ubic.gemma.loader.expression.arrayDesign.ArrayDesignSequenceAlignmentService;
import ubic.gemma.loader.expression.arrayDesign.ArrayDesignSequenceProcessingService;
import ubic.gemma.loader.expression.geo.GeoDomainObjectGenerator;
import ubic.gemma.loader.expression.geo.service.AbstractGeoService;
import ubic.gemma.model.expression.arrayDesign.ArrayDesign;
import ubic.gemma.model.expression.arrayDesign.ArrayDesignService;
import ubic.gemma.model.genome.Gene;
import ubic.gemma.model.genome.Taxon;
import ubic.gemma.model.genome.TaxonService;
import ubic.gemma.model.genome.biosequence.SequenceType;
import ubic.gemma.model.genome.gene.GeneService;
import ubic.gemma.model.genome.sequenceAnalysis.BlatResult;
import ubic.gemma.testing.BaseSpringContextTest;

public class GeneServiceIntegrationTest extends BaseSpringContextTest {
    ArrayDesignProbeMapperServiceIntegrationTest pTest = new ArrayDesignProbeMapperServiceIntegrationTest();

    String officialName = "PPARA";
    String accession = "GPL140";
    
    public void testGetCompositeSequenceCountById() throws Exception {

        // get geneService
        GeneService geneService = ( GeneService ) this.getBean( "geneService" );
        // get a gene to get the id
        Collection<Gene> geneCollection = geneService.findByOfficialSymbol( officialName );
        Gene g = geneCollection.iterator().next();
        long count = geneService.getCompositeSequenceCountById( g.getId() );
        assert ( count != 0 );
    }
    
    
    // preloads GPL140. See ArrayDesignProbeMapperServiceIntegrationTest
    protected void onSetUp() throws Exception {<commit_msg>added test<commit_after>package ubic.gemma.loader.genome.gene;

import java.io.InputStream;
import java.util.Collection;
import java.util.zip.GZIPInputStream;

import ubic.gemma.apps.Blat;
import ubic.gemma.loader.expression.arrayDesign.ArrayDesignProbeMapperService;
import ubic.gemma.loader.expression.arrayDesign.ArrayDesignProbeMapperServiceIntegrationTest;
import ubic.gemma.loader.expression.arrayDesign.ArrayDesignSequenceAlignmentService;
import ubic.gemma.loader.expression.arrayDesign.ArrayDesignSequenceProcessingService;
import ubic.gemma.loader.expression.geo.GeoDomainObjectGenerator;
import ubic.gemma.loader.expression.geo.service.AbstractGeoService;
import ubic.gemma.model.expression.arrayDesign.ArrayDesign;
import ubic.gemma.model.expression.arrayDesign.ArrayDesignService;
import ubic.gemma.model.expression.designElement.CompositeSequence;
import ubic.gemma.model.genome.Gene;
import ubic.gemma.model.genome.Taxon;
import ubic.gemma.model.genome.TaxonService;
import ubic.gemma.model.genome.biosequence.SequenceType;
import ubic.gemma.model.genome.gene.GeneService;
import ubic.gemma.model.genome.sequenceAnalysis.BlatResult;
import ubic.gemma.testing.BaseSpringContextTest;

public class GeneServiceIntegrationTest extends BaseSpringContextTest {
    ArrayDesignProbeMapperServiceIntegrationTest pTest = new ArrayDesignProbeMapperServiceIntegrationTest();

    String officialName = "PPARA";
    String accession = "GPL140";
    
    @SuppressWarnings("unchecked")
    public void testGetCompositeSequenceCountById() throws Exception {

        // get geneService
        GeneService geneService = ( GeneService ) this.getBean( "geneService" );
        // get a gene to get the id
        Collection<Gene> geneCollection = geneService.findByOfficialSymbol( officialName );
        Gene g = geneCollection.iterator().next();
        long count = geneService.getCompositeSequenceCountById( g.getId() );
        assert ( count != 0 );
    }
    
    @SuppressWarnings("unchecked")
    public void testGetCompositeSequencesById() throws Exception {

        // get geneService
        GeneService geneService = ( GeneService ) this.getBean( "geneService" );
        // get a gene to get the id
        Collection<Gene> geneCollection = geneService.findByOfficialSymbol( officialName );
        Gene g = geneCollection.iterator().next();
        Collection<CompositeSequence> compSequences = geneService.getCompositeSequencesById( g.getId() );
        assert ( compSequences.size() != 0 );
    }
    
    
    // preloads GPL140. See ArrayDesignProbeMapperServiceIntegrationTest
    @SuppressWarnings("unchecked")
    protected void onSetUp() throws Exception {
{'fraction_non_alphanumeric': 0.08886509635974305, 'fraction_numerical': 0.0032119914346895075, 'mean_word_length': 4.88287153652393, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1923068', 'n_tokens_mistral': 1309, 'n_tokens_neox': 1301, 'n_words': 233}