-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathuniprot.h
81 lines (66 loc) · 2.83 KB
/
uniprot.h
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// NOTE - Eventually separate this out into common reporting functionality and UniProt specific
// once we start supporting multiple report types/sources
#ifndef UNIPROT_H_
#define UNIPROT_H_
#include "bwamem.h"
#define UNIPROT_MAX_SUBMIT 5000
#define UNIPROT_MAX_ERROR 5
#define UNIPROT_BUFFER_GROW 50000000
#define UNIPROT_LIST_FULL 0
#define UNIPROT_LIST_GENES 1
#define UNIPROT_LIST_ORGANISM 2
#define UNIPROT_REFERENCE_SWISSPROT 1
#define UNIPROT_REFERENCE_UNIREF90 2
typedef struct {
char * id;
char * gene;
char * organism;
int numOccurrence;
int totalQuality;
int maxQuality;
} UniprotEntry;
typedef struct {
UniprotEntry * entries;
int entryCount;
int unalignedCount;
} UniprotList;
typedef struct {
char * buffer;
int size;
int capacity;
} CURLBuffer;
// Each pipeline run maintains its own list
extern UniprotList * uniprotPriEntryLists;
extern UniprotList * uniprotSecEntryLists;
extern int uniprotPriListCount;
extern int uniprotSecListCount;
// Rendering
void renderUniprotReport(int passType, int passPrimary, FILE * passStream, const char * passProxy);
void renderUniprotEntries(UniprotList * passList, int passType, FILE * passStream);
void renderNumberAligned(const mem_opt_t * passOptions);
// Population
int addUniprotList(worker_t * passWorker, int passSize, int passFull);
void cleanUniprotLists(UniprotList * passLists, int passPrimary);
// Support
UniprotList * getGlobalLists(int passPrimary);
int * getGlobalCount(int passPrimary);
void prepareUniprotReport(int passType, int passPrimary, UniprotList * passLists, CURLBuffer * passBuffer, const char * passProxy);
void prepareUniprotLists(UniprotList * retLists, int passPrimary);
void aggregateUniprotList(UniprotList * retList, int passListType, int passPrimary);
void joinOnlineLists(UniprotList * retList, char * passUniprotOutput);
// QSort Functions
int uniprotEntryCompareCommon (const void * passEntry1, const void * passEntry2);
int uniprotEntryCompareID (const void * passEntry1, const void * passEntry2);
int uniprotEntryCompareGene (const void * passEntry1, const void * passEntry2);
int uniprotEntryCompareOrganism (const void * passEntry1, const void * passEntry2);
int uniprotEntryCompareOnline (const void * passEntry1, const void * passEntry2);
// UniProt Interoperability
int cleanUniprotReference(int passReference, const char * passBase);
void cleanUniprotReferenceUniref(const char * passName, int passANN);
const char * downloadUniprotReference(int passReference, const char * passProxy);
void retrieveUniprotOnline(UniprotList * passList, CURLBuffer * retBuffer, const char * passProxy);
size_t receiveUniprotOutput(void * passString, size_t passSize, size_t passNum, void * retStream);
void initCURLBuffer(CURLBuffer * passBuffer, int passCapacity);
void resetCURLBuffer(CURLBuffer * passBuffer);
void freeCURLBuffer(CURLBuffer * passBuffer);
#endif /* UNIPROT_H_ */