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

"""
Module containing multiple functions for data wrantling:
GFA1 <-> splice_graph
bed3 to bed6
Data frames, ...
"""

import logging

from Bio import SeqIO


def _coordinate_str_to_tuple(coordinates):
    """(string) -> (string, int, int)

    Convert a genomic coordinate of the form "TR_ID:start-end" into the tuple
    ("TR_ID", start, end).
    """
    transcript, start_end = coordinates.rsplit(":", 1)
    start_end = start_end.rsplit("-", 1)
    start = int(start_end[0])
    end = int(start_end[1])
    return transcript, start, end


def _coordinate_tuple_to_str(transcript_id, start, end):
    """(str, int, int) -> str

    Convert coordinates to str transcript_id:start-end
    """
    return "{transcript_id}:{start}-{end}".format(
        transcript_id=transcript_id,
        start=start,
        end=end
    )
<commit_msg>Unused import<commit_after>#!/usr/bin/env python3

"""
Module containing multiple functions for data wrantling:
GFA1 <-> splice_graph
bed3 to bed6
Data frames, ...
"""

import logging


def _coordinate_str_to_tuple(coordinates):
    """(string) -> (string, int, int)

    Convert a genomic coordinate of the form "TR_ID:start-end" into the tuple
    ("TR_ID", start, end).
    """
    transcript, start_end = coordinates.rsplit(":", 1)
    start_end = start_end.rsplit("-", 1)
    start = int(start_end[0])
    end = int(start_end[1])
    return transcript, start, end


def _coordinate_tuple_to_str(transcript_id, start, end):
    """(str, int, int) -> str

    Convert coordinates to str transcript_id:start-end
    """
    return "{transcript_id}:{start}-{end}".format(
        transcript_id=transcript_id,
        start=start,
        end=end
    )

{'fraction_non_alphanumeric': 0.1341816078658184, 'fraction_numerical': 0.009253903990746095, 'mean_word_length': 3.4935064935064934, 'pattern_counts': {'":': 2, '<': 5, '<?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': '5141486', 'n_tokens_mistral': 597, 'n_tokens_neox': 564, 'n_words': 147}