Run skesa to assemble genomes

def assemble_amplicon_skesa(self):
        """
        Run skesa to assemble genomes
        """
        with progressbar(self.metadata) as bar:
            for sample in bar:
                # Initialise variables
                sample[self.analysistype].skesa_outdir = os.path.join(
                    sample[self.analysistype].outputdir, self.analysistype)
                make_path(sample[self.analysistype].skesa_outdir)
                sample[self.analysistype].assemblyfile = os.path.join(sample[self.analysistype].skesa_outdir,
                                                                      'contigs.fasta')
                # If there are two fastq files
                if len(sample.general.fastqfiles) == 2:
                    # Set the reverse fastq name https://github.com/ncbi/SKESA/issues/7
                    sample[self.analysistype].spadescommand = 'skesa --fastq {fastqfiles} --cores {threads} ' \
                                                              '--use_paired_ends --vector_percent 1 ' \
                                                              '--contigs_out {contigs}'\
                        .format(fastqfiles=','.join(sample.general.fastqfiles),
                                threads=self.cpus,
                                contigs=sample[self.analysistype].assemblyfile)
                # Same as above, but use single read settings for the assembler
                else:
                    sample[self.analysistype].spadescommand = 'skesa --fastq {fastqfiles} --cores {threads} ' \
                                                              '--vector_percent 1 --contigs_out {contigs}'\
                        .format(fastqfiles=','.join(sample.general.fastqfiles),
                                threads=self.cpus,
                                contigs=sample[self.analysistype].assemblyfile)
                if not os.path.isfile(sample[self.analysistype].assemblyfile):
                    # Create and run the sequence call as required
                    run_subprocess(sample[self.analysistype].spadescommand)
                    if not os.path.isfile(sample[self.analysistype].assemblyfile):
                        sample[self.analysistype].assemblyfile = 'NA'