def run_cutadapt(job, r1_id, r2_id, fwd_3pr_adapter, rev_3pr_adapter):
work_dir = job.fileStore.getLocalTempDir()<EOL>if r2_id:<EOL><INDENT>require(rev_3pr_adapter, "<STR_LIT>")<EOL><DEDENT>parameters = ['<STR_LIT>', fwd_3pr_adapter,<EOL>'<STR_LIT>', '<STR_LIT>']<EOL>if r1_id and r2_id:<EOL><INDENT>job.fileStore.readGlobalFile(r1_id, os.path.join(work_dir, '<STR_LIT>'))<EOL>job.fileStore.readGlobalFile(r2_id, os.path.join(work_dir, '<STR_LIT>'))<EOL>parameters.extend(['<STR_LIT>', rev_3pr_adapter,<EOL>'<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>'])<EOL><DEDENT>else:<EOL><INDENT>job.fileStore.readGlobalFile(r1_id, os.path.join(work_dir, '<STR_LIT>'))<EOL>parameters.extend(['<STR_LIT>', '<STR_LIT>', '<STR_LIT>'])<EOL><DEDENT>dockerCall(job=job, tool='<STR_LIT>',<EOL>workDir=work_dir, parameters=parameters)<EOL>if r1_id and r2_id:<EOL><INDENT>r1_cut_id = job.fileStore.writeGlobalFile(os.path.join(work_dir, '<STR_LIT>'))<EOL>r2_cut_id = job.fileStore.writeGlobalFile(os.path.join(work_dir, '<STR_LIT>'))<EOL><DEDENT>else:<EOL><INDENT>r1_cut_id = job.fileStore.writeGlobalFile(os.path.join(work_dir, '<STR_LIT>'))<EOL>r2_cut_id = None<EOL><DEDENT>return r1_cut_id, r2_cut_id<EOL>
Adapter trimming for RNA-seq data

:param JobFunctionWrappingJob job: passed automatically by Toil
:param str r1_id: FileStoreID of fastq read 1
:param str r2_id: FileStoreID of fastq read 2 (if paired data)
:param str fwd_3pr_adapter: Adapter sequence for the forward 3' adapter
:param str rev_3pr_adapter: Adapter sequence for the reverse 3' adapter (second fastq pair)
:return: R1 and R2 FileStoreIDs
:rtype: tuple