How to control BWA output?
1
0
Entering edit mode
4.6 years ago
plato29 • 0

Hi dears, i have a code like this in python:

strCommand = "./bwa index random_DNA_1000.fa"
os.system(strCommand)
strCommand = "./bwa mem random_DNA_1000.fa random_DNA_1000_8001.fq random_DNA_1000_8002.fq"
os.system(strCommand)

output of BWA MEM command contain some columns that i want filter output by "AS" column. Due to the large amount of data I can't work on the file and need to work with the stdout to speed up. Can anyone help me answer these questions? 1. How can I use BWA parameters so that the output contains only records whose field "AS" is less than one value? 2. How do I move the output of BWA to a list? (No file usage) Thanks in advance

BWA stdout python Assembly alignment • 1.7k views
ADD COMMENT
0
Entering edit mode

not an answer, but aren't you re-inventing the wheel ?

ADD REPLY
0
Entering edit mode
  1. How can I use BWA parameters so that the output contains only records whose field "AS" is less than one value?

SAM/BAM file filtering

ADD REPLY
0
Entering edit mode

Thanks for your attention. But due to the large amount of data I can't work on the file and need to work with the output of BWA directly from stdout. can i do?

ADD REPLY
0
Entering edit mode

need to work with the output of BWA directly from stdout.

https://en.wikipedia.org/wiki/Pipeline_(Unix)

ADD REPLY
0
Entering edit mode

thanks, I found a solution:

list = os.popen('./bwa mem ......').readlines()

That solved my problem, but now I just want to put a filter on the records. This means that from the record with the field "AS" less than 135, only the field that shows the "read" will be listed !

ADD REPLY
0
Entering edit mode

Due to the large amount of data I can't work on the file and need to work with the stdout to speed up.

Sooo you cannot save the file to disk but you can keep it entirely in memory without problems? That's cool.

ADD REPLY
0
Entering edit mode

Maybe I misunderstood. Since I want to work on BWA output, Working with disk will slow down. So i put the output to list.

ADD REPLY
0
Entering edit mode

Why would you do this in Python? As much as I love the language, you are not making your task easier here.

ADD REPLY
0
Entering edit mode
4.6 years ago
plato29 • 0

this is useful:

list = os.popen('./bwa mem ......').readlines()

but now I just want to put a filter on the records. This means that from the record with the field "AS" less than 135, only the field that shows the "read" will be listed ! Can anyone help me?

ADD COMMENT

Login before adding your answer.

Traffic: 1818 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