convert bash code to python
Entering edit mode
4.1 years ago
marghe08 ▴ 10

From terminal I launch this command to test the specificity of a pair of primers. -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.4k views
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.

Entering edit mode
4.1 years ago
Joe 19k

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. -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.


Login before adding your answer.

Traffic: 1832 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6