Exemple #1
0
    def assemble(self):
        """
        Use the assembler to build up the contigs.

        We take and array of subprocess steps and execute them in order. We
        bracket this with pre and post assembly steps.
        """
        for step in self.steps:
            cmd = step()
            log.subcommand(cmd, self.args['temp_dir'], self.args['timeout'])
        self.post_assembly()
Exemple #2
0
    def assemble(self):
        """
        Use the assembler to build up the contigs.

        We take and array of subprocess steps and execute them in order. We
        bracket this with pre and post assembly steps.
        """
        for step in self.steps:
            cmd = step()
            log.subcommand(cmd, self.args['temp_dir'], self.args['timeout'])
        self.post_assembly()
Exemple #3
0
def against_sra(args, state, hits_file, shard):
    """Blast the query sequences against an SRA blast database."""
    cmd = []

    if args['protein'] and state['iteration'] == 1:
        cmd.append('tblastn')
        cmd.append('-db_gencode {}'.format(args['db_gencode']))
    else:
        cmd.append('blastn')
        cmd.append('-evalue {}'.format(args['evalue']))

    cmd.append('-outfmt 15')
    cmd.append('-max_target_seqs {}'.format(args['max_target_seqs']))
    cmd.append('-out {}'.format(hits_file))
    cmd.append('-db {}'.format(shard))
    cmd.append('-query {}'.format(state['query_file']))

    command = ' '.join(cmd)
    log.subcommand(command, args['temp_dir'])
Exemple #4
0
def against_contigs(blast_db, query_file, hits_file, **kwargs):
    """
    Blast the query sequence against the contigs.

    The blast output will have the scores for later processing.
    """
    cmd = []

    if kwargs['protein']:
        cmd.append('tblastn')
        cmd.append('-db_gencode {}'.format(kwargs['db_gencode']))
    else:
        cmd.append('blastn')

    cmd.append('-db {}'.format(blast_db))
    cmd.append('-query {}'.format(query_file))
    cmd.append('-out {}'.format(hits_file))
    cmd.append('-outfmt 15')

    command = ' '.join(cmd)
    log.subcommand(command, kwargs['temp_dir'])
Exemple #5
0
def against_contigs(blast_db, query_file, hits_file, **kwargs):
    """
    Blast the query sequence against the contigs.

    The blast output will have the scores for later processing.
    """
    cmd = []

    if kwargs['protein']:
        cmd.append('tblastn')
        cmd.append('-db_gencode {}'.format(kwargs['db_gencode']))
    else:
        cmd.append('blastn')

    cmd.append('-db {}'.format(blast_db))
    cmd.append('-query {}'.format(query_file))
    cmd.append('-out {}'.format(hits_file))
    cmd.append('-outfmt 15')

    command = ' '.join(cmd)
    log.subcommand(command, kwargs['temp_dir'])
Exemple #6
0
def against_sra(args, state, hits_file, shard):
    """Blast the query sequences against an SRA blast database."""
    cmd = []

    if args['protein'] and state['iteration'] == 1:
        cmd.append('tblastn')
        cmd.append('-db_gencode {}'.format(args['db_gencode']))
    else:
        cmd.append('blastn')

    cmd.append('-evalue {}'.format(args['evalue']))
    cmd.append('-outfmt 15')
    cmd.append('-max_target_seqs {}'.format(args['max_target_seqs']))
    cmd.append('-out {}'.format(hits_file))
    cmd.append('-db {}'.format(shard))
    cmd.append('-query {}'.format(state['query_file']))

    if args['word_size']:
        cmd.append('-word_size {}'.format(args['word_size']))

    command = ' '.join(cmd)
    log.subcommand(command, args['temp_dir'])
Exemple #7
0
def create_db(temp_dir, fasta_file, shard):
    """Create a blast database."""
    cmd = 'makeblastdb -dbtype nucl -in {} -out {}'
    cmd = cmd.format(fasta_file, shard)
    log.subcommand(cmd, temp_dir)
Exemple #8
0
def create_db(temp_dir, fasta_file, shard):
    """Create a blast database."""
    cmd = 'makeblastdb -dbtype nucl -in {} -out {}'
    cmd = cmd.format(fasta_file, shard)
    log.subcommand(cmd, temp_dir)