def remove_chimeras_denovo_from_seqs(seqs_fp, working_dir, threads=1):
    """Remove chimeras de novo using UCHIME (VSEARCH implementation).

    Parameters
    ----------
    seqs_fp: string
        file path to FASTA input sequence file
    output_fp: string
        file path to store chimera-free results
    threads : int
        number of threads (0 for all cores)

    Returns
    -------
    output_fp
        the chimera removed fasta file name
    """
    logger = logging.getLogger(__name__)
    logger.info('remove_chimeras_denovo_from_seqs seqs file %s'
                'to working dir %s' % (seqs_fp, working_dir))

    output_fp = join(
        working_dir, "%s.no_chimeras" % basename(seqs_fp))

    # we use the parameters dn=0.000001, xn=1000, minh=10000000
    # so 1 mismatch in the A/B region will cancel it being labeled as chimera
    # and ~3 unique reads in each region will make it a chimera if
    # no mismatches
    params = ['vsearch', '--uchime_denovo', seqs_fp,
              '--nonchimeras', output_fp,
              '-dn', '0.000001', '-xn', '1000',
              '-minh', '10000000', '--mindiffs', '5',
              '--fasta_width', '0', '--threads', str(threads)]
    sout, serr, res = _system_call(params)
    if not res == 0:
        logger.error('problem with chimera removal for file %s' % seqs_fp)
        logger.debug('stdout : %s' % sout)
        logger.debug('stderr : %s' % serr)
    return output_fp
def remove_chimeras_denovo_from_seqs ( seqs_fp , working_dir , threads = 1 ) : logger = logging . getLogger ( __name__ ) logger . info ( 'remove_chimeras_denovo_from_seqs seqs file %s' 'to working dir %s' % ( seqs_fp , working_dir ) ) output_fp = join ( working_dir , "%s.no_chimeras" % basename ( seqs_fp ) ) params = [ 'vsearch' , '--uchime_denovo' , seqs_fp , '--nonchimeras' , output_fp , '-dn' , '0.000001' , '-xn' , '1000' , '-minh' , '10000000' , '--mindiffs' , '5' , '--fasta_width' , '0' , '--threads' , str ( threads ) ] sout , serr , res = _system_call ( params ) if not res == 0 : logger . error ( 'problem with chimera removal for file %s' % seqs_fp ) logger . debug ( 'stdout : %s' % sout ) logger . debug ( 'stderr : %s' % serr ) return output_fp
Remove chimeras de novo using UCHIME (VSEARCH implementation).

    Parameters
    ----------
    seqs_fp: string
        file path to FASTA input sequence file
    output_fp: string
        file path to store chimera-free results
    threads : int
        number of threads (0 for all cores)

    Returns
    -------
    output_fp
        the chimera removed fasta file name