Courtenay Godshall | 24 Jun 16:21 2015

[Biopython] ANN: Last Call for SciPy 2015 Registration (Scientific Python Conference - July 8-10)

Last Call to Register for
SciPy 2015!

Main conference July 8-10, tutorials July 6-7 & coding sprints July 11-12!

Here are just a few reasons you don't want to miss this year's SciPy Conference (Online registration closes 7/3/15):

  1. 2 full days of 90 talks + 40 posters on topics specific to Python for science, engineering, and data analysis you won't hear anywhere else.See the full list of talks and posters here.

  2. Meet and talk with over 500 attendees representing diverse backgrounds and industries, gathering to share their Python experience and learn from each other.

  3. Incredible keynote speakers: hear from Wes McKinney, author of Pandas; Chris Wiggins, Chief Data Scientist for The New York Times; and Jake VanderPlas, director of research at the University of Washington's eScience Institute and core contributor to a number of scientific Python libraries including sci-kit learn and AstroML.

  4. Great social events to network and get to know other attendees, including a riverboat cruise on Lady Bird Lake, diversity luncheon, annual reception, and conference kick-off reception.

  5. Attend tutorials from major community contributors. Seats are still available for Software Carpentry, Machine Learning with Sci-Kit Learn (2nd session opened due to massive demand), Manipulating Numerical Data with NumPy, Image Analysis with Sci-Kit Image, Modern Optimization Methods in Python, and more. See tutorial details and the full schedule here.

  6. Participate in coding sprints: Over 200 community members from core developers to Python newcomers will work together to contribute to projects and code during the SciPy sprints. You can make a huge contribution and sharpen your skills at the same time.
_______________________________________________
Biopython mailing list  -  Biopython <at> mailman.open-bio.org
http://mailman.open-bio.org/mailman/listinfo/biopython
Ian Stavros | 24 Jun 16:39 2015
Picon

[Biopython] Melting Point.TM_NN calculation

Hello,

 

My name is Ian and I am new to the bioinformatics world. I am using the biopython's melting temp TM_NN algorithm to calculate the melting temp differences in wild type sequence with the complementary mutation sequence, using the the the Allawi and SantaLucia (1997), Biochemistry 36: 10581-10594 table. I have attached a small output of the sample program for better understanding, which shows the Key Error I am getting and other times I will get a Value Error, meaning it can find the key but can't find the value, I was wondering if

A) if there is something else out there better suited for this problem

B) if I need to update the table or something to get working and if so how would I go about improving the dictionary being used to address the problems which can be seen here


/Library/Python/2.7/site-packages/Bio/SeqUtils/MeltingTemp.py:931: BiopythonWarning: no data for neighbors 'AT/AG'. Calculation will be wrong
  BiopythonWarning)


Here is the output of the code. I think that the '.' may be equivalent to the regex expression of '.' meaning it could be any character in front of the G. But as you can see it is not a problem for the one up above. 


seq:  ['G', 'A', 'T']
Mutation c_seq:  ['C', 'C', 'A']
/Library/Python/2.7/site-packages/Bio/SeqUtils/MeltingTemp.py:931: BiopythonWarning: no data for neighbors 'AT/AG'. Calculation will be wrong
  BiopythonWarning)
TM:  -262.480685148
seq:  ['G', 'A', 'T', 'A']
Mutation c_seq:  ['C', 'C', 'A', 'T']
Traceback (most recent call last):
  File "PrimerBuilder.py", line 333, in <module>
    switchList = switchBuilder(middle,basepairs,mutation)
  File "PrimerBuilder.py", line 56, in switchBuilder
    tmMismatch = mt.Tm_NN(switch,strict=False,c_seq=mutation,nn_table=mt.DNA_NN3)
  File "/Library/Python/2.7/site-packages/Bio/SeqUtils/MeltingTemp.py", line 856, in Tm_NN
    deltaH += de_table[right_de][dH]
KeyError: '.G/AT'

_______________________________________________
Biopython mailing list  -  Biopython <at> mailman.open-bio.org
http://mailman.open-bio.org/mailman/listinfo/biopython
Lior Glick | 16 Jun 09:35 2015
Picon
Picon

[Biopython] Mapping positions in a pairwise alignment

Hi all,

I have a pairwise alignment of protein sequences, created with Bio.pairwise2, something like this:

C-GGLK-GAPFLAC |||||||||||||| CHG--KTGASFLQC
I would like to know which position in the subject sequence is aligned to which position in the query sequence. In this example if the top sequence is the subject than I would like to know that position 1 in subject is aligned to position 1 in query, 2 is aligned to 3, 5 to 4, 6 to 6 etc...

Does Biopython have this functionality, or do I have to write my own function? Any suggestions?

Thanks!





_______________________________________________
Biopython mailing list  -  Biopython <at> mailman.open-bio.org
http://mailman.open-bio.org/mailman/listinfo/biopython
D. Bradley | 12 Jun 17:52 2015
Picon
Picon

[Biopython] Parsing text output of hmmsearch from HMMER 3.1b1

Hello,

I am trying to parse a text output file from HMMER vesion 3.1b1; the 
file was produced using the following command:

* hmmsearch Pkinase.hmm H_sapiens.fasta.gz > PKhits.out

In BioPython, I have tried to begin parsing this file by issuing the 
following commands:

* from Bio import SearchIO
* hmmer_qresult = SearchIO.read('PKhits.out', 'hmmer3-text')

However, an error is produced and I get the following output:

"qid = regx.group(1).strip()"
"AttributeError: 'NoneType' object has no attribute 'group'"

I do not know what the problem is. I am a beginner bioinformatician and 
this is actually the first time I've tried to parse anything, so maybe 
the error is simply in my understanding. However, from a quick web 
search, somebody else seems to have had a similar problem 
(http://permalink.gmane.org/gmane.comp.python.bio.general/8027).

Any help would be greatly appreciated; I can send my output file 
straight away upon request.

Best regards,

David Bradley (PhD student)

_______________________________________________
Biopython mailing list  -  Biopython <at> mailman.open-bio.org
http://mailman.open-bio.org/mailman/listinfo/biopython

Michael Gruenstaeudl | 9 Jun 15:37 2015
Picon

[Biopython] Maintaining partition order in concatenated nexus

Hi all,
like many others, I have been using the excellent example on the Biopython wiki to concatenate multiple alignments into one nexus-file using Biopython's Nexus.combine() function. However, what if I wish to maintain the order of the nexus-partitions specified in 'file_list'. While the tuple 'nexi' is still ordered according to 'file_list', 'combined.charsets.items()' is not. Moreover, sorting the charsets is not possible:

>>> combined.charsets.items()[0]
('partition0038_rps4_CDS.nex', [36567, 36568])

>>> combined.charsets.items()[1]
('partition0004_trnK_CDS.nex', [36569, 36573])

>>> for i in range(0,len(combined.charsets.items())):
...     combined.charsets.items()[i] = sorted_items[i]
...
>>> combined.charsets.items()[0]
('partition0038_rps4_CDS.nex', [36567, 36568])

What procedure would you recommend to maintain the input order of 'file_list' in the output file 'combined.nex'?

Thank you, Michael

--
Michael Gruenstaeudl (Grünstäudl), PhD
_______________________________________________
Biopython mailing list  -  Biopython <at> mailman.open-bio.org
http://mailman.open-bio.org/mailman/listinfo/biopython
Atteyet-Alla.Yassin | 9 Jun 13:25 2015
Picon

[Biopython] Python mini-course lesson two: dealing with errors

Hi Martin, concerning the first and second lessons both worked well. But I have question to lesson 2. The error message you told look like:

$ python error.py
  File "error.py", line 1
   print(Hello world)
                    ^
SyntaxError: invalid syntax

what I received look like this one:


  File "<stdin>", line 1
   print(Hello world)
                    ^
SyntaxError: invalid syntax

is there a difference etween the two mesaages or they are the same?

thanks.

_______________________________________________
Biopython mailing list  -  Biopython <at> mailman.open-bio.org
http://mailman.open-bio.org/mailman/listinfo/biopython
Atteyet-Alla.Yassin | 8 Jun 16:09 2015
Picon

[Biopython] Python mini-course

Hallo Martin, I got this error when I tried to print Hello world. How I 
can solve this bash problem.

ukb03709 <at> zr1005436:~$ cd Dokumente/idiograms/
ukb03709 <at> zr1005436:~/Dokumente/idiograms$ ls *.py
bio_import_seq.py    hallo_welt.py       my_first_program.py
genbank_to_table.py  iterating.py        parse-gff3.py
gffexaminer.py       limitingfeature.py  parse.py
ukb03709 <at> zr1005436:~/Dokumente/idiograms$ print("Hello world")
bash: Syntaxfehler beim unerwarteten Wort `"Hello world"'
ukb03709 <at> zr1005436:~/Dokumente/idiograms$ python print("Hello world")
bash: Syntaxfehler beim unerwarteten Wort `('
ukb03709 <at> zr1005436:~/Dokumente/idiograms$ python my_first_program.py
Hallon world!
ukb03709 <at> zr1005436:~/Dokumente/idiograms$ python print ("Hello world")
bash: Syntaxfehler beim unerwarteten Wort `('
ukb03709 <at> zr1005436:~/Dokumente/idiograms$
_______________________________________________
Biopython mailing list  -  Biopython <at> mailman.open-bio.org
http://mailman.open-bio.org/mailman/listinfo/biopython

Garrett Z. Carver | 4 Jun 23:40 2015

[Biopython] Question on Entrez.efetch and Full XML Articles

Hello everyone,

I'm trying to use Entrez.efetch to download full articles in xml format from PubMed Central. I am trying to download many articles in batches by keeping retmax constant and incrementing retstart. However, for each call to efetch, only one article is downloaded. The format seems to be correct and I am getting a full article, but am unable to retrieve more than one per function call. 

Here is a snippet from my code:

        try:
            fetch_handle = Entrez.efetch(db = "pmc", rettype = "", retmode="xml", retstart=start, retmax=end,webenv = searchResults["WebEnv"], query_key = searchResults["QueryKey"])
        except urllib2.HTTPError as e:
            print(e)
            time.sleep(1.0/3.0)
            continue
        data = fetch_handle.read()
fetch_handle.close()

The data is then saved to a file on my desktop. This code worked well when modified to work with abstracts alone, downloading multiple abstracts with each efetch call.

Any insight into this issue would be greatly appreciated. Please let me know if you need more info to evaluate the problem.

Thanks,
Garrett
_______________________________________________
Biopython mailing list  -  Biopython <at> mailman.open-bio.org
http://mailman.open-bio.org/mailman/listinfo/biopython
Atteyet-Alla.Yassin | 3 Jun 14:58 2015
Picon

[Biopython] gff3file

I hope that is now right. I obtained the following erreor

 >>> from Bio import SeqIO
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
ImportError: No module named 'Bio'
 >>> with open("CP008802.out", "w") as output:
... 
output.write("Seqname\tSource\tfeature\tStart\tEnd\tScore\tStrand\tFrame\tAttributes\n")
...     for record in SeqIO.parse("CP008802.txt", "genbank"):
...         print("Converting %s" % record.name)
...         for f in record.features:
...             if f.type != "gene":
...                 continue
...             locus_tag = f.qualifiers["locus_tag"][0]
...             if len(f.location.parts) > 1:
...                 print("What should we do for %s (compound location)? 
%s" % (locus_tag, f.location))
...                 continue
... 
output.write('%s\tGenBank\t%s\t%i\t%i\t0,000000\t%s\t.\tlocus_tag\t"%s"; 
transcript_id "%s"\n'
...                          % (record.name, f.type,
...                             f.location.start + 1, f.location.end, 
f.location.strand,
...                             locus_tag, locus_tag))
... print("Done")

_______________________________________________
Biopython mailing list  -  Biopython <at> mailman.open-bio.org
http://mailman.open-bio.org/mailman/listinfo/biopython

Atteyet-Alla.Yassin | 3 Jun 11:24 2015
Picon

Re: [Biopython] gff3 file

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> 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
Atteyet-Alla.Yassin | 2 Jun 14:02 2015
Picon

[Biopython] gff3 file

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:

ukb03709 <at> zr1005436:~/Dokumente/idiograms$ from Bio import SeqIO
from: can't read /var/mail/Bio
ukb03709 <at> zr1005436:~/Dokumente/idiograms$ with open("bac.out", "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("bac.txt", "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)?\n%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";\ntranscript_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,
bash: f.location.start: Kommando nicht gefunden.
ukb03709 <at> zr1005436:~/Dokumente/idiograms$ f.location.strand,
bash: f.location.strand,: Kommando nicht gefunden.
ukb03709 <at> zr1005436:~/Dokumente/idiograms$ locus_tag, locus_tag))
bash: Syntaxfehler beim unerwarteten Wort `)'
ukb03709 <at> zr1005436:~/Dokumente/idiograms$ print("Done")
bash: Syntaxfehler beim unerwarteten Wort `"Done"'
ukb03709 <at> zr1005436:~/Dokumente/idiograms$

_______________________________________________
Biopython mailing list  -  Biopython <at> mailman.open-bio.org
http://mailman.open-bio.org/mailman/listinfo/biopython


Gmane