<commit_before>#!/usr/bin/env python

from array import array
from itertools import izip
from pydigree._pydigree import choice_with_probs


class Chromosome(object):
    """
    Chromsome is a class that keeps track of marker frequencies and distances.
    Not an actual chromosome with genotypes, which you would find under
    Individual.

    Markers are currently diallelic and frequencies are given for minor
    alleles. Marker frequencies must sum to 1. Major allele frequency
    is then f = 1 - f_minor.

    linkageequilibrium_chromosome generates chromsomes that are generated from
    simulating all markers with complete independence (linkage equilibrium).
    This is not typically what you want: you won't find any LD for association
    etc. linkageequilibrium_chromosome is used for 'seed' chromosomes when
    initializing a population pool or when simulating purely family-based
    studies for linkage analysis.
    """
    def __init__(self):
        # A list of floats that represent the position of the marker in cM
        self.genetic_map = []
        # A list of integers that doesnt do anything. Just for decoration
        self.physical_map = []
        # A list of floats representing minor allele frequencies
        self.frequencies = []
        # List of marker names
        self.labels = []
        # The typecode for the arrays. 'B' represents unsigned char, and can
        # store one byte of data, so:
        # 255 different values - 1 missing value = 254 possible alleles.
        # B is the smallest typecode in terms of memory usage.
        self.typecode = 'B'  # Unsigned char

    def __str__(self):
        return 'Chromosome object: %d markers, %f cM' % \
            (len(self.frequencies), max(self.genetic_map))

    def _iinfo(self):
        return izip(self.label, self.genetic_map, self.physical_map,
                    self.frequencies)<commit_msg>general formatters<commit_after>#!/usr/bin/env python

from array import array
from itertools import izip
from pydigree._pydigree import choice_with_probs


class Chromosome(object):
    """
    Chromsome is a class that keeps track of marker frequencies and distances.
    Not an actual chromosome with genotypes, which you would find under
    Individual.

    Markers are currently diallelic and frequencies are given for minor
    alleles. Marker frequencies must sum to 1. Major allele frequency
    is then f = 1 - f_minor.

    linkageequilibrium_chromosome generates chromsomes that are generated from
    simulating all markers with complete independence (linkage equilibrium).
    This is not typically what you want: you won't find any LD for association
    etc. linkageequilibrium_chromosome is used for 'seed' chromosomes when
    initializing a population pool or when simulating purely family-based
    studies for linkage analysis.
    """
    def __init__(self):
        # A list of floats that represent the position of the marker in cM
        self.genetic_map = []
        # A list of integers that doesnt do anything. Just for decoration
        self.physical_map = []
        # A list of floats representing minor allele frequencies
        self.frequencies = []
        # List of marker names
        self.labels = []
        # The typecode for the arrays. 'B' represents unsigned char, and can
        # store one byte of data, so:
        # 255 different values - 1 missing value = 254 possible alleles.
        # B is the smallest typecode in terms of memory usage.
        self.typecode = 'B'  # Unsigned char

    def __str__(self):
        return 'Chromosome object: %s markers, %s cM' % \
            (len(self.frequencies), max(self.genetic_map))

    def _iinfo(self):
        return izip(self.label, self.genetic_map, self.physical_map,
                    self.frequencies)
{'fraction_non_alphanumeric': 0.05825242718446602, 'fraction_numerical': 0.004723169771713461, 'mean_word_length': 2.812, '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': '2061602', 'n_tokens_mistral': 1061, 'n_tokens_neox': 969, 'n_words': 430}