This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bowtie2, and python script

Hello, I am trying to do bowtie2 alignment for 100 fastq files. To run bowtie2 alignment I am trying to write a python script but I am stuck at writing ''for loop''. Please help me. Thank you

python bowtie2

A simple bash script would probably serve you better, or a Makefile. Alternatively a workflow manager such as Snakemake which is python-ish. Please show what you tried.

import subprocess folder = "/Desktop/RNA-Seq" fastq_file = [] try: for files in folder: if files.endswith('fastq'): fastq_files.append(files) subprocess.run("bowtie2 -x folder/bt2_idx -1 f1.q -2 f2.q -S f.sam") except: print('some error')

What is error you're getting here? What are the f1.q and f2.q. Also, please format your code blocks.

f1.q and f2.q is fastq file. Actually I am not able to write the script which can take pairs of files as input for bowtie2

0 answers

No answers yet.

Log in to answer this question.