Skip to content

Updated docs on using Entrez with Acc instead of GI - #1071

Merged
peterjc merged 7 commits into
biopython:masterfrom
StuntsPT:entrez_update
Mar 3, 2017
Merged

peterjc merged 7 commits into
biopython:masterfrom
StuntsPT:entrez_update

Conversation

@StuntsPT

@StuntsPT StuntsPT commented Mar 2, 2017

Copy link
Copy Markdown
Contributor

As of October 2016 GI identifiers are discontinued in favour of accession numbers.
This PR updated the docs to use Accession numbers instead of GIs as identifiers.

@codecov-io

codecov-io commented Mar 3, 2017 •

Copy link
Copy Markdown

Codecov Report

Merging #1071 into master will decrease coverage by -0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1071      +/-   ##
==========================================
- Coverage   80.75%   80.75%   -0.01%     
==========================================
  Files         322      322              
  Lines       49424    49424              
==========================================
- Hits        39913    39911       -2     
- Misses       9511     9513       +2
Impacted Files Coverage Δ
Bio/Entrez/init.py 48.14% <ø> (ø) ✅
Bio/Graphics/Comparative.py 97.33% <0%> (-2.67%) ❌

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 754cb90...3e8248c. Read the comment docs.

Comment thread Doc/Tutorial/chapter_entrez.tex Outdated
LOCUS EU490707 1302 bp DNA linear PLN 26-JUL-2016
DEFINITION Selenipedium aequinoctiale maturase K (matK) gene, partial cds;
chloroplast.
chloroplast.

@peterjc peterjc Mar 3, 2017 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the GitHub diff, it looks like somehow the indentation has changed, perhaps to tabs?

(This affects the entire GenBank record, including the features and sequence)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that the change was in the gb format itself so I left it there.
It is more readable with a smaller indentation, would you prefer it as it was?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, just spotted the error and the reason for it. Fixed.

Comment thread Doc/Tutorial/chapter_entrez.tex Outdated
from Bio import Entrez
Entrez.email = "[email protected]" # Always tell NCBI who you are
filename = "gi_186972394.gbk"
filename = "Acc_EU490707.gbk"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just EU490707.gbk as the filename would be fine and consistent with NCBI usage.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Changed.

Comment thread Doc/Tutorial/chapter_entrez.tex Outdated
retstart=start, retmax=batch_size,
webenv=webenv, query_key=query_key)
webenv=webenv, query_key=query_key,
idtype="acc")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, something funny with the indentation here based on the GitHub diff view.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Thanks!

Comment thread Bio/PopGen/GenePop/Controller.py Outdated
loci = {}
for entry in table:
if len(entry) < 3:
if len(entry) < 4:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it was originally intended for pul request #583 (nothing to do with the Entrez pull request)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like I messed up the branching. Sorry about that.
It's fixed now.

>>> handle = Entrez.efetch(db="nucleotide", id="186972394", rettype="gb", retmode="text")
>>> print(handle.read())
LOCUS EU490707 1302 bp DNA linear PLN 05-MAY-2008
LOCUS EU490707 1302 bp DNA linear PLN 26-JUL-2016

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've accidentally (?) lost the >>> python code here.

@StuntsPT StuntsPT Mar 3, 2017 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really have no idea how this could have happened... Many thanks for spotting it! I have put it back (the accession version, and not the GI I had replaced).

@peterjc

peterjc commented Mar 3, 2017

Copy link
Copy Markdown
Member

It looks like there are doctests in Bio/Entrez.py but because they are online they are not run via run_tests.py or run_tests.py doctest. You can run them manually using:

python Bio/Entrez.py

Right now that is failing for me, looks like some Python 3 issues needs fixing somewhere... I'm looking at this now.

@peterjc

peterjc commented Mar 3, 2017

Copy link
Copy Markdown
Member

The doctests should now be working on the master branch - see 85a7462

You can now also run the Bio.Entrez doctests via test_Entrez_online.py - see 754cb90 -- but this does not yet solve the run_tests.py route.

Are you familiar with git rebase? i.e. Are you comfortable updating your entrez_update branch with something like this (assuming you've named the remote origin and StuntsPT - adjust as needed):

git fetch origin
git rebase origin/master
# Hopefully no conflicts...
git push StuntsPT entrez_update --force

If not, don't worry - I can look at it.

@StuntsPT

StuntsPT commented Mar 3, 2017

Copy link
Copy Markdown
Contributor Author

I had never done a git rebase, just tried it, and I think it works. At least your commits are now applied to my entrez_update branch.

@StuntsPT

StuntsPT commented Mar 3, 2017

Copy link
Copy Markdown
Contributor Author

I'm getting these failures:

Doctest: Bio.Entrez ... FAIL
ecitmatch (Bio.Entrez)
Doctest: Bio.Entrez.ecitmatch ... FAIL
efetch (Bio.Entrez)
Doctest: Bio.Entrez.efetch ... ok
egquery (Bio.Entrez)
Doctest: Bio.Entrez.egquery ... FAIL
einfo (Bio.Entrez)
Doctest: Bio.Entrez.einfo ... ok
elink (Bio.Entrez)
Doctest: Bio.Entrez.elink ... ok
esearch (Bio.Entrez)
Doctest: Bio.Entrez.esearch ... FAIL
espell (Bio.Entrez)
Doctest: Bio.Entrez.espell ... ok
esummary (Bio.Entrez)
Doctest: Bio.Entrez.esummary ... FAIL

I'll try to find what went wrong and fix them.

@peterjc

peterjc commented Mar 3, 2017

Copy link
Copy Markdown
Member

Running the tests from your branch seems OK for me - you might have to explicitly install Biopython first, there's something odd with doctests sometimes - #531

@peterjc
peterjc merged commit e772215 into biopython:master Mar 3, 2017
@StuntsPT

StuntsPT commented Mar 3, 2017

Copy link
Copy Markdown
Contributor Author

Oh, good, I was getting lost trying to debug this!
What about the codecov/project failing?

@peterjc

peterjc commented Mar 3, 2017

Copy link
Copy Markdown
Member

Don't worry about the coverage change - it gives tiny fluctuations anyway.

@peterjc

peterjc commented Mar 3, 2017

Copy link
Copy Markdown
Member

Thank you - acknowledged in 48d6d31

@StuntsPT
StuntsPT deleted the entrez_update branch March 3, 2017 14:05
MarkusPiotrowski pushed a commit to MarkusPiotrowski/biopython that referenced this pull request Oct 31, 2017
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

Successfully merging this pull request may close these issues.

3 participants