[Biopython] gff3 file

João Rodrigues j.p.g.l.m.rodrigues at gmail.com
Wed Jun 3 09:34:25 UTC 2015


Hi there,

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.

I honestly suggest you read at least a basic tutorial on how to run Python
programs.

Best,

João



2015-06-03 11:24 GMT+02:00 Atteyet-Alla.Yassin <
Atteyet-Alla.Yassin at ukb.uni-bonn.de>:

>  Hallo peter I tried it but, unfortunately get the following and the
> output file was blank:
>
> ukb03709 at zr1005436:~/Dokumente/idiograms$ with open("CP008802.txt", "w")
> as output:
> bash: Syntaxfehler beim unerwarteten Wort `('
> ukb03709 at zr1005436:~/Dokumente/idiograms$
> output.write("Seqname\tSource\tfeature\tStart\tEnd\tScore\tStrand\tFrame\tAttributes\n")
> bash: Syntaxfehler beim unerwarteten Wort
> `"Seqname\tSource\tfeature\tStart\tEnd\tScore\tStrand\tFrame\tAttributes\n"'
> ukb03709 at zr1005436:~/Dokumente/idiograms$     for record in
> SeqIO.parse("CP008802.gbk", "genbank"):
> bash: Syntaxfehler beim unerwarteten Wort `('
> ukb03709 at zr1005436:~/Dokumente/idiograms$         print("Converting %s" %
> record.name)
> bash: Syntaxfehler beim unerwarteten Wort `"Converting %s"'
> ukb03709 at zr1005436:~/Dokumente/idiograms$         for f in
> record.features:
> >             if f.type != "gene":
> bash: Syntaxfehler beim unerwarteten Wort `if'
> ukb03709 at zr1005436:~/Dokumente/idiograms$                 continue
> bash: continue: nur in einer `for', `while' oder `until' Schleife sinnvoll.
> ukb03709 at zr1005436:~/Dokumente/idiograms$             locus_tag =
> f.qualifiers["locus_tag"][0]
> bash: locus_tag: Kommando nicht gefunden.
> ukb03709 at zr1005436:~/Dokumente/idiograms$             if
> len(f.location.parts) > 1:
> bash: Syntaxfehler beim unerwarteten Wort `f.location.parts'
> ukb03709 at zr1005436:~/Dokumente/idiograms$                 print("What
> should we do for %s (compound location)? %s" % (locus_tag, f.location))
> bash: Syntaxfehler beim unerwarteten Wort `"What should we do for %s
> (compound location)? %s"'
> ukb03709 at zr1005436:~/Dokumente/idiograms$                 continue
> bash: continue: nur in einer `for', `while' oder `until' Schleife sinnvoll.
> ukb03709 at 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'
> 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''
> ukb03709 at zr1005436:~/Dokumente/idiograms$                          % (
> record.name, f.type,
> bash: Syntaxfehler beim unerwarteten Wort `record.name,'
> ukb03709 at zr1005436:~/Dokumente/idiograms$
> f.location.start + 1, f.location.end, f.location.strand,
> bash: f.location.start: Kommando nicht gefunden.
> ukb03709 at zr1005436:~/Dokumente/idiograms$
> locus_tag, locus_tag))
> bash: Syntaxfehler beim unerwarteten Wort `)'
> ukb03709 at zr1005436:~/Dokumente/idiograms$ print("Done")
>
> Am 02.06.2015 um 15:40 schrieb Peter Cock:
>
> On Tue, Jun 2, 2015 at 1:02 PM, Atteyet-Alla.Yassin
> <Atteyet-Alla.Yassin at ukb.uni-bonn.de>
> <Atteyet-Alla.Yassin at ukb.uni-bonn.de> wrote:
> > Hallo Peter - Hiier are the messages. May be arised during copy and paste
> > the command you sent? I work with a debian! Therfore please send the
> command
> > as attached file:
>
> https://gist.github.com/peterjc/bf6796adbc9e7737bff6 is a Python script
> to be run inside Python, not a shell script to run at the terminal prompt.
>
> Download and save it as something like genbank_to_table.py then run
> it like this:
>
> $ python genbank_to_table.py
> Converting CP008802
> What should we do for FB03_00005 (compound location)? join{[0:6](-),
> [2158322:2159306](-)}
> Done
>
> Peter
>
>
>
> _______________________________________________
> Biopython mailing list  -  Biopython at mailman.open-bio.org
> http://mailman.open-bio.org/mailman/listinfo/biopython
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20150603/9eb0ecff/attachment-0001.html>


More information about the Biopython mailing list