Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Ludovic PLATON
/
IRSOM
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Ludovic PLATON
2018-03-22 23:58:20 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3875beabf665e177a19dc84783baa29e0a47dd50
3875beab
1 parent
7431e16e
Add new feature element in Featurer, remove KMER6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
35 deletions
Featurer/feature.cpp
Featurer/feature.h
Featurer/main.cpp
Featurer/feature.cpp
View file @
3875bea
This diff is collapsed. Click to expand it.
Featurer/feature.h
View file @
3875bea
...
...
@@ -10,10 +10,10 @@
#include "data/data_basic.h"
namespace
feature
{
class
Feature
:
public
data
::
Data_basic
{
protected
:
class
Feature
:
public
data
::
Data_basic
{
protected
:
virtual
void
init
(
const
Data_basic
*
db
);
public
:
public
:
static
const
std
::
string
TYPE
;
static
const
std
::
string
ENTRY_TYPE
;
...
...
@@ -29,15 +29,15 @@ namespace feature{
}
virtual
data
::
Data_basic
*
clone
()
=
0
;
std
::
string
getEntry_name
()
const
;
};
};
class
SeqLength
:
public
feature
::
Feature
{
protected
:
class
SeqLength
:
public
feature
::
Feature
{
protected
:
int
l
;
void
init
(
const
Data_basic
*
db
);
public
:
public
:
static
const
std
::
string
TYPE
;
static
const
std
::
string
ENTRY_TYPE
;
...
...
@@ -58,16 +58,16 @@ namespace feature{
std
::
string
getID
(){
return
this
->
TYPE
;
}
};
};
class
Kmer
:
public
feature
::
Feature
{
protected
:
class
Kmer
:
public
feature
::
Feature
{
protected
:
unsigned
int
k
;
std
::
unordered_map
<
std
::
string
,
float
>
kmer
;
void
init
(
const
Data_basic
*
db
);
public
:
public
:
static
const
std
::
string
TYPE
;
static
const
std
::
string
ENTRY_TYPE
;
...
...
@@ -90,22 +90,27 @@ namespace feature{
std
::
string
getID
(){
return
this
->
TYPE
;
}
};
};
class
ORF
:
public
feature
::
Feature
{
protected
:
class
ORF
:
public
feature
::
Feature
{
protected
:
static
const
std
::
vector
<
std
::
string
>
START
;
static
const
std
::
vector
<
std
::
string
>
END
;
static
bool
in_start
(
const
std
::
string
&
c
);
static
bool
in_end
(
const
std
::
string
&
c
);
unsigned
int
length
;
float
coverage
;
float
start_mean
;
float
start_std
;
float
end_mean
;
float
end_std
;
/*
float start_center, start_std;
float end_center, end_std;
*/
void
init
(
const
Data_basic
*
db
);
public
:
public
:
static
const
std
::
string
TYPE
;
static
const
std
::
string
ENTRY_TYPE
;
...
...
@@ -134,26 +139,30 @@ namespace feature{
float
getEnd_std
()
const
;
unsigned
int
getMax_length
()
const
;
unsigned
int
getLength
()
const
;
};
};
class
CodonPosition
:
public
feature
::
Feature
{
protected
:
float
position
[
4
];
class
CodonBiases
:
public
feature
::
Feature
{
protected
:
float
position
[
4
]
=
{
0
,
0
,
0
,
0
};
float
composition
[
4
]
=
{
0
,
0
,
0
,
0
};
void
init
(
const
Data_basic
*
db
);
public
:
public
:
static
const
std
::
string
TYPE
;
static
const
std
::
string
ENTRY_TYPE
;
static
callable
::
Callable
<
data
::
Data_basic
*
,
data
::
Data_basic
*>
*
get_callable
();
~
CodonPosition
(){}
CodonPosition
(
const
entry
::
Sequence
&
s
);
CodonPosition
(
const
std
::
string
&
name
,
const
float
(
&
position
)[
4
])
:
~
CodonBiases
();
CodonBiases
(
const
entry
::
Sequence
&
s
);
CodonBiases
(
const
std
::
string
&
name
,
const
float
(
&
position
)[
4
],
const
float
(
&
composition
)[
4
])
:
feature
::
Feature
(
name
){
std
::
copy
(
std
::
begin
(
position
),
std
::
end
(
position
),
std
::
begin
(
this
->
position
));
std
::
copy
(
std
::
begin
(
composition
),
std
::
end
(
composition
),
std
::
begin
(
this
->
composition
));
}
CodonPosition
(
const
data
::
Data_basic
*
db
)
:
feature
::
Feature
(
db
){
this
->
init
(
db
);}
CodonBiases
(
const
data
::
Data_basic
*
db
)
:
feature
::
Feature
(
db
){
this
->
init
(
db
);}
const
float
*
getPosition
();
...
...
@@ -164,7 +173,7 @@ namespace feature{
std
::
string
getID
(){
return
this
->
TYPE
;
}
};
};
}
#endif // FEATURE_H
...
...
Featurer/main.cpp
View file @
3875bea
...
...
@@ -57,10 +57,10 @@ int main(int argc, char* argv[])
ds
[
"KMER3"
]
=
tmp_ds
;
create_feature_maker
(
kmer
,
feature
::
Kmer
::
TYPE
+
std
::
to_string
(
6
),
tmp_ds
,
&
re
);
kmer
=
static_cast
<
feature
::
Feature_callable
*>
(
feature
::
Kmer
::
get_callable
(
6
));
tmp_ds
=
new
data
::
Data_Store_Map
(
output
+
"KMER6.txt"
);
ds
[
"KMER6"
]
=
tmp_ds
;
create_feature_maker
(
kmer
,
feature
::
Kmer
::
TYPE
+
std
::
to_string
(
6
),
tmp_ds
,
&
re
);
//
kmer = static_cast<feature::Feature_callable*>(feature::Kmer::get_callable(6));
//
tmp_ds = new data::Data_Store_Map(output+"KMER6.txt");
//
ds["KMER6"] = tmp_ds;
//
create_feature_maker(kmer,feature::Kmer::TYPE+std::to_string(6),tmp_ds,&re);
/* *********** ORF *********************/
/* ORF callable */
...
...
@@ -70,12 +70,12 @@ int main(int argc, char* argv[])
ds
[
"ORF"
]
=
tmp_ds
;
create_feature_maker
(
orf
,
feature
::
ORF
::
TYPE
,
tmp_ds
,
&
re
);
/* *********** Codon
Position
***************/
/* *********** Codon
Biases
***************/
feature
::
Feature_callable
*
c
p
=
static_cast
<
feature
::
Feature_callable
*>
(
feature
::
CodonPosition
::
get_callable
());
tmp_ds
=
new
data
::
Data_Store_Map
(
output
+
"C
P
.txt"
);
ds
[
"C
P
"
]
=
tmp_ds
;
create_feature_maker
(
c
p
,
feature
::
CodonPosition
::
TYPE
,
tmp_ds
,
&
re
);
feature
::
Feature_callable
*
c
b
=
static_cast
<
feature
::
Feature_callable
*>
(
feature
::
CodonBiases
::
get_callable
());
tmp_ds
=
new
data
::
Data_Store_Map
(
output
+
"C
B
.txt"
);
ds
[
"C
B
"
]
=
tmp_ds
;
create_feature_maker
(
c
b
,
feature
::
CodonBiases
::
TYPE
,
tmp_ds
,
&
re
);
/* *********** Fasta reader *************/
...
...
Please
register
or
login
to post a comment