convert bash code to python
1
0
Entering edit mode
6.6 years ago
marghe08 ▴ 10

From terminal I launch this command to test the specificity of a pair of primers.

MFEprimer.py -i <(echo -e ">pf\nAGTTTTTGCATTCTAGTG\n>pr\nTGTTAGCAATTTCAACAG") -d human.dna --tab

How do I translate this command into python code? Thank you in advance.

python specificity primer • 1.9k views
ADD COMMENT
0
Entering edit mode

What have you tried? We generally try not to just provide code until we see that the person has made an effort.

ADD REPLY
2
Entering edit mode
6.6 years ago
Joe 21k

What exactly do you want to translate? The script itself is already a python one. Since you are providing options from the commandline, that has to be done in shell syntax, like you are doing.

You're already using a process substitution for this, so you can only really change this to read from a file instead (e.g. MFEprimer.py -i myprimers.fasta)

You could hard code the primers and files in to the script, but that is usually undesirable, since you'd have to go and edit your code every time you wanted to test new primers or a new template file. You'll have to provide the script code, or a link to the script for us to help with the coding much further though.

Its possible to modify the python script to accept strings directly from the commandline and not just expect a file though, so you'd be able to do away with the <(echo -e >pf\n...) business at least.

ADD COMMENT

Login before adding your answer.

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