<commit_before>package uk.ac.ebi.atlas.experimentimport.expressiondataserializer;

import au.com.bytecode.opencsv.CSVReader;
import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.io.Output;
import org.apache.commons.lang.ArrayUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import uk.ac.ebi.atlas.commons.serializers.ImmutableSetSerializer;
import uk.ac.ebi.atlas.commons.serializers.OntologyTermSerializer;
import uk.ac.ebi.atlas.model.baseline.BaselineExpression;
import uk.ac.ebi.atlas.model.baseline.ExperimentalFactors;
import uk.ac.ebi.atlas.model.baseline.FactorGroup;
import uk.ac.ebi.atlas.model.baseline.QuartilesArrayBuilder;
import uk.ac.ebi.atlas.utils.CsvReaderFactory;

import javax.inject.Inject;
import javax.inject.Named;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.MessageFormat;
import java.text.NumberFormat;

/**
 * Created by <NAME>-<NAME> <<EMAIL>> on 01/04/15.
 */
@Named
public class RnaSeqBaselineExpressionSerializer implements ExpressionSerializer {

    private static final Logger LOGGER = Logger.getLogger(RnaSeqBaselineExpressionSerializer.class);

    // TODO Refactor constants here and in BaselineAnalyticsInputStream to something like ExperimentTsvFileFormat and maybe some parsing utilities (?)
    private static final int GENE_ID_COLUMN_INDEX = 0;
    private static final int GENE_NAME_COLUMN_INDEX = 0;
    private static final int FIRST_EXPRESSION_LEVEL_INDEX = 2;

    private String serializedFileTemplate;
    private String tsvFileTemplate;
    private CsvReaderFactory csvReaderFactory;

    @Inject
    public RnaSeqBaselineExpressionSerializer(@Value("#{configuration['experiment.serialized_expression.path.template']}") String serializedFileTemplate,<commit_msg>#91486574 Read baseline expression data from binary files instead of TSV files - Gene name column set to 1 (was 0)<commit_after>package uk.ac.ebi.atlas.experimentimport.expressiondataserializer;

import au.com.bytecode.opencsv.CSVReader;
import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.io.Output;
import org.apache.commons.lang.ArrayUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import uk.ac.ebi.atlas.commons.serializers.ImmutableSetSerializer;
import uk.ac.ebi.atlas.commons.serializers.OntologyTermSerializer;
import uk.ac.ebi.atlas.model.baseline.BaselineExpression;
import uk.ac.ebi.atlas.model.baseline.ExperimentalFactors;
import uk.ac.ebi.atlas.model.baseline.FactorGroup;
import uk.ac.ebi.atlas.model.baseline.QuartilesArrayBuilder;
import uk.ac.ebi.atlas.utils.CsvReaderFactory;

import javax.inject.Inject;
import javax.inject.Named;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.MessageFormat;
import java.text.NumberFormat;

/**
 * Created by <NAME> <<EMAIL>> on 01/04/15.
 */
@Named
public class RnaSeqBaselineExpressionSerializer implements ExpressionSerializer {

    private static final Logger LOGGER = Logger.getLogger(RnaSeqBaselineExpressionSerializer.class);

    // TODO Refactor constants here and in BaselineAnalyticsInputStream to something like ExperimentTsvFileFormat and maybe some parsing utilities (?)
    private static final int GENE_ID_COLUMN_INDEX = 0;
    private static final int GENE_NAME_COLUMN_INDEX = 1;
    private static final int FIRST_EXPRESSION_LEVEL_INDEX = 2;

    private String serializedFileTemplate;
    private String tsvFileTemplate;
    private CsvReaderFactory csvReaderFactory;

    @Inject
    public RnaSeqBaselineExpressionSerializer(@Value("#{configuration['experiment.serialized_expression.path.template']}") String serializedFileTemplate,
{'fraction_non_alphanumeric': 0.08727175080558539, 'fraction_numerical': 0.008055853920515575, 'mean_word_length': 5.936685288640596, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '6039572', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1093, 'n_words': 230}