INNER CODE UNIT · Python

get_barcodes

timoast/sinto · sinto/addbarcodes.py:107

def get_barcodes(f, bases=12, prefix="", suffix="", wl=None):
    f_open = open_fastq(f)
    if f.endswith(".gz"):
        gz = True
    else:
        gz = False
    x = 0
    cb = []
    for i in f_open:
        if (x % 4 == 1):
            if gz:
                cb.append(prefix + i.decode("utf-8")[:bases] + suffix)
            else:
                cb.append(prefix + i[:bases] + suffix)
        x += 1
    f_open.close()
    if wl is not None:
        # check if the whitelist already contains corrected barcodes

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…