<commit_before># -*- coding: utf-8 -*-
from collections import namedtuple
from datetime import datetime

from alchy import ModelBase, make_declarative_base
from sqlalchemy import Column, types, ForeignKey, UniqueConstraint, orm

Exon = namedtuple('Exon', ['chrom', 'start', 'end', 'completeness'])

# base for declaring a mapping
BASE = make_declarative_base(Base=ModelBase)


class Transcript(BASE):

    """Set of non-overlapping exons.

    A :class:`Transcript` can *only* be related to a single gene.

    Args:
        id (str): unique transcript id (e.g. CCDS)
        gene_id (str): related gene
        chromosome (str): related contig id
        lenght (int): number of exon bases in transcript
    """

    __tablename__ = 'transcript'

    id = Column(types.String(32), primary_key=True)
    gene_id = Column(types.Integer, index=True, nullable=False, unique=True)
    gene_name = Column(types.String(32), index=True, unique=True)
    chromosome = Column(types.String(10))
    length = Column(types.Integer)

    stats = orm.relationship('TranscriptStat', backref='transcript')


class Sample(BASE):

    """Metadata for a single sample.

    Args:
        id (str): unique sample id
        group_id (str): unique group id
        source (str): path to coverage source Sambamba output/BAM file
        created_at (DateTime): date of addition to database
    """

    __tablename__ = 'sample'

    id = Column(types.String(32), primary_key=True)
    group_id = Column(types.String(32), index=True)<commit_msg>gene ids shouldn't be unique<commit_after># -*- coding: utf-8 -*-
from collections import namedtuple
from datetime import datetime

from alchy import ModelBase, make_declarative_base
from sqlalchemy import Column, types, ForeignKey, UniqueConstraint, orm

Exon = namedtuple('Exon', ['chrom', 'start', 'end', 'completeness'])

# base for declaring a mapping
BASE = make_declarative_base(Base=ModelBase)


class Transcript(BASE):

    """Set of non-overlapping exons.

    A :class:`Transcript` can *only* be related to a single gene.

    Args:
        id (str): unique transcript id (e.g. CCDS)
        gene_id (str): related gene
        chromosome (str): related contig id
        lenght (int): number of exon bases in transcript
    """

    __tablename__ = 'transcript'

    id = Column(types.String(32), primary_key=True)
    gene_id = Column(types.Integer, index=True, nullable=False)
    gene_name = Column(types.String(32), index=True)
    chromosome = Column(types.String(10))
    length = Column(types.Integer)

    stats = orm.relationship('TranscriptStat', backref='transcript')


class Sample(BASE):

    """Metadata for a single sample.

    Args:
        id (str): unique sample id
        group_id (str): unique group id
        source (str): path to coverage source Sambamba output/BAM file
        created_at (DateTime): date of addition to database
    """

    __tablename__ = 'sample'

    id = Column(types.String(32), primary_key=True)
    group_id = Column(types.String(32), index=True)
{'fraction_non_alphanumeric': 0.11118442758165623, 'fraction_numerical': 0.007258330583965688, 'mean_word_length': 3.6290076335877863, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4854853', 'n_tokens_mistral': 960, 'n_tokens_neox': 886, 'n_words': 283}