bowtie2, and python script
0
0
Entering edit mode
23 months ago
qudrat.nii ▴ 40

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

and python bowtie2 script • 1.8k views
ADD COMMENT
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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')

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

Here is a snippet that can help you do that:

https://stackoverflow.com/questions/312443/how-do-i-split-a-list-into-equally-sized-chunks

However, you should listen to other's advices here and look into shell or workflow managers.

ADD REPLY
0
Entering edit mode
ADD REPLY

Login before adding your answer.

Traffic: 2338 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6