<div dir="ltr">Hi there,<div><br></div><div>Again: you are running Python commands on the BASH shell. As Peter suggested before, you should copy all the Python commands to a file, call it whatever you want as long as it ends in ".py" (without quotes) and then run it with python filename.</div><div><br></div><div>I honestly suggest you read at least a basic tutorial on how to run Python programs. </div><div><br></div><div>Best,</div><div><br></div><div>João</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-06-03 11:24 GMT+02:00 Atteyet-Alla.Yassin <span dir="ltr"><<a href="mailto:Atteyet-Alla.Yassin@ukb.uni-bonn.de" target="_blank">Atteyet-Alla.Yassin@ukb.uni-bonn.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
Hallo peter I tried it but, unfortunately get the following and the
output file was blank:<br>
<br>
ukb03709@zr1005436:~/Dokumente/idiograms$ with open("CP008802.txt",
"w") as output:<br>
bash: Syntaxfehler beim unerwarteten Wort `('<br>
ukb03709@zr1005436:~/Dokumente/idiograms$
output.write("Seqname\tSource\tfeature\tStart\tEnd\tScore\tStrand\tFrame\tAttributes\n")<br>
bash: Syntaxfehler beim unerwarteten Wort
`"Seqname\tSource\tfeature\tStart\tEnd\tScore\tStrand\tFrame\tAttributes\n"'<br>
ukb03709@zr1005436:~/Dokumente/idiograms$ for record in
SeqIO.parse("CP008802.gbk", "genbank"):<br>
bash: Syntaxfehler beim unerwarteten Wort `('<br>
ukb03709@zr1005436:~/Dokumente/idiograms$ print("Converting
%s" % <a href="http://record.name" target="_blank">record.name</a>)<br>
bash: Syntaxfehler beim unerwarteten Wort `"Converting %s"'<br>
ukb03709@zr1005436:~/Dokumente/idiograms$ for f in
record.features:<br>
> if f.type != "gene":<br>
bash: Syntaxfehler beim unerwarteten Wort `if'<br>
ukb03709@zr1005436:~/Dokumente/idiograms$ continue<br>
bash: continue: nur in einer `for', `while' oder `until' Schleife
sinnvoll.<br>
ukb03709@zr1005436:~/Dokumente/idiograms$ locus_tag =
f.qualifiers["locus_tag"][0]<br>
bash: locus_tag: Kommando nicht gefunden.<br>
ukb03709@zr1005436:~/Dokumente/idiograms$ if
len(f.location.parts) > 1:<br>
bash: Syntaxfehler beim unerwarteten Wort `f.location.parts'<br>
ukb03709@zr1005436:~/Dokumente/idiograms$
print("What should we do for %s (compound location)? %s" %
(locus_tag, f.location))<br>
bash: Syntaxfehler beim unerwarteten Wort `"What should we do for %s
(compound location)? %s"'<br>
ukb03709@zr1005436:~/Dokumente/idiograms$ continue<br>
bash: continue: nur in einer `for', `while' oder `until' Schleife
sinnvoll.<br>
ukb03709@zr1005436:~/Dokumente/idiograms$
output.write('%s\tGenBank\t%s\t%i\t%i\t0,000000\t%s\t.\tlocus_tag\t"%s";
transcript_id "%s"\n'<br>
bash: Syntaxfehler beim unerwarteten Wort
`'%s\tGenBank\t%s\t%i\t%i\t0,000000\t%s\t.\tlocus_tag\t"%s";
transcript_id "%s"\n''<br>
ukb03709@zr1005436:~/Dokumente/idiograms$ %
(<a href="http://record.name" target="_blank">record.name</a>, f.type,<br>
bash: Syntaxfehler beim unerwarteten Wort `<a href="http://record.name" target="_blank">record.name</a>,'<br>
ukb03709@zr1005436:~/Dokumente/idiograms$
f.location.start + 1, f.location.end, f.location.strand,<br>
bash: f.location.start: Kommando nicht gefunden.<br>
ukb03709@zr1005436:~/Dokumente/idiograms$
locus_tag, locus_tag))<br>
bash: Syntaxfehler beim unerwarteten Wort `)'<br>
ukb03709@zr1005436:~/Dokumente/idiograms$ print("Done")<br>
<br>
<div>Am 02.06.2015 um 15:40 schrieb Peter
Cock:<br>
</div>
<blockquote type="cite">
<p><tt><font size="3">On Tue, Jun 2, 2015 at 1:02 PM,
Atteyet-Alla.Yassin<br>
</font></tt><tt><font size="3"><a href="mailto:Atteyet-Alla.Yassin@ukb.uni-bonn.de" target="_blank"><Atteyet-Alla.Yassin@ukb.uni-bonn.de></a>
wrote:<br>
</font></tt><tt><font size="3">> Hallo Peter - Hiier are
the messages. May be arised during copy and paste<br>
</font></tt><tt><font size="3">> the command you sent? I
work with a debian! Therfore please send the command<br>
</font></tt><tt><font size="3">> as attached file:<br>
</font></tt><br>
<tt><font size="3"><a href="https://gist.github.com/peterjc/bf6796adbc9e7737bff6" target="_blank">https://gist.github.com/peterjc/bf6796adbc9e7737bff6</a>
is a Python script<br>
</font></tt><tt><font size="3">to be run inside Python, not a
shell script to run at the terminal prompt.<br>
</font></tt><br>
<tt><font size="3">Download and save it as something like
genbank_to_table.py then run<br>
</font></tt><tt><font size="3">it like this:<br>
</font></tt><br>
<tt><font size="3">$ python genbank_to_table.py<br>
</font></tt><tt><font size="3">Converting CP008802<br>
</font></tt><tt><font size="3">What should we do for
FB03_00005 (compound location)? join{[0:6](-),<br>
</font></tt><tt><font size="3">[2158322:2159306](-)}<br>
</font></tt><tt><font size="3">Done<br>
</font></tt><br>
<tt><font size="3">Peter</font></tt><br>
</p>
</blockquote>
<br>
</div>
<br>_______________________________________________<br>
Biopython mailing list - <a href="mailto:Biopython@mailman.open-bio.org">Biopython@mailman.open-bio.org</a><br>
<a href="http://mailman.open-bio.org/mailman/listinfo/biopython" target="_blank">http://mailman.open-bio.org/mailman/listinfo/biopython</a><br></blockquote></div><br></div>