Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
vidjil
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1,696
Issues
1,696
List
Boards
Labels
Service Desk
Milestones
Merge Requests
89
Merge Requests
89
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vidjil
vidjil
Commits
91adbc24
Commit
91adbc24
authored
Apr 20, 2018
by
Mathieu Giraud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
split-from-imgt.py: when gene_id is found, extract from chromosome rather than gene
Closes
#3009
? To be verified.
parent
eca46b8c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
germline/split-from-imgt.py
germline/split-from-imgt.py
+13
-5
No files found.
germline/split-from-imgt.py
View file @
91adbc24
...
...
@@ -8,7 +8,7 @@ import urllib
from
collections
import
defaultdict
,
OrderedDict
import
re
from
ncbi
import
*
import
ncbi
IMGT_LICENSE
=
'''
# To use the IMGT germline databases (IMGT/GENE-DB), you have to agree to IMGT license:
...
...
@@ -104,14 +104,22 @@ def retrieve_genes(f, genes, tag, additional_length, gene_list):
for
gene
in
genes
:
for
coord
in
genes
[
gene
]:
gene_id
=
gene_list
.
get_gene_id_from_imgt_name
(
coord
[
'species'
],
coord
[
'imgt_name'
])
print
(
coord
,
gene_id
)
if
gene_id
:
# gene_id is found, extract from chromosome
(
target
,
start
,
end
)
=
ncbi
.
get_gene_positions
(
gene_id
)
print
(
coord
,
gene_id
,
target
,
start
,
end
)
else
:
# extract from gene
target
=
gene
start
=
coord
[
'from'
]
end
=
coord
[
'to'
]
if
additional_length
>
0
:
end
+=
additional_length
elif
additional_length
<
0
:
start
=
max
(
1
,
start
+
additional_length
)
gene_data
=
get_gene_sequence
(
gene
,
coord
[
'imgt_data'
]
+
tag
,
start
,
end
)
gene_data
=
ncbi
.
get_gene_sequence
(
target
,
coord
[
'imgt_data'
]
+
tag
,
start
,
end
)
if
coord
[
'imgt_data'
].
split
(
'|'
)[
-
1
]
==
FEATURE_J_REGION
:
gene_lines
=
gene_data
.
split
(
'
\n
'
)
gene_lines
[
1
]
=
gap_j
(
gene_lines
[
1
].
lower
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment