Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation updates please #27

Open
jbrelsf2-nmdp opened this issue Sep 26, 2019 · 1 comment
Open

Documentation updates please #27

jbrelsf2-nmdp opened this issue Sep 26, 2019 · 1 comment

Comments

@jbrelsf2-nmdp
Copy link
Contributor

jbrelsf2-nmdp commented Sep 26, 2019

Using the docs: https://pygfe.readthedocs.io/en/latest/readme.html I'm unable to run through the example code.

Building and running in local python 3.7 env.

from Bio import SeqIO
from BioSQL import BioSeqDatabase
from seqann.sequence_annotation import BioSeqAnn
import pygfe
seq_file = 'DQB1_gen.fasta'
gfe = pygfe.pyGFE()
server = BioSeqDatabase.open_database(driver="pymysql", user="root", passwd="my-secret-pw", host="localhost", db="bioseqdb")
seqann = BioSeqAnn(server=server)
seq_rec = list(SeqIO.parse(seq_file, 'fasta'))[0]
annotation = seqann.annotate(seq_rec, "HLA-DQB1")
#gfe = gfe.gfe_create("HLA-DQB1", "DQB1_gen.fasta", '3220_DQB1')
gfe = gfe.sequence_lookup("HLA-DQB1", "DQB1_gen.fasta", '3220_DQB1')
print(gfe)

Error:

Traceback (most recent call last):
  File "run-sample.py", line 12, in <module>
    gfe = gfe.sequence_lookup("HLA-DQB1", "DQB1_gen.fasta", '3220_DQB1')
  File "/Users/jbrelsf2/Documents/sandbox/pyGFE/pygfe/pygfe.py", line 357, in sequence_lookup
    sequence_data = self.graph.run(lookup_query).to_data_frame()
AttributeError: 'NoneType' object has no attribute 'run'
@mhalagan
Copy link
Contributor

It looks like that's an outdated example. The documentation for this package is pretty terrible. In order for this example to work, you need to initalize the pygfe class with a py2neo Graph object (ex. pygfe.pyGFE(graph=graph)). If you initialize BioSeqAnnwith a server, then you need to make sure that server is running locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants