<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hallo Peter,<br>
<br>
many many thanks it work now. But I have only a small problem. As
you see from the table the tabs are inconsistent with one another.
Is there a possibility to solve this problem?<br>
<br>
Seqname Source feature Start End Score Strand
Frame Attributes<br>
CP008802 GenBank gene 417 638 0,000000 1 .
locus_tag "FB03_00010"; transcript_id "FB03_00010"<br>
CP008802 GenBank gene 814 2193 0,000000 -1 .
locus_tag "FB03_00015"; transcript_id "FB03_00015"<br>
CP008802 GenBank gene 2407 3408 0,000000 -1
. locus_tag "FB03_00020"; transcript_id "FB03_00020"<br>
<br>
<div class="moz-cite-prefix">Am 03.06.2015 um 12:26 schrieb Peter
Cock:<br>
</div>
<blockquote
cite="mid:CAKVJ-_7niJi_fAhL9oDbPhasPi=h0bP22gPq20GhjUq4RqdmJw@mail.gmail.com"
type="cite">
<p><tt><font size="3">Hello again,<br>
</font></tt><br>
<tt><font size="3">You are still trying to run Python command
directly in the terminal<br>
</font></tt><tt><font size="3">shell, rather than within
Python.<br>
</font></tt><br>
<tt><font size="3">When we write "$" we general mean a command
to be typed at the<br>
</font></tt><tt><font size="3">terminal (Unix or Linux or
Mac), e.g.<br>
</font></tt><br>
<tt><font size="3">$ ls -l<br>
</font></tt><br>
<tt><font size="3">that would mean type the letters l, s, space,
minus, l, enter. This<br>
</font></tt><tt><font size="3">would give a directory listing
in long mode (one file per line).<br>
</font></tt><br>
<tt><font size="3">In this case I was suggesting you run:<br>
</font></tt><br>
<tt><font size="3">$ python genbank_to_table.py<br>
</font></tt><br>
<tt><font size="3">(having first saved the example Python script
as a file named<br>
</font></tt><tt><font size="3">genbank_to_table.py).<br>
</font></tt><br>
<tt><font size="3">As well as "$" to indicate the terminal
prompt, you will often see<br>
</font></tt><tt><font size="3">people write ">>>" to
indicate the Python prompt where you<br>
</font></tt><tt><font size="3">would type a Python command to
be run inside Python.<br>
</font></tt><br>
<tt><font size="3">Do you know anyone in your group who knows a
little Python,<br>
</font></tt><tt><font size="3">or about working at the command
line? Some in-person help<br>
</font></tt><tt><font size="3">would be best. Or an
introductory Python text book / tutorial?<br>
</font></tt><br>
<tt><font size="3">Peter<br>
</font></tt><br>
<tt><font size="3">On Wed, Jun 3, 2015 at 10:24 AM,
Atteyet-Alla.Yassin<br>
</font></tt><tt><font size="3"><a class="moz-txt-link-rfc2396E" href="mailto:Atteyet-Alla.Yassin@ukb.uni-bonn.de"><Atteyet-Alla.Yassin@ukb.uni-bonn.de></a>
wrote:<br>
</font></tt><tt><font size="3">> Hallo peter I tried it
but, unfortunately get the following and the output<br>
</font></tt><tt><font size="3">> file was blank:<br>
</font></tt><tt><font size="3">><br>
</font></tt><tt><font size="3">>
ukb03709@zr1005436:~/Dokumente/idiograms$ with
open("CP008802.txt", "w") as<br>
</font></tt><tt><font size="3">> output:<br>
</font></tt><tt><font size="3">> bash: Syntaxfehler beim
unerwarteten Wort `('<br>
</font></tt><tt><font size="3">>
ukb03709@zr1005436:~/Dokumente/idiograms$<br>
</font></tt><tt><font size="3">>
output.write("Seqname\tSource\tfeature\tStart\tEnd\tScore\tStrand\tFrame\tAttributes\n")<br>
</font></tt><tt><font size="3">> bash: Syntaxfehler beim
unerwarteten Wort<br>
</font></tt><tt><font size="3">>
`"Seqname\tSource\tfeature\tStart\tEnd\tScore\tStrand\tFrame\tAttributes\n"'<br>
</font></tt><tt><font size="3">>
ukb03709@zr1005436:~/Dokumente/idiograms$ for record in<br>
</font></tt><tt><font size="3">>
SeqIO.parse("CP008802.gbk", "genbank"):<br>
</font></tt><tt><font size="3">> bash: Syntaxfehler beim
unerwarteten Wort `('<br>
</font></tt><tt><font size="3">>
ukb03709@zr1005436:~/Dokumente/idiograms$
print("Converting %s" %<br>
</font></tt><tt><font size="3">> record.name)<br>
</font></tt><tt><font size="3">> bash: Syntaxfehler beim
unerwarteten Wort `"Converting %s"'<br>
</font></tt><tt><font size="3">>
ukb03709@zr1005436:~/Dokumente/idiograms$ for f in
record.features:<br>
</font></tt><tt><font size="3">>> if f.type
!= "gene":<br>
</font></tt><tt><font size="3">> bash: Syntaxfehler beim
unerwarteten Wort `if'<br>
</font></tt><tt><font size="3">>
ukb03709@zr1005436:~/Dokumente/idiograms$
continue<br>
</font></tt><tt><font size="3">> bash: continue: nur in
einer `for', `while' oder `until' Schleife sinnvoll.<br>
</font></tt><tt><font size="3">>
ukb03709@zr1005436:~/Dokumente/idiograms$
locus_tag =<br>
</font></tt><tt><font size="3">>
f.qualifiers["locus_tag"][0]<br>
</font></tt><tt><font size="3">> bash: locus_tag: Kommando
nicht gefunden.<br>
</font></tt><tt><font size="3">>
ukb03709@zr1005436:~/Dokumente/idiograms$ if<br>
</font></tt><tt><font size="3">> len(f.location.parts) >
1:<br>
</font></tt><tt><font size="3">> bash: Syntaxfehler beim
unerwarteten Wort `f.location.parts'<br>
</font></tt><tt><font size="3">>
ukb03709@zr1005436:~/Dokumente/idiograms$
print("What should<br>
</font></tt><tt><font size="3">> we do for %s (compound
location)? %s" % (locus_tag, f.location))<br>
</font></tt><tt><font size="3">> bash: Syntaxfehler beim
unerwarteten Wort `"What should we do for %s<br>
</font></tt><tt><font size="3">> (compound location)? %s"'<br>
</font></tt><tt><font size="3">>
ukb03709@zr1005436:~/Dokumente/idiograms$
continue<br>
</font></tt><tt><font size="3">> bash: continue: nur in
einer `for', `while' oder `until' Schleife sinnvoll.<br>
</font></tt><tt><font size="3">>
ukb03709@zr1005436:~/Dokumente/idiograms$<br>
</font></tt><tt><font size="3">>
output.write('%s\tGenBank\t%s\t%i\t%i\t0,000000\t%s\t.\tlocus_tag\t"%s";<br>
</font></tt><tt><font size="3">> transcript_id "%s"\n'<br>
</font></tt><tt><font size="3">> bash: Syntaxfehler beim
unerwarteten Wort<br>
</font></tt><tt><font size="3">>
`'%s\tGenBank\t%s\t%i\t%i\t0,000000\t%s\t.\tlocus_tag\t"%s";
transcript_id<br>
</font></tt><tt><font size="3">> "%s"\n''<br>
</font></tt><tt><font size="3">>
ukb03709@zr1005436:~/Dokumente/idiograms$
%<br>
</font></tt><tt><font size="3">> (record.name, f.type,<br>
</font></tt><tt><font size="3">> bash: Syntaxfehler beim
unerwarteten Wort `record.name,'<br>
</font></tt><tt><font size="3">>
ukb03709@zr1005436:~/Dokumente/idiograms$<br>
</font></tt><tt><font size="3">> f.location.start + 1,
f.location.end, f.location.strand,<br>
</font></tt><tt><font size="3">> bash: f.location.start:
Kommando nicht gefunden.<br>
</font></tt><tt><font size="3">>
ukb03709@zr1005436:~/Dokumente/idiograms$<br>
</font></tt><tt><font size="3">> locus_tag, locus_tag))<br>
</font></tt><tt><font size="3">> bash: Syntaxfehler beim
unerwarteten Wort `)'<br>
</font></tt><tt><font size="3">>
ukb03709@zr1005436:~/Dokumente/idiograms$ print("Done")<br>
</font></tt><tt><font size="3">><br>
</font></tt><tt><font size="3">> Am 02.06.2015 um 15:40
schrieb Peter Cock:<br>
</font></tt><tt><font size="3">><br>
</font></tt><tt><font size="3">> On Tue, Jun 2, 2015 at
1:02 PM, Atteyet-Alla.Yassin<br>
</font></tt><tt><font size="3">>
<a class="moz-txt-link-rfc2396E" href="mailto:Atteyet-Alla.Yassin@ukb.uni-bonn.de"><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<br>
</font></tt><tt><font size="3">>> command<br>
</font></tt><tt><font size="3">>> as attached file:<br>
</font></tt><tt><font size="3">><br>
</font></tt><tt><font size="3">> <a moz-do-not-send="true"
href="https://gist.github.com/peterjc/bf6796adbc9e7737bff6">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><tt><font size="3">><br>
</font></tt><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><tt><font size="3">><br>
</font></tt><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><tt><font size="3">><br>
</font></tt><tt><font size="3">> Peter<br>
</font></tt><tt><font size="3">><br>
</font></tt><tt><font size="3">><br>
</font></tt><tt><font size="3">><br>
</font></tt><tt><font size="3">>
_______________________________________________<br>
</font></tt><tt><font size="3">> Biopython mailing list -
<a class="moz-txt-link-abbreviated" href="mailto:Biopython@mailman.open-bio.org">Biopython@mailman.open-bio.org</a><br>
</font></tt><tt><font size="3">> <a moz-do-not-send="true"
href="http://mailman.open-bio.org/mailman/listinfo/biopython">http://mailman.open-bio.org/mailman/listinfo/biopython</a></font></tt><br>
</p>
</blockquote>
<br>
</body>
</html>