1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
// Functions used to smaple kmers and get trusted kmers
#ifndef _MOURISL_GETKMERS
#define _MOURISL_GETKMERS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <pthread.h>
#include "Reads.h"
#include "Store.h"
#include "KmerCode.h"
#include "utils.h"
// The pattern of sampling for each read.
// Marks the bits to indicate whether to sample the
// kmer end at that position.
#define SAMPLE_PATTERN_COUNT 65536
struct _SamplePattern
{
char tag[ MAX_READ_LENGTH / 8 ] ;
} ;
// Strcture for handling multi-threads
struct _SampleKmersThreadArg
{
int kmerLength ;
double alpha ;
//int batchSize ;
Store *kmers ;
Reads *reads ;
struct _SamplePattern *samplePatterns ;
pthread_mutex_t *lock ;
pthread_mutex_t *lockPut ;
} ;
struct _StoreKmersThreadArg
{
int kmerLength ;
//int batchSize ;
int *threshold ;
Store *kmers ;
Store *trustedKmers ;
Reads *reads ;
char goodQuality ;
char badQuality ;
pthread_mutex_t *lock ;
} ;
void *SampleKmers_Thread( void *arg ) ;
void SampleKmersInRead( char *read, char *qual, int kmerLength, double alpha, KmerCode &kmerCode, Store *kmers ) ;
void *StoreKmers_Thread( void *arg ) ;
void StoreTrustedKmers( char *read, char *qual, int kmerLength, char badQuality, int *threshold,
KmerCode &kmerCode, Store *kmers, Store *trustedKmers ) ;
#endif
|