Question: How to control BWA output?
0
gravatar for plato29
12 months ago by
plato290
plato290 wrote:

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

ADD COMMENTlink modified 11 months ago • written 12 months ago by plato290

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

ADD REPLYlink written 12 months ago by Pierre Lindenbaum130k
  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 REPLYlink written 12 months ago by Pierre Lindenbaum130k

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 REPLYlink written 12 months ago by plato290

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

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

ADD REPLYlink modified 12 months ago • written 12 months ago by Pierre Lindenbaum130k

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 REPLYlink written 11 months ago by plato290

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 REPLYlink written 11 months ago by WouterDeCoster44k

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 REPLYlink written 11 months ago by plato290

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

ADD REPLYlink written 11 months ago by WouterDeCoster44k
0
gravatar for plato29
11 months ago by
plato290
plato290 wrote:

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 COMMENTlink written 11 months ago by plato290
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1583 users visited in the last hour