Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arraymapVariant-callsMapping
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
arraymapVariant-callsMapping
Commits
e6bc9ee6
Commit
e6bc9ee6
authored
May 16, 2017
by
Bo Gao
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://gitlab.isb-sib.ch/bgao/arraymapVariant-callsMapping
merge
parents
2b1b8fdb
d0c68856
Branches
Branches containing commit
Tags
1.2.1
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
arraymap2ga4gh.py
+19
-10
19 additions, 10 deletions
arraymap2ga4gh.py
with
19 additions
and
10 deletions
arraymap2ga4gh.py
+
19
−
10
View file @
e6bc9ee6
...
...
@@ -66,6 +66,7 @@ def cli(input_db, input_collection, output_db, output_collection_individuals, ou
callsets
=
{}
variants
=
{}
variantset_id
=
'
AM_VS_HG18
'
# counter for demo mode
sampleno
=
1
...
...
@@ -88,9 +89,6 @@ def cli(input_db, input_collection, output_db, output_collection_individuals, ou
varid
=
1
callno
=
0
########################################
# return the number of processed samples
########################################
...
...
@@ -205,9 +203,9 @@ def cli(input_db, input_collection, output_db, output_collection_individuals, ou
###########################################################
#only samples with enough attributes are assumed to be valid, the threshold is set to 50 arbitrarily.
# MODI: reduce threshold to
25
# MODI: reduce threshold to
30
# TODO: check & discuss => ?!
if
(
len
(
sample
)
>
25
):
if
(
len
(
sample
)
>
30
):
no_validSamples
+=
1
# generate ids
...
...
@@ -246,6 +244,21 @@ def cli(input_db, input_collection, output_db, output_collection_individuals, ou
# TODO: fixing country names should be in an external cleanup script
country
=
string
.
capwords
(
get_attribute
(
'
COUNTRY
'
,
sample
))
country
=
re
.
sub
(
'
USA
'
,
'
United States
'
,
country
,
flags
=
re
.
IGNORECASE
)
countryMatchObj
=
re
.
search
(
'
\w
'
,
country
)
city
=
string
.
capwords
(
get_attribute
(
'
CITY
'
,
sample
))
cityMatchObj
=
re
.
search
(
'
\w
'
,
city
)
geoLabel
=
''
geoPrecision
=
''
if
cityMatchObj
:
geoLabel
=
city
geoPrecision
=
'
city
'
if
countryMatchObj
:
geoLabel
=
geoLabel
+
'
,
'
+
country
elif
countryMatchObj
:
geoLabel
=
country
geoPrecision
=
'
country
'
biosamples
[
biosample_id
]
=
{
...
...
@@ -285,13 +298,9 @@ def cli(input_db, input_collection, output_db, output_collection_individuals, ou
'
individual_id
'
:
individual_id
,
'
individual_age_at_collection
'
:
get_attribute
(
'
AGEISO
'
,
sample
),
'
external_identifiers
'
:
external_ids
,
'
location
'
:
{
'
geo_label
'
:
geoLabel
,
'
geo_precision
'
:
geoPrecision
,
'
latitude
'
:
get_attribute
(
'
GEOLAT
'
,
sample
,
'
float
'
,
''
),
'
longitude
'
:
get_attribute
(
'
GEOLONG
'
,
sample
,
'
float
'
,
''
)
},
'
attributes
'
:
{
'
geo_lat
'
:
{
'
values
'
:
[
{
'
double_value
'
:
(
get_attribute
(
'
GEOLAT
'
,
sample
,
'
float
'
,
''
))
}
]
},
'
geo_long
'
:
{
'
values
'
:
[
{
'
double_value
'
:
(
get_attribute
(
'
GEOLONG
'
,
sample
,
'
float
'
,
''
))
}
]
},
'
tnm
'
:
{
'
values
'
:
[
{
'
string_value
'
:
get_attribute
(
'
TNM
'
,
sample
)
}
]
},
# 'age': { 'values': [ { 'double_value': (get_attribute('AGE', sample, 'float', '')) } ] },
'
city
'
:
{
'
values
'
:
[
{
'
string_value
'
:
get_attribute
(
'
CITY
'
,
sample
)
}
]
},
'
country
'
:
{
'
values
'
:
[
{
'
string_value
'
:
country
}
]
},
'
death
'
:
{
'
values
'
:
[
{
'
string_value
'
:
get_attribute
(
'
DEATH
'
,
sample
)
}
]
},
'
followup_months
'
:
{
'
values
'
:
[
{
'
double_value
'
:
(
get_attribute
(
'
FOLLOWUP
'
,
sample
,
'
float
'
,
''
))
}
]
},
'
redirected_to
'
:
'
null
'
...
...
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