I see, so I will have to gzip them post-demultiplexing. But it actually supports the gzip input, right? As stated also in the documentation "Sabre also supports gzipped file inputs" . Thank you a lot
Hello,
A quick question. I am using SABRE to demultiplex my single end GBS fastq.gz files. As input I am using directly my gzipped fastq.gz files, but I am not getting the output as a gzipped fastq.gz. Sabre is instead outputting a normal ASCII text, so fastq file. Is there any way to solve this? Below is my command line:
sabre se -f myfile.fastq.gz -b barcodes.txt -u unknown_barcode.fastq.gz
1 answer
Looking at the code, the answer is NO. The output files are opened using a 'simple' fopen(filename,"w")` https://github.com/najoshi/sabre/blob/039a55e500ba07b7e6432ea6ec2ddcfb3471d949/src/demulti_single.c#L148
Is there any way to solve this?
yes. update the code to using the gz library instead of the standard IO C library.
OMG, update will be hard for me, I can try, but I am not a brilliant programmer :) thank you
Thanks so much! For now it is not working: should I change only il file demulti_single.c? also, infn will become ingzn?
Since nothing was happening I re-build by typing make and it gave the following error (I put only a piece because it is too long for a comment):
gcc -Wall -pedantic -DVERSION=1.00 -O3 -c src/demulti_single.c
src/demulti_single.c: In function ‘single_usage’:
src/demulti_single.c:28:13: warning: passing argument 1 of ‘gzprintf’ from incompatible pointer type [-Wincompatible-pointer-types]
gzprintf (stderr, "\nUsage: %s se -f <fastq sequence file> -b <barcode file> -u <unknown barcode output file>\n\
^
In file included from src/demulti_single.c:4:0:
/usr/include/zlib.h:1349:23: note: expected ‘gzFile {aka struct gzFile_s *}’ but argument is of type ‘struct _IO_FILE *’
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
^
src/demulti_single.c:33:13: warning: passing argument 1 of ‘gzprintf’ from incompatible pointer type [-Wincompatible-pointer-types]
gzprintf (stderr, "-b, --barcode-file, File with barcode and output file name per line (required)\n\
^
In file included from src/demulti_single.c:4:0:
/usr/include/zlib.h:1349:23: note: expected ‘gzFile {aka struct gzFile_s *}’ but argument is of type ‘struct _IO_FILE *’
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
^
src/demulti_single.c: In function ‘single_main’:
src/demulti_single.c:118:13: warning: passing argument 1 of ‘gzprintf’ from incompatible pointer type [-Wincompatible-pointer-types]
gzprintf (stderr, "Error: Input file is same as barcode file.\n");
^
In file included from src/demulti_single.c:4:0:
/usr/include/zlib.h:1349:23: note: expected ‘gzFile {aka struct gzFile_s *}’ but argument is of type ‘struct _IO_FILE *’
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
^
src/demulti_single.c:124:13: warning: passing argument 1 of ‘gzprintf’ from incompatible pointer type [-Wincompatible-pointer-types]
gzprintf (stderr, "Could not open input file '%s'.\n", ingzn);
^
In file included from src/demulti_single.c:4:0:
/usr/include/zlib.h:1349:23: note: expected ‘gzFile {aka struct gzFile_s *}’ but argument is of type ‘struct _IO_FILE *’
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
^
src/demulti_single.c:128:10: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
barfile = gzopen (bargzn, "r");
^
src/demulti_single.c:130:13: warning: passing argument 1 of ‘gzprintf’ from incompatible pointer type [-Wincompatible-pointer-types]
gzprintf (stderr, "Could not open barcode file '%s'.\n", bargzn);
^
In file included from src/demulti_single.c:4:0:
/usr/include/zlib.h:1349:23: note: expected ‘gzFile {aka struct gzFile_s *}’ but argument is of type ‘struct _IO_FILE *’
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
^
src/demulti_single.c:134:14: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
unknownfile = gzopen (unknowngzn, "w");
^
src/demulti_single.c:136:13: warning: passing argument 1 of ‘gzprintf’ from incompatible pointer type [-Wincompatible-pointer-types]
gzprintf (stderr, "Could not open unknown output file '%s'.\n", unknowngzn);
^
In file included from src/demulti_single.c:4:0:
/usr/include/zlib.h:1349:23: note: expected ‘gzFile {aka struct gzFile_s *}’ but argument is of type ‘struct _IO_FILE *’
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
^
src/demulti_single.c:143:9: warning: implicit declaration of function ‘gzscanf’ [-Wimplicit-function-declaration]
while (gzscanf (barfile, "%s%s", barcode, baroutfn) != EOF) {
^
src/demulti_single.c:148:16: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
curr->bcfile = gzopen (baroutfn, "w");
^
src/demulti_single.c:174:14: warning: passing argument 1 of ‘gzprintf’ from incompatible pointer type [-Wincompatible-pointer-types]
gzprintf (curr->bcfile, "@%s", gzqrec->name.s);
^
In file included from src/demulti_single.c:4:0:
/usr/include/zlib.h:1349:23: note: expected ‘gzFile {aka struct gzFile_s *}’ but argument is of type ‘FILE * {aka struct _IO_FILE *}’
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
^
I did something and nevertheless the errors the program build sabre executable, and the files it creates are gzip compressed data, from Unix.But I am not sure the changes I made to the script are OK. Could you, please, check? Should I create a new question? Thank you
Log in to answer this question.
Does not look like it supports compressed files. You will need to gzip the files afterwards.