FastqPuri
|
trim adapters from double stranded data More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "trimDS.h"
#include "Lmer.h"
#include "trim.h"
#include "struct_trimFilter.h"
Functions | |
DS_adap | init_DSadap (char *ad1, char *ad2, int L1, int L2) |
initialization of a DS_adap structure More... | |
static void | pack_reads (DS_adap *ptr_DSad, Fq_read *r1, Fq_read *r2) |
pack reads with process_seq so that we can compute the edit distance between two subsequences. Read 1 will be packed once in the forward direction and Read 2 twice in the reverse direction with a shift of half a byte. More... | |
static int | QtrimDS (Fq_read *r1, Fq_read *r2, int L) |
trims both reads reducing them to a length L. More... | |
static double | obtain_scoreDS (Fq_read *r1, int pos1, Fq_read *r2, int pos2) |
obtains the score when comparing two subsequences of extended r1 and extended r2, starting in pos1 and pos2 respectively. The score is computed by adding log_10(4) when a match is observed and subtracting Q/10.0 when a mismatch is observed, with Q being the quality value. If there is a mismatch in a region where both read 1 and read 2 have qualities associated to the nucleotide under consideration, then the maximum of the quality values is subtracted. More... | |
static int | alignDS_uint64 (Fq_read *r1, Fq_read *r2) |
try to find adapter remnants in the reads r1 and r2 by aligning their extended versions (adapter1 + r1) vs rev_comp(adapter2 + r2). More... | |
int | trim_adapterDS (DS_adap *ptr_DSad, Fq_read *r1, Fq_read *r2) |
trim the sequences, discard them or keep them unchanged depending on them having adapters remnants. More... | |
Variables | |
uint8_t | fw_1B [256] |
uint8_t | bw_1B [256] |
Iparam_trimFilter | par_TF |
trim adapters from double stranded data
try to find adapter remnants in the reads r1 and r2 by aligning their extended versions (adapter1 + r1) vs rev_comp(adapter2 + r2).
r1 | pointer to Fq_read for read 1 |
r2 | pointer to Fq_read for read 2 |
DS_adap init_DSadap | ( | char * | ad1, |
char * | ad2, | ||
int | L1, | ||
int | L2 | ||
) |
initialization of a DS_adap structure
ad1 | adapter 1 sequence |
ad2 | adapter 2 sequence |
L1 | adapter 1 sequence length |
L2 | adapter 2 sequence length |
obtains the score when comparing two subsequences of extended r1 and extended r2, starting in pos1 and pos2 respectively. The score is computed by adding log_10(4) when a match is observed and subtracting Q/10.0 when a mismatch is observed, with Q being the quality value. If there is a mismatch in a region where both read 1 and read 2 have qualities associated to the nucleotide under consideration, then the maximum of the quality values is subtracted.
r1 | pointer to Fq_read for read 1 |
pos1 | position to start comparing in read 1, starting from 5' end of the extended sequence (adapter 1 + read 1) |
r2 | pointer to Fq_read for read 2 |
pos2 | position to start comparing in read 2, starting from 3' end of the extended sequence (adapter 2 + read 2) |
pack reads with process_seq so that we can compute the edit distance between two subsequences. Read 1 will be packed once in the forward direction and Read 2 twice in the reverse direction with a shift of half a byte.
ptr_DSad | pointer to DS_adap structure, contains adapters sequences |
r1 | pointer to Fq_read for read 1, packed sequence stored here. |
r2 | pointer to Fq_read for read 2, packed sequences stored here. |
trims both reads reducing them to a length L.
r1 | pointer to Fq_read for read 1 |
r2 | pointer to Fq_read for read 2 |
L |
trim the sequences, discard them or keep them unchanged depending on them having adapters remnants.
uint8_t bw_1B[256] |
global variable. Lookup table.
uint8_t fw_1B[256] |
global variable. Lookup table.
Iparam_trimFilter par_TF |
global variable. Input parameters.
global variable: Input parameters trimFilter.
global variable: Input parameters of makeTree.