From 672c7e6457585c92cb45f53cd1646279d1cb9744 Mon Sep 17 00:00:00 2001 From: ExpressionAnalysis Date: Thu, 2 Feb 2017 16:48:52 -0500 Subject: [PATCH] add -s option for barcode label in file name --- clipper/fastq-multx.cpp | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/clipper/fastq-multx.cpp b/clipper/fastq-multx.cpp index 0772579..6a195ec 100644 --- a/clipper/fastq-multx.cpp +++ b/clipper/fastq-multx.cpp @@ -34,7 +34,7 @@ See "void usage" below for usage. #define THFIXFACTOR 20 #define endstr(e) (e=='e'?"end":e=='b'?"start":"n/a") -const char * VERSION = "1.02.772"; +const char * VERSION = "1.03"; // barcode struct bc { @@ -116,6 +116,7 @@ int main (int argc, char **argv) { const char* list=NULL; // use a barcode master list char verify='\0'; bool noexec = false; + bool seqnames = false; const char *group = NULL; bool usefile1 = false; int phred = 33; @@ -125,7 +126,7 @@ int main (int argc, char **argv) { int i; bool omode = false; char *bfil = NULL; - while ( (c = getopt (argc, argv, "-DzxnHhbeov:m:B:g:L:l:G:q:d:t:")) != -1) { + while ( (c = getopt (argc, argv, "-DzxnHhbeosv:m:B:g:L:l:G:q:d:t:")) != -1) { switch (c) t:{ case '\1': if (omode) { @@ -143,6 +144,7 @@ int main (int argc, char **argv) { } break; case 'o': omode=true; break; + case 's': seqnames=true; break; case 'v': if (strlen(optarg)>1) { fprintf(stderr, "Option -v requires a single character argument"); @@ -801,6 +803,13 @@ int main (int argc, char **argv) { // TODO: output barcode read ...but only for unmatched? int b; for (b=0;b<=bcnt;++b) { + size_t nameseq_len = strlen(bc[b].id.s); + if ((b < bcnt) && seqnames) { + nameseq_len = strlen(bc[b].seq.s); + if (bc[b].dual) + nameseq_len += bc[b].dual_n + 1; + } + for (i=0;i, using BCFIL as a master list\n" "-B BCFIL Use barcodes from BCFIL, no determination step, codes in \n" "-H Use barcodes from illumina's header, instead of a read\n" +"-s Substitute barcode sequence instead of barcode label into output file names\n" "-b Force beginning of line (5') for barcode matching\n" "-e Force end of line (3') for batcode matching\n" "-t NUM Divide threshold for auto-determine by factor NUM (1), > 1 = more sensitive\n"