Comments (7)
Greetings,
Looks like there is a floating NULL character(s) within the bioconcepts2pubtator_offsets.gz
file. This is causing the csv module to throw an error. Not sure if this is a version issue or a file reader issue, but a quick fix is to replace the following line of code in pubtator_to_xml.py script:
annts = csv.DictReader(lines[2:], fieldnames=['pubmed_id', 'start', 'end', 'term', 'type', 'tag_id'], delimiter="\t", quoting=csv.QUOTE_NONE)
with
fixed_lines = [str_with_null.replace('\x00', '') for str_with_null in lines[2:]]
annts = csv.DictReader(fixed_lines, fieldnames=['pubmed_id', 'start', 'end', 'term', 'type', 'tag_id'], delimiter="\t", quoting=csv.QUOTE_NONE)
This fix assumes that the null byte comes at the end of the line. If error occurs again, will look into other possible solutions.
from pubtator.
from pubtator.
Take a look at the extract_tags.py
script. This script is designed to extract tags from the pubtator xml file. Command to use is:
python scripts/extract_tags.py \
--input data/pubtator-docs.xml.xz \
--output data/pubtator-tags.tsv.xz
Once the process has finished you can easily count the frequency of tags.
from pubtator.
from pubtator.
You mean the tag extraction part correct? Currently, we don't have a pure text parser implemented. We were only concerned with extracting tags solely from pubtator; however, this doesn't erase the possibility of an extension.
from pubtator.
from pubtator.
Should be pretty straight forward looking at the function within the extract_tags.py
script. All it does is open the compressed file then has the etree package do the parsing. In your case you won't need/have access to the etree library as it is specifically designed to parse xml like tags. Instead you will just handle the raw text and parse it based on your situational needs.
ii) identify relationships between entities.
I want to clarify that this project is only designed to identify tags. It doesn't have the capability to detect relationship between entities. You'd have to look at other places for that kind of detection or do a manual inspection of the results.
from pubtator.
Related Issues (13)
- Migrate greenelab/snorkeling#11 to this repo HOT 2
- Hetnet IDs for Disease/Compound IDs HOT 4
- Compound conversion to DrugBank / Hetionet IDs
- Modify execute.sh to only download missing/incomplete files? HOT 11
- Tutorial for its usage HOT 29
- bioconcepts2pubtatorcentral.offset.gz not available any more HOT 3
- Modify PubTator example file to have more diverse/tricky documents HOT 1
- Error while starting pubtator locally HOT 1
- Unspecified numpy version breaks execute.py HOT 1
- Process and upload the complete pubtator catalog HOT 5
- Move .py files out of data HOT 1
- Consider itertools.groupby for a slick refactoring HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pubtator.