![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
python script modification of LSC0.2.4 ? | arthur.yxt | Bioinformatics | 0 | 06-11-2013 02:32 PM |
Error running oases_pipeline python script | InesSoriguer | Illumina/Solexa | 4 | 05-21-2013 03:10 AM |
gatk python script | m_elena_bioinfo | Bioinformatics | 7 | 11-20-2011 07:40 AM |
DEXSeq python script error message | shilez | Bioinformatics | 4 | 09-08-2011 11:55 PM |
About script to combine steps of BWA | CNVboy | Bioinformatics | 5 | 06-22-2011 07:16 AM |
![]() |
|
Thread Tools |
![]() |
#1 |
Member
Location: US Join Date: Jun 2013
Posts: 96
|
![]()
I am trying to make a python script that reads in a text file of pair end reads and then calls BWA mem on the pairs and outputs SAM files.
|
![]() |
![]() |
![]() |
#2 |
Senior Member
Location: sub-surface moon base Join Date: Apr 2013
Posts: 372
|
![]()
Why not just make it a shell script?
script.sh Code:
BWA-MEM $1 |
![]() |
![]() |
![]() |
#3 |
Devon Ryan
Location: Freiburg, Germany Join Date: Jul 2011
Posts: 3,480
|
![]()
os.system, os.popen, os.fork, etc. There are a few different ways to do that, each with their pros and cons.
Edit: As rhinoceros mentions, depending on the amount of processing you want done, this would normally performed via shell script. |
![]() |
![]() |
![]() |
#4 |
Member
Location: US Join Date: Jun 2013
Posts: 96
|
![]()
I was told specifically to make a python script because it is more stable.
|
![]() |
![]() |
![]() |
#5 |
Devon Ryan
Location: Freiburg, Germany Join Date: Jul 2011
Posts: 3,480
|
![]()
You can ignore whomever told you that, he/she doesn't have a clue.
Python is more powerful, in that you can certainly do more with it easily, but doing something simple like stitching together a pipeline is often easier to do in a shell script (that's their intended purpose). There are a lot of tools, learning which ones are most convenient for what situations are an important (and error ridden) part of the learning process. |
![]() |
![]() |
![]() |
#6 |
Member
Location: Midwest Join Date: Mar 2009
Posts: 30
|
![]()
If you have to, use subprocess package. It should work fine.
I think shell script is straightforward, and should be used, if all it does is to run a simple command. But I prefer python when the pipeline is complex. In my case, it is a little more complicated. In one of pipelines I created in python, I need to submit jobs to clusters. It is so much easier to read run configuration file, parse out sample name, create proper path, make meaningful job name in python (try it in bash script, you will know why I prefer python). However the submitted command errored out when it submitted from python, but pasted the print-out commands in terminal worked fine without any problem. I did not have time to find out a solution, so I let the python script generate a full set of shell commands with all the path, parameters, job dependencies, etc, nicely made, output to a xxxx.sh file, and run the shell script afterward. I probably did it backward, and need to do one extra step, but it did work well. I COULD have done all of it in shell script but then I am not so good at shell script, especially when it comes to text manipulation. |
![]() |
![]() |
![]() |
#7 |
Member
Location: Flagstaff, AZ Join Date: Feb 2010
Posts: 51
|
![]()
If you will have future python scripts that will use BWA, then it would be worth the time to create a python function that calls bwa. If it is a one time thing, a shell script should be fine.
|
![]() |
![]() |
![]() |
#8 |
Member
Location: Bhopal Join Date: Jul 2019
Posts: 19
|
![]()
On the off chance that you need to, use subprocess bundle. It should work fine.
I think shell content is direct, and ought to be utilized, if everything it does is to run a basic order. In any case, I lean toward python when the pipeline is intricate. For my situation, it is somewhat more entangled. In one of pipelines I made in python, I have to submit occupations to bunches. It is such a great amount of simpler to peruse run setup document, parse out example name, make appropriate way, make significant employment name in python (attempt it in slam content, you will know why I lean toward python). Anyway the submitted order errored out when it submitted from python, however glued the print-out directions in terminal worked fine with no issue. I didn't have sufficient energy to discover an answer, so I let the python content produce a full arrangement of shell directions with all the way, parameters, work conditions, and so forth, pleasantly made, yield to a xxxx.sh record, and run the shell content thereafter. I most likely did it in reverse, and need to complete one additional progression, yet it worked well. I COULD have done every last bit of it in shell content however then I am not all that great at shell content, particularly with regards to content control. I hope that was helpfu. |
![]() |
![]() |
![]() |
Thread Tools | |
|
|