<commit_before>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.mskcc.cbio.oncokb.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import javax.persistence.*;

/**
 * @author jiaojiao, <NAME>
 */

@NamedQueries({
    @NamedQuery(
        name = "findPortalAlterationCountByGene",
        query = "select pa.cancerStudy, count(distinct pa.sampleId) as sampleCount from PortalAlteration pa, Alteration a join a.portalAlterations ap where pa.id = ap.id and pa.gene=? group by pa.cancerStudy"
    ),
    @NamedQuery(
        name = "findPortalAlterationCount",
        query = "select cancerStudy, count(distinct sampleId) as sampleCount from PortalAlteration pa group by cancerStudy"
    ),
    @NamedQuery(
        name = "findMutationMapperData",
        query = "select distinct pa from PortalAlteration pa, Alteration a join a.portalAlterations ap where pa.id = ap.id and pa.gene=?"
    )
})

@Entity
@Table(name = "portal_alteration")
public class PortalAlteration {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @JsonIgnore
    private Integer id;

    @Column(name = "cancer_type", length = 300, nullable = false)
    private String cancerType;

    @Column(name = "cancer_study", length = 300, nullable = false)
    private String cancerStudy;

    @Column(name = "sample_id")
    private String sampleId;

    @ManyToOne(fetch = FetchType.EAGER)
    @Fetch(FetchMode.JOIN)
    private Gene gene;

    @Column(name = "protein_change")
    private String proteinChange;

    @Column(name = "protein_start")
    private Integer proteinStartPosition;

    @Column(name = "protein_end")
    private Integer proteinEndPosition;

    @Column(name = "alteration_type", length = 300)
    private String alterationType;

    public PortalAlteration() {
    }

    public PortalAlteration(String cancerType, String cancerStudy, String sampleId, Gene gene, String proteinChange, Integer proteinStartPosition, Integer proteinEndPosition, String alterationType) {
        this.cancerType = cancerType;
        this.cancerStudy = cancerStudy;<commit_msg>Change the portal alts mapping column name<commit_after>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.mskcc.cbio.oncokb.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import javax.persistence.*;

/**
 * @author jiaojiao, <NAME>
 */

@NamedQueries({
    @NamedQuery(
        name = "findPortalAlterationCountByGene",
        query = "select pa.cancerStudy, count(distinct pa.sampleId) as sampleCount from PortalAlteration pa, Alteration a join a.portalAlterations ap where pa.id = ap.id and pa.gene=? group by pa.cancerStudy"
    ),
    @NamedQuery(
        name = "findPortalAlterationCount",
        query = "select cancerStudy, count(distinct sampleId) as sampleCount from PortalAlteration pa group by cancerStudy"
    ),
    @NamedQuery(
        name = "findMutationMapperData",
        query = "select distinct pa from PortalAlteration pa, Alteration a join a.portalAlterations ap where pa.id = ap.id and pa.gene=?"
    )
})

@Entity
@Table(name = "portal_alteration")
public class PortalAlteration {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @JsonIgnore
    private Integer id;

    @Column(name = "cancer_type", length = 300, nullable = false)
    private String cancerType;

    @Column(name = "cancer_study", length = 300, nullable = false)
    private String cancerStudy;

    @Column(name = "sample_id")
    private String sampleId;

    @ManyToOne(fetch = FetchType.EAGER)
    @Fetch(FetchMode.JOIN)
    @JoinColumn(name = "entrez_gene_id")
    private Gene gene;

    @Column(name = "protein_change")
    private String proteinChange;

    @Column(name = "protein_start")
    private Integer proteinStartPosition;

    @Column(name = "protein_end")
    private Integer proteinEndPosition;

    @Column(name = "alteration_type", length = 300)
    private String alterationType;

    public PortalAlteration() {
    }

    public PortalAlteration(String cancerType, String cancerStudy, String sampleId, Gene gene, String proteinChange, Integer proteinStartPosition, Integer proteinEndPosition, String alterationType) {
        this.cancerType = cancerType;
        this.cancerStudy = cancerStudy;
{'fraction_non_alphanumeric': 0.09245845760545376, 'fraction_numerical': 0.0038346825734980826, 'mean_word_length': 3.8804573804573805, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1694632', 'n_tokens_mistral': 1437, 'n_tokens_neox': 1342, 'n_words': 387}