Skip to content
Snippets Groups Projects
Commit f03fa9e1 authored by Blaise Li's avatar Blaise Li
Browse files

Renamed fq_demux to qaf-demux, reorganizations.

parent 2f46b269
No related branches found
No related tags found
No related merge requests found
......@@ -3,13 +3,16 @@
"""This program demultiplexes fastq data based on a given list of
barcodes and a barcode start position. It tries to assign each fastq
record to the most likely barcode, taking into account the sequence
qualities (interpreted as being sanger-encoded)."""
qualities (interpreted as being sanger-encoded).
Known similar approach: https://github.com/grenaud/deML
"""
import argparse
import fileinput
import os
from itertools import islice
# from qaf_demux.libqafdemux import parse_fastq
OPD = os.path.dirname
OPJ = os.path.join
......@@ -85,13 +88,22 @@ def main():
bpp = bc_prob_profile(seq, qual)
def prob(barcode):
# TODO: handle N correctly
bc_prob = 1
nb_diff = 0
for ((seq_letter, prob_err), bc_letter) in zip(bpp, barcode):
if seq_letter == bc_letter:
# This position's contribution to the
# probability for the barcode is the
# probability that this letter is correct
bc_prob *= (1 - prob_err)
else:
nb_diff += 1
# This position's contribution to the
# probability for the barcode is the
# probability that this letter is not correct
# and that the real one is the one among the
# three other that actually is bc_letter
bc_prob *= (prob_err / 3)
return bc_prob, nb_diff
return prob
......
#!/bin/sh
python3.6 setup.py build_ext
pip3.6 install -e .
from setuptools import setup, find_packages
#from Cython.Build import cythonize
# Adapted from Biopython
__version__ = "0.1"
setup(
name="qaf_demux",
#version=libworkflows.__version__,
version=__version__,
description=".",
author="Blaise Li",
author_email="blaise.li__github@nsup.org",
license="MIT",
packages=find_packages(),
scripts=["bin/qaf-demux"])#,
#ext_modules = cythonize("qaf_demux/libqafdemux.pyx"),
#install_requires=["cytoolz"],
#zip_safe=False)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment