diff --git a/pipes/rules/assembly.rules b/pipes/rules/assembly.rules index d3e251d6c..b59d1cbdd 100644 --- a/pipes/rules/assembly.rules +++ b/pipes/rules/assembly.rules @@ -39,7 +39,7 @@ rule assemble_trinity: input: config["data_dir"]+'/'+config["subdirs"]["per_sample"]+'/{sample}.taxfilt.bam' output: config["tmp_dir"] +'/'+config["subdirs"]["assembly"]+'/{sample}.assembly1-trinity.fasta' resources: - mem=4, + mem=7, cores=int(config.get("number_of_threads", 1)) params: LSF=config.get('LSF_queues', {}).get('short', '-W 4:00'), UGER=config.get('UGER_queues', {}).get('short', '-q short'), @@ -52,7 +52,7 @@ rule assemble_trinity: makedirs(expand("{dir}/{subdir}", dir=[config["data_dir"],config["tmp_dir"]], subdir=config["subdirs"]["assembly"])) - shell("{config[bin_dir]}/assembly.py assemble_trinity {input} {params.clipDb} {output} --n_reads={params.n_reads} --outReads {params.subsamp_bam} --threads {params.numThreads}") + shell("{config[bin_dir]}/assembly.py assemble_trinity {input} {params.clipDb} {output} --n_reads={params.n_reads} --outReads {params.subsamp_bam} --threads {params.numThreads} --JVMmemory 5g") rule orient_and_impute: ''' This step cleans up the Trinity assembly with a known reference genome. diff --git a/pipes/rules/interhost.rules b/pipes/rules/interhost.rules index fe773a737..5f4f0bffe 100644 --- a/pipes/rules/interhost.rules +++ b/pipes/rules/interhost.rules @@ -91,6 +91,16 @@ rule ref_guided_diversity: shell("cat " + " ".join(params.inFastas) + " > {output[0]}") merge_vcfs(params.inVcfs, params.refGenome, output[1]) +def multi_align_mafft_memory(_, input): + sample_count = len(list(read_samples_file(config["samples_assembly"]))) + if sample_count in range(0,50): + mem=8 + elif sample_count in range(50,100): + mem=16 + elif sample_count >= 100: + mem=32 + return mem + rule multi_align_mafft: input: expand("{data_dir}/{subdir}/{sample}.fasta", @@ -105,10 +115,10 @@ rule multi_align_mafft: subdir=config["subdirs"]["multialign_ref"], chrom=range(1, len(config["accessions_for_ref_genome_build"])+1)) resources: - mem=8, + mem=multi_align_mafft_memory, cores=int(config.get("number_of_threads", 1)) params: LSF=config.get('LSF_queues', {}).get('short', '-W 4:00'), - UGER=config.get('UGER_queues', {}).get('short', '-q short'), + UGER=config.get('UGER_queues', {}).get('long', '-q long'), logid="all", refGenome=os.path.join(config["ref_genome_dir"],"reference"+".fasta"), samples=list(read_samples_file(config["samples_assembly"])),