<commit_before>'''
extract_methods.py - Methods for extracting UMIs and cell barcodes
===================================================================

'''
import collections
import umi_tools.Utilities as U
from umi_tools.umi_methods import RANGES


def addBarcodesToIdentifier(self, read, UMI, cell):
    '''extract the identifier from a read and append the UMI and
    cell barcode before the first space'''

    read_id = read.identifier.split(" ")

    if cell == "":
        read_id[0] = read_id[0] + "_" + UMI
    else:
        read_id[0] = read_id[0] + "_" + cell + "_" + UMI

    identifier = " ".join(read_id)

    return identifier

<commit_msg>debug addBarcode function<commit_after>'''
extract_methods.py - Methods for extracting UMIs and cell barcodes
===================================================================

'''
import collections
import umi_tools.Utilities as U
from umi_tools.umi_methods import RANGES


def addBarcodesToIdentifier(read, UMI, cell):
    '''extract the identifier from a read and append the UMI and
    cell barcode before the first space'''

    read_id = read.identifier.split(" ")

    if cell == "":
        read_id[0] = read_id[0] + "_" + UMI
    else:
        read_id[0] = read_id[0] + "_" + cell + "_" + UMI

    identifier = " ".join(read_id)

    return identifier


{'fraction_non_alphanumeric': 0.2004538577912254, 'fraction_numerical': 0.006051437216338881, 'mean_word_length': 3.8284671532846715, 'pattern_counts': {'":': 2, '<': 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': '4712303', 'n_tokens_mistral': 405, 'n_tokens_neox': 386, 'n_words': 115}