def run_bowtie2(reads, reference, outfile, threads=1):
    assert is_bowtie2_indexed(reference)
    cmd = ' '.join([
        'bowtie2',
        '-x', reference,
        '-U', reads,
        '-f',  # reads are in fasta format
        '--end-to-end --very-fast',
        '--threads', str(threads),
        '--all', # report all alignments
        '--reorder', # force SAM output order to match order of input reads
        '-S', outfile # output in SAM format
    ])

    common.syscall(cmd)
Beispiel #2
0
    def _run_primer3_core(self, fasta_file, config_file, outfile):
        tmpdir = tempfile.mkdtemp(prefix='tmp.run_primer3_core.',
                                  dir=os.getcwd())
        boulder_file = os.path.join(tmpdir, 'in.boulder')
        pyfastaq.tasks.to_boulderio(self.input_fasta, boulder_file)
        cmd = ' '.join([
            self.primer3_command,
            '-p3_settings_file=' + self.config_file,
            '<',
            boulder_file,
            '| gzip -9 -c >',
            outfile,
        ])

        common.syscall(cmd)
        shutil.rmtree(tmpdir)
    def _run_primer3_core(self, fasta_file, config_file, outfile):
        tmpdir = tempfile.mkdtemp(prefix="tmp.run_primer3_core.", dir=os.getcwd())
        boulder_file = os.path.join(tmpdir, "in.boulder")
        pyfastaq.tasks.to_boulderio(self.input_fasta, boulder_file)
        cmd = " ".join(
            [
                self.primer3_command,
                "-p3_settings_file=" + self.config_file,
                "<",
                boulder_file,
                "| gzip -9 -c >",
                outfile,
            ]
        )

        common.syscall(cmd)
        shutil.rmtree(tmpdir)
Beispiel #4
0
def run_bowtie2(reads, reference, outfile, threads=1):
    assert is_bowtie2_indexed(reference)
    cmd = ' '.join([
        'bowtie2',
        '-x',
        reference,
        '-U',
        reads,
        '-f',  # reads are in fasta format
        '--end-to-end --very-fast',
        '--threads',
        str(threads),
        '--all',  # report all alignments
        '--reorder',  # force SAM output order to match order of input reads
        '-S',
        outfile  # output in SAM format
    ])

    common.syscall(cmd)
def bowtie2_index(infile, outprefix=None):
    if outprefix is None:
        outprefix = infile

    if not is_bowtie2_indexed(infile):
        common.syscall('bowtie2-build ' + infile + ' ' + outprefix)
Beispiel #6
0
def bowtie2_index(infile, outprefix=None):
    if outprefix is None:
        outprefix = infile

    if not is_bowtie2_indexed(infile):
        common.syscall('bowtie2-build ' + infile + ' ' + outprefix)