Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vihgo
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gad-public
vihgo
Commits
0243b7fc
Commit
0243b7fc
authored
Jul 29, 2020
by
Yannis Duffourd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding support for undetermined AA from codon containing N
parent
a279d9db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
10 deletions
+24
-10
Vihgo.cpp
cpp/Vihgo.cpp
+22
-10
Vihgo.h
cpp/Vihgo.h
+2
-0
No files found.
cpp/Vihgo.cpp
View file @
0243b7fc
...
...
@@ -550,7 +550,7 @@ void Vihgo::writeCodonFile( string incType )
{
string
ref
=
*
myIterD
;
string
refCodon
=
this
->
referenceCodon
[
myIterA
->
first
][
myIterB
->
first
];
string
refAA
=
this
->
codonTable
[
refCodon
]
;
string
refAA
=
this
->
getAAfromCodon
(
refCodon
)
;
int
position
=
this
->
refProtCorresp
[
ref
][
myIterB
->
first
];
double
depth
=
0.0
;
...
...
@@ -563,7 +563,7 @@ void Vihgo::writeCodonFile( string incType )
for
(
myIterC
=
(
myIterB
->
second
).
begin
()
;
myIterC
!=
(
myIterB
->
second
).
end
()
;
myIterC
++
)
{
string
altCodon
=
myIterC
->
first
;
string
altAA
=
this
->
codonTable
[
altCodon
]
;
string
altAA
=
this
->
getAAfromCodon
(
altCodon
)
;
double
altCount
=
myIterC
->
second
;
double
allelicRatio
=
(
altCount
/
depth
)
*
100
;
...
...
@@ -610,6 +610,7 @@ void Vihgo::writeCodonFile( string incType )
}
// Method to get annotation for variation
// Actually has been deactivated yet
// NEED A REWAMP FOR ADAPTATION TO ALL VIRUS; VCF FORMAT
...
...
@@ -1058,14 +1059,14 @@ int Vihgo::variantCalling()
double
altNumber
=
0.0
;
string
refCodon
=
this
->
referenceCodon
[
myIterA
->
first
][
myIterB
->
first
];
string
aa
=
codonTable
[
refCodon
]
;
string
aa
=
this
->
getAAfromCodon
(
refCodon
)
;
// cerr << "Analysing codon " << myIterA->first << ":" << myIterB->first << " ; Ref is : " << refCodon << " : " << aa << endl;
for
(
myIterC
=
(
myIterB
->
second
).
begin
()
;
myIterC
!=
(
myIterB
->
second
).
end
()
;
myIterC
++
)
{
string
currentCodon
=
myIterC
->
first
;
string
currentAa
=
codonTable
[
currentCodon
]
;
string
currentAa
=
this
->
getAAfromCodon
(
currentCodon
)
;
// cerr << "\tin control : " << currentCodon << " : " << currentAa << " : " << myIterC->second << endl;
...
...
@@ -1107,14 +1108,14 @@ int Vihgo::variantCalling()
double
altNumber
=
0.0
;
string
refCodon
=
this
->
referenceCodon
[
myIterA
->
first
][
myIterB
->
first
];
string
aa
=
codonTable
[
refCodon
]
;
string
aa
=
this
->
getAAfromCodon
(
refCodon
)
;
// cerr << "Analysing codon " << myIterA->first << ":" << myIterB->first << " ; Ref is : " << refCodon << " : " << aa << endl;
for
(
myIterC
=
(
myIterB
->
second
).
begin
()
;
myIterC
!=
(
myIterB
->
second
).
end
()
;
myIterC
++
)
{
string
currentCodon
=
myIterC
->
first
;
string
currentAa
=
codonTable
[
currentCodon
]
;
string
currentAa
=
this
->
getAAfromCodon
(
currentCodon
)
;
// cerr << "\tin sample : " << currentCodon << " : " << currentAa << " : " << myIterC->second << endl;
...
...
@@ -1240,7 +1241,7 @@ int Vihgo::variantCalling()
// result file
ofstream
outresultStream
;
outresultStream
.
open
(
(
this
->
outputFile
).
c_str
()
,
ios
::
out
);
outresultStream
<<
"#
gene
\t
chromosome
\t
gPosition
\t
AAPosition
\t
referenceCodon
\t
referenceAA
\t
variantCodon
\t
variantAA
\t
totalDepth
\t
AlternativeAlleleratio
\t
FETp-value
\t
FETbgp-value
\t
Annotation"
<<
endl
;
outresultStream
<<
"#
chromosome
\t
gPosition
\t
gene
\t
AAPosition
\t
referenceCodon
\t
referenceAA
\t
variantCodon
\t
variantAA
\t
totalDepth
\t
AlternativeAlleleratio
\t
FETp-value
\t
FETbgp-value
\t
Annotation"
<<
endl
;
// test each position
cerr
<<
"Variant calling in progress ... "
<<
endl
;
...
...
@@ -1282,11 +1283,11 @@ int Vihgo::variantCalling()
// cerr << "\t\tgetting ref informations ..." << endl;
string
refCodon
=
this
->
referenceCodon
[
myIterD
->
first
][
myIterE
->
first
];
string
aa
=
codonTable
[
refCodon
]
;
string
aa
=
this
->
getAAfromCodon
(
refCodon
)
;
// cerr << "\t\tgetting sample informations ..." << endl;
string
currentCodon
=
myIterF
->
first
;
string
currentAa
=
codonTable
[
currentCodon
]
;
string
currentAa
=
this
->
getAAfromCodon
(
currentCodon
)
;
// disengage variant calling if ref aa = alt aa (synonymous)
if
(
aa
==
currentAa
)
...
...
@@ -1923,7 +1924,18 @@ char Vihgo::getReferenceBase( string incChr , int incPos )
}
}
// method to get AA from a codon
string
Vihgo
::
getAAfromCodon
(
string
incCodon
)
{
if
(
this
->
codonTable
.
count
(
incCodon
)
>
0
)
{
return
this
->
codonTable
[
incCodon
];
}
else
{
return
"?"
;
}
}
vector
<
string
>
Vihgo
::
getAnnotationFiles
()
...
...
cpp/Vihgo.h
View file @
0243b7fc
...
...
@@ -73,6 +73,8 @@ class Vihgo
char
getBase
(
int
);
char
getReferenceBase
(
std
::
string
,
int
);
// map of codon
std
::
map
<
std
::
string
,
std
::
string
>
codonTable
;
...
...
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