From e6041dd49e2c75720cf660f593038d752c571ab6 Mon Sep 17 00:00:00 2001 From: Daniel Park Date: Tue, 28 Apr 2015 22:29:02 -0400 Subject: [PATCH] more single barcode fixes. revert picard threads to fixed number instead of auto-scaling due to limit on open file handles --- broad_utils.py | 7 ++++--- tools/picard.py | 12 ++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/broad_utils.py b/broad_utils.py index 704b150c5..863711a86 100755 --- a/broad_utils.py +++ b/broad_utils.py @@ -186,15 +186,16 @@ def main_extract_barcodes(args): def make_params_file(inFile, bamDir, outFile): 'Create input file for illumina_basecalls' if any(row.get('barcode_2') for row in util.file.read_tabfile_dict(inFile)): - header = ['BARCODE_1', 'BARCODE_2', 'OUTPUT', 'SAMPLE_ALIAS', 'LIBRARY_NAME'] + header = ['OUTPUT', 'SAMPLE_ALIAS', 'LIBRARY_NAME', 'BARCODE_1', 'BARCODE_2'] else: - header = ['BARCODE_1', 'OUTPUT', 'SAMPLE_ALIAS', 'LIBRARY_NAME'] + header = ['BARCODE', 'OUTPUT', 'SAMPLE_ALIAS', 'LIBRARY_NAME'] with open(outFile, 'wt') as outf: outf.write('\t'.join(header)+'\n') rows = list(util.file.read_tabfile_dict(inFile)) rows.append({'barcode_1':'N','barcode_2':'N','sample':'Unmatched'}) for row in rows: - out = {'BARCODE_1':row['barcode_1'], + out = {'BARCODE':row['barcode_1'], + 'BARCODE_1':row['barcode_1'], 'BARCODE_2':row.get('barcode_2',''), 'SAMPLE_ALIAS':row['sample'], 'LIBRARY_NAME':row['sample']} diff --git a/tools/picard.py b/tools/picard.py index 725b4868a..422b2209c 100644 --- a/tools/picard.py +++ b/tools/picard.py @@ -158,7 +158,7 @@ class ExtractIlluminaBarcodesTool(PicardTools) : jvmMemDefault = '8g' defaults = {'read_structure':'101T8B8B101T', 'max_mismatches':0, 'minimum_base_quality':25, - 'num_processors':0} + 'num_processors':8} option_list = ('read_structure', 'max_mismatches', 'minimum_base_quality', 'min_mismatch_delta', 'max_no_calls', 'minimum_quality', 'compress_outputs', 'num_processors') @@ -190,7 +190,7 @@ class IlluminaBasecallsToSamTool(PicardTools) : defaults = {'read_structure':'101T8B8B101T', 'sequencing_center':'BI', 'adapters_to_check': ('PAIRED_END', 'NEXTERA_V1', 'NEXTERA_V2'), 'max_reads_in_ram_per_tile':100000, 'max_records_in_ram':100000, - 'num_processors':0, 'force_gc':False} + 'num_processors':8, 'force_gc':False} option_list = ('read_structure', 'sequencing_center', 'adapters_to_check', 'platform', 'max_reads_in_ram_per_tile', 'max_records_in_ram', 'num_processors', 'apply_eamss_filter', 'force_gc', 'first_tile', 'tile_limit', @@ -212,7 +212,11 @@ def execute(self, basecalls_dir, barcodes_dir, opts += ['BASECALLS_DIR='+basecalls_dir, 'BARCODES_DIR='+barcodes_dir, 'LANE='+str(lane), - 'RUN_BARCODE='+run_barcode, - 'LIBRARY_PARAMS='+library_params] + 'RUN_BARCODE='+run_barcode] + if 'BARCODE' in util.file.readFlatFileHeader(library_params): + # yes, it's deprecated, but it's the only way to do single-barcode pools + opts.append('BARCODE_PARAMS='+library_params) + else: + opts.append('LIBRARY_PARAMS='+library_params) PicardTools.execute(self, self.subtoolName, opts, JVMmemory)