Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DiseaseLabel
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bo Gao
DiseaseLabel
Commits
21d0f12c
Commit
21d0f12c
authored
Mar 8, 2017
by
Bo Gao
Browse files
Options
Downloads
Patches
Plain Diff
first verison
parents
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
diseaseLabelGenerator.py
+38
-0
38 additions, 0 deletions
diseaseLabelGenerator.py
with
38 additions
and
0 deletions
diseaseLabelGenerator.py
0 → 100644
+
38
−
0
View file @
21d0f12c
from
pymongo
import
MongoClient
import
re
## init
client
=
MongoClient
()
db
=
client
[
'
arraymap
'
]
samples
=
db
[
'
samples_copy
'
]
## disease keywords
diseases
=
{
'
fanconi
'
:
[
'
DOID:13636
'
,
'
Fanconi anemia
'
],
'
down
'
:
[
'
DOID:14250
'
,
'
Down syndrome
'
],
'
ollier
'
:
[
'
DOID:4624
'
,
'
Ollier disease
'
],
'
fraumeni
'
:
[
'
DOID:3012
'
,
'
Li-Fraumeni syndrome
'
],
'
mafucci
'
:
[
'
DOID:0060221
'
,
'
Maffuccis syndrome
'
],
'
richter
'
:
[
'
DOID:1703
'
,
'
Richter’s syndrome
'
],
'
lynch
'
:
[
'
DOID:3883
'
,
'
Lynch syndrome
'
],
'
fap
'
:
[
'
DOID:0050424
'
,
'
Familial Adenomatous Polyposis
'
],
'
neurofibromatosis
'
:
[
'
DOID:8712
'
,
'
Neurofibromatosis
'
]}
## update the database
for
k
,
v
in
diseases
.
items
():
keyword
=
k
ontology_term
=
v
[
0
]
disease_name
=
v
[
1
]
samples
.
update_many
({
'
DIAGNOSISTEXT
'
:{
'
$regex
'
:
re
.
compile
(
keyword
,
re
.
IGNORECASE
)
}},
{
'
$set
'
:
{
'
DISEASE
'
:[{
'
ONTOLOGY
'
:
ontology_term
,
'
PHENOTYPE
'
:
disease_name
}]}})
#print(samples.find({'DIAGNOSISTEXT':{'$regex': re.compile('lynch', re.IGNORECASE)}}).count())
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment