-
Notifications
You must be signed in to change notification settings - Fork 1
/
pandaseq-sam.h
149 lines (134 loc) · 4.41 KB
/
pandaseq-sam.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/* PANDAseq -- Assemble paired SAM/BAM Illumina reads and strip the region between amplification primers.
Copyright (C) 2012 Andre Masella
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _PANDASEQ_SAM_H
# define _PANDASEQ_SAM_H
# include <pandaseq.h>
# ifdef __cplusplus
# define EXTERN_C_BEGIN extern "C" {
# define EXTERN_C_END }
# else
# define EXTERN_C_BEGIN
# define EXTERN_C_END
# endif
# ifdef _WIN32
# ifdef PANDA_SAM_LIB_COMPILING
# define PANDA_SAM_EXTERN extern __declspec(dllexport)
# else
# define PANDA_SAM_EXTERN extern __declspec(dllimport)
# endif
# else
# define PANDA_SAM_EXTERN extern
# endif
EXTERN_C_BEGIN
/**
* Get the version of the underlying SAM tools library used.
*/
const char *panda_sam_version(
void);
/**
* Parse a SAM/BAM style Illumina sequence.
*
* These are different from normal Illumina names as the tags have been stripped.
*/
bool panda_seqid_parse_sam(
panda_seq_identifier *id,
char *str);
/**
* Create an object to read sequences from a SAM file
*
* @see: panda_create_sam_reader_ex
*/
# define panda_create_sam_reader(filename, logger, binary, tag, user_data, destroy) panda_create_sam_reader_ex(filename, logger, binary, tag, NULL, user_data, destroy)
/**
* Create an object to read sequences from a SAM file with an orphan sequences file
*
* @see: panda_create_sam_reader_ex
*/
# define panda_create_sam_reader_orphans(filename, logger, binary, tag, orphan_file, user_data, destroy) panda_create_sam_reader_ex(filename, logger, binary, tag, orphan_file, user_data, destroy)
/**
* Create an object to read sequence from a SAM file
*
* This API is not guaranteed to be stable. Use one of the alternate forms.
*
* @filename: the filename containing paired-end Illumina sequences
* @logger: the logging to use during assembly
* @binary: whether the file is binary (BAM) or text (SAM)
* @tag:(allow-none): a tag to replace the missing Illumina barcoding tag
* @orphan_file: the FASTQ file where unpaired/damaged/broken reads should be place.
* Returns:(closure user_data) (scope notified): a sequence source callback
* @see panda_create_sam_reader
* @see panda_create_sam_reader_orphans
*/
PandaNextSeq panda_create_sam_reader_ex(
const char *filename,
PandaLogProxy logger,
bool binary,
const char *tag,
const char *orphan_file,
void **user_data,
PandaDestroy *destroy);
/**
* Create a new assembler for given a SAM file.
* @see panda_create_sam_reader
*/
PandaAssembler panda_assembler_open_sam(
const char *filename,
PandaLogProxy logger,
bool binary,
const char *tag);
/**
* The standard argument handler for a SAM file of pair-end reads.
*/
typedef struct panda_args_sam *PandaArgsSam;
/**
* Command line arguments for a SAM file of pair-end reads.
*/
PANDA_SAM_EXTERN const panda_tweak_general *const panda_args_sam_args[];
PANDA_SAM_EXTERN const size_t panda_args_sam_args_length;
/**
* Create a new argument handler.
*/
PandaArgsSam panda_args_sam_new(
);
/**
* Cleanup the argument handler.
*/
void panda_args_sam_free(
PandaArgsSam data);
/**
* Process the command line arguments for the SAM argument handler.
*/
bool panda_args_sam_tweak(
PandaArgsSam data,
char flag,
const char *argument);
/**
* Initialise the sequence stream for the SAM argument handler.
*/
PandaNextSeq panda_args_sam_opener(
PandaArgsSam data,
PandaLogProxy logger,
PandaFailAlign *fail,
void **fail_data,
PandaDestroy *fail_destroy,
void **next_data,
PandaDestroy *next_destroy);
/**
* Do additional assembly setup for the SAM argument handler.
*/
bool panda_args_sam_setup(
PandaArgsSam data,
PandaAssembler assembler);
EXTERN_C_END
#endif