<commit_before>package org.cruk.mga.export;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import org.cruk.mga.MGAConfig;
import org.cruk.util.OrderedProperties;


@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = { "runId", "properties", "trimStart", "trimLength", "summaries", "referenceGenomes" })
@XmlRootElement(name = "MultiGenomeAlignmentSummaries")
public class AllMGASummaries implements Serializable
{
    private static final long serialVersionUID = -3897311196228179946L;

    @XmlElement(name = "RunId", required = true)
    private String runId;

    @XmlElement(name = "Properties")
    private Properties properties;

    @XmlElement(name = "TrimStart")
    private Integer trimStart;

    @XmlElement(name = "TrimLength")
    private Integer trimLength;

    @XmlElement(name = "MultiGenomeAlignmentSummary")
    private List<MGASummary> summaries;

    @XmlElementWrapper(name = "ReferenceGenomes")
    @XmlElement(name = "ReferenceGenome")
    private List<ReferenceGenome> referenceGenomes;

    public AllMGASummaries()
    {
    }

    public AllMGASummaries(MGAConfig config)
    {
        runId = config.getRunId();
        trimStart = config.getTrimStart() == null ? null : config.getTrimStart().intValue();
        trimLength = config.getTrimLength() == null ? null : config.getTrimLength().intValue();
    }

    public AllMGASummaries(MGAConfig config, OrderedProperties runProperties)
    {
        this(config);

        properties = new Properties(runProperties);
    }

    public String getRunId()
    {
        return runId;
    }

    public void setRunId(String runId)
    {
        this.runId = runId;
    }

    public Integer getTrimStart()
    {
        return trimStart;
    }

    public void setTrimStart(Integer trimStart)
    {
        this.trimStart = trimStart;
    }

    public Integer getTrimLength()
    {
        return trimLength;
    }

    public void setTrimLength(Integer trimLength)
    {
        this.trimLength = trimLength;
    }

    public Properties getProperties()
    {
        return properties;
    }

    public void setProperties(OrderedProperties runProperties)
    {
        properties = null;
        if (runProperties != null)
        {
            properties = new Properties(runProperties);
        }
    }

    public List<MGASummary> getMultiGenomeAlignmentSummaries()
    {
        if (summaries == null)
        {
            summaries = new ArrayList<>();
        }
        return summaries;<commit_msg>Fix issue with trim start and length being written to the XML file as floating point numbers when they should be integers.<commit_after>package org.cruk.mga.export;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import org.cruk.mga.MGAConfig;
import org.cruk.util.OrderedProperties;


@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = { "runId", "properties", "trimStart", "trimLength", "summaries", "referenceGenomes" })
@XmlRootElement(name = "MultiGenomeAlignmentSummaries")
public class AllMGASummaries implements Serializable
{
    private static final long serialVersionUID = -3897311196228179946L;

    @XmlElement(name = "RunId", required = true)
    private String runId;

    @XmlElement(name = "Properties")
    private Properties properties;

    @XmlElement(name = "TrimStart")
    private int trimStart;

    @XmlElement(name = "TrimLength")
    private int trimLength;

    @XmlElement(name = "MultiGenomeAlignmentSummary")
    private List<MGASummary> summaries;

    @XmlElementWrapper(name = "ReferenceGenomes")
    @XmlElement(name = "ReferenceGenome")
    private List<ReferenceGenome> referenceGenomes;

    public AllMGASummaries()
    {
    }

    public AllMGASummaries(MGAConfig config)
    {
        runId = config.getRunId();
        trimStart = config.getTrimStart() == null ? 0 : config.getTrimStart().intValue();
        trimLength = config.getTrimLength() == null ? 0 : config.getTrimLength().intValue();
    }

    public AllMGASummaries(MGAConfig config, OrderedProperties runProperties)
    {
        this(config);

        properties = new Properties(runProperties);
    }

    public String getRunId()
    {
        return runId;
    }

    public void setRunId(String runId)
    {
        this.runId = runId;
    }

    public int getTrimStart()
    {
        return trimStart;
    }

    public void setTrimStart(int trimStart)
    {
        this.trimStart = trimStart;
    }

    public int getTrimLength()
    {
        return trimLength;
    }

    public void setTrimLength(int trimLength)
    {
        this.trimLength = trimLength;
    }

    public Properties getProperties()
    {
        return properties;
    }

    public void setProperties(OrderedProperties runProperties)
    {
        properties = null;
        if (runProperties != null)
        {
            properties = new Properties(runProperties);
        }
    }

    public List<MGASummary> getMultiGenomeAlignmentSummaries()
    {
        if (summaries == null)
        {
            summaries = new ArrayList<>();
        }
        return summaries;
{'fraction_non_alphanumeric': 0.09651427570502714, 'fraction_numerical': 0.007006480994920301, 'mean_word_length': 3.1346850108616944, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, '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': '4149540', 'n_tokens_mistral': 1727, 'n_tokens_neox': 1628, 'n_words': 352}