<commit_before>#!/usr/bin/python

import sys


if len(sys.argv) == 1:
    print "usage: ", sys.argv[0], " <fasta file or index file> <region size>"
    print "generates a list of freebayes/bamtools region specifiers on stdout"
    print "intended for use in creating cluster jobs"
    exit(1)

fasta_index_file = open(sys.argv[1])
if not fasta_index_file.endswith(".fai"):
    fasta_index_file = fasta_index_file + ".fai"
region_size = int(sys.argv[2])

for line in fasta_index_file:

    fields = line.strip().split("\t")

    chrom_name = fields[0]
    chrom_length = int(fields[1])
    region_start = 0

    while region_start < chrom_length:
        start = region_start
        end = region_start + region_size
        if end > chrom_length:
            end = chrom_length
        print chrom_name + ":" + str(region_start) + "-" + str(end)
        region_start = end

<commit_msg>fixes #111<commit_after>#!/usr/bin/python

import sys


if len(sys.argv) == 1:
    print "usage: ", sys.argv[0], " <fasta file or index file> <region size>"
    print "generates a list of freebayes/bamtools region specifiers on stdout"
    print "intended for use in creating cluster jobs"
    exit(1)

fasta_index_file = sys.argv[1]
if not fasta_index_file.endswith(".fai"):
    fasta_index_file = fasta_index_file + ".fai"

fasta_index_file = open(fasta_index_file)
region_size = int(sys.argv[2])

for line in fasta_index_file:

    fields = line.strip().split("\t")

    chrom_name = fields[0]
    chrom_length = int(fields[1])
    region_start = 0

    while region_start < chrom_length:
        start = region_start
        end = region_start + region_size
        if end > chrom_length:
            end = chrom_length
        print chrom_name + ":" + str(region_start) + "-" + str(end)
        region_start = end


{'fraction_non_alphanumeric': 0.11406423034330011, 'fraction_numerical': 0.010520487264673311, 'mean_word_length': 3.125570776255708, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 9, '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': '6519507', 'n_tokens_mistral': 632, 'n_tokens_neox': 612, 'n_words': 155}