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,712
Issues
1,712
List
Boards
Labels
Service Desk
Milestones
Merge Requests
87
Merge Requests
87
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
89ba9ea7
Commit
89ba9ea7
authored
Nov 10, 2016
by
Mathieu Giraud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
repseq_vdj.py: further factorization, gather V-QUEST parsing in IMGT_VQUEST_Result()
parent
e9dece6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
algo/tests/repseq_vdj.py
algo/tests/repseq_vdj.py
+20
-20
No files found.
algo/tests/repseq_vdj.py
View file @
89ba9ea7
...
...
@@ -12,20 +12,7 @@ python repseq_vdj.py data-curated/mixcr.results > data-curated/mixcr.vdj
import
sys
def
parse_gene_and_allele_to_vdj
(
s
):
'''
Parse lines such as:
Homsap IGHV3-30*03 F, or Homsap IGHV3-30*18 F or Homsap IGHV3-30-5*01 F'
and produce a .vdj line
'''
genes
=
[]
for
term
in
s
.
replace
(
','
,
''
).
split
():
if
term
in
[
'Homsap'
,
'[F]'
,
'(F)'
,
'F'
,
'P'
,
'or'
,
'and'
,
'(see'
,
'comment)'
,
'ORF'
,
'[ORF]'
]:
continue
genes
+=
[
term
]
def
genes_to_vdj
(
genes
):
if
not
genes
:
return
''
...
...
@@ -71,20 +58,20 @@ class MiXCR_Result(Result):
return
'no result'
s
=
''
s
+=
self
[
'Best V hit'
]
s
+=
genes_to_vdj
([
self
[
'Best V hit'
]])
s
+=
' '
if
self
[
'Best D hit'
]:
s
+=
N_to_vdj
(
self
[
'N. Seq. VDJunction'
])
s
+=
' '
s
+=
self
[
'Best D hit'
]
s
+=
genes_to_vdj
([
self
[
'Best D hit'
]])
s
+=
' '
s
+=
N_to_vdj
(
self
[
'N. Seq. DJJunction'
])
else
:
s
+=
N_to_vdj
(
self
[
'N. Seq. VJJunction'
])
s
+=
' '
s
+=
self
[
'Best J hit'
]
s
+=
genes_to_vdj
([
self
[
'Best J hit'
]])
s
+=
' '
s
+=
CDR3_to_vdj
(
self
[
'AA. Seq. CDR3'
])
...
...
@@ -99,17 +86,30 @@ class IMGT_VQUEST_Result(Result):
self
.
labels
=
vquest_labels
return
(
'No result'
not
in
l
)
def
parse_gene_and_allele
(
self
,
s
):
'''
Parse IMGT/V-QUEST fields such as:
Homsap IGHV3-30*03 F, or Homsap IGHV3-30*18 F or Homsap IGHV3-30-5*01 F'
'''
genes
=
[]
for
term
in
s
.
replace
(
','
,
''
).
split
():
if
term
in
[
'Homsap'
,
'[F]'
,
'(F)'
,
'F'
,
'P'
,
'or'
,
'and'
,
'(see'
,
'comment)'
,
'ORF'
,
'[ORF]'
]:
continue
genes
+=
[
term
]
return
genes
def
to_vdj
(
self
):
if
not
self
.
result
:
return
'no result'
s
=
''
s
+=
parse_gene_and_allele_to_vdj
(
self
[
'V-GENE and allele'
]
)
s
+=
genes_to_vdj
(
self
.
parse_gene_and_allele
(
self
[
'V-GENE and allele'
])
)
s
+=
' '
s
+=
parse_gene_and_allele_to_vdj
(
self
[
'D-GENE and allele'
]
)
s
+=
genes_to_vdj
(
self
.
parse_gene_and_allele
(
self
[
'D-GENE and allele'
])
)
s
+=
' '
s
+=
parse_gene_and_allele_to_vdj
(
self
[
'J-GENE and allele'
]
)
s
+=
genes_to_vdj
(
self
.
parse_gene_and_allele
(
self
[
'J-GENE and allele'
])
)
s
+=
' '
s
+=
CDR3_to_vdj
(
self
[
'AA JUNCTION'
])
...
...
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