Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
STR
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
Anne-Sophie Denommé-Pichon
STR
Commits
d17f9a99
Commit
d17f9a99
authored
Feb 03, 2020
by
Anne-Sophie Denommé-Pichon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create script to draw html graph to visualize STR results
parent
4e810be0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
0 deletions
+105
-0
high_normal_range_by_patho.csv
plot/high_normal_range_by_patho.csv
+29
-0
launch_triplets_plotly.sh
plot/launch_triplets_plotly.sh
+11
-0
triplets_plotly.py
plot/triplets_plotly.py
+65
-0
No files found.
plot/high_normal_range_by_patho.csv
0 → 100644
View file @
d17f9a99
Gene;High normal range
AFF2;39
AR;35
ATN1;34
ATXN1;38
ATXN10;20
ATXN2;24
ATXN3;36
ATXN7;35
ATXN8OS;34
C9ORF72;19
CACNA1A;7
CNBP;26
CSTB;3
DIP2B;NA
DMPK;37
FMR1;45
FXN;32
HTT;34
JPH3;27
NOP56;8
PHOX2B;20
PPP2R2B;45
TBP;42
TCF4;NA
BEAN/TK2;NA
DAB1;NA
SAMD12;NA
\ No newline at end of file
plot/launch_triplets_plotly.sh
0 → 100755
View file @
d17f9a99
#! /bin/sh
SCRIPT
=
"
$(
dirname
"
$(
readlink
-f
"
$0
"
)
"
)
/triplets_plotly.py"
cd
'/work/gad/shared/analyse/STR/results2020-01-09'
||
exit
1
for
locus_tsv
in
*
.tsv
;
do
locus
=
"
$(
basename
"
$locus_tsv
"
".tsv"
)
"
echo
"Processing
$locus
"
>
&2
"
$SCRIPT
"
"
$locus
"
>
"
$locus
.html"
done
plot/triplets_plotly.py
0 → 100755
View file @
d17f9a99
#! /usr/bin/env python3
### ASDP PIPELINE ###
## triplets_plotly.py
## Version : 0.0.1
## Licence : FIXME
## Description : script to get automatically graphics from expansion pipeline results from getResults.py with Plotly
## Usage :
## Output : FIXME
## Requirements : FIXME
## Author : anne-sophie.denomme-pichon@u-bourgogne.fr
## Creation Date : 20200202
## last revision date : 20200202
## Known bugs : None
import
collections
import
csv
import
os
import
sys
path
=
'/work/gad/shared/analyse/STR/results2020-01-09'
def
display_console_graph
(
title
,
data
):
print
(
title
)
for
x
,
y
in
data
:
print
(
f
'{x}
\t
{"*" * y}'
)
def
display_html_graph
(
title
,
data
):
import
plotly.graph_objects
as
go
fig
=
go
.
Figure
(
data
=
[
go
.
Bar
(
x
=
[
x
for
(
x
,
y
)
in
data
],
y
=
[
y
for
(
x
,
y
)
in
data
]
)],
layout_title_text
=
title
)
print
(
fig
.
to_html
())
def
graph_locus
(
locus
):
title
=
f
'Effectif pour chaque nombre de répétitions au locus {locus}'
with
open
(
f
'{path}{os.sep}{locus}.tsv'
)
as
result_file
:
tsvreader
=
csv
.
reader
(
result_file
,
delimiter
=
'
\t
'
)
try
:
next
(
tsvreader
)
counter
=
collections
.
Counter
()
counter
[
0
]
=
0
for
row
in
tsvreader
:
if
row
[
1
]
not
in
[
'.'
,
'nofile'
]:
for
count
in
row
[
1
]
.
split
(
','
):
counter
[
int
(
count
)]
+=
1
except
StopIteration
:
print
(
'Input file is empty'
,
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
data
=
sorted
(
counter
.
items
())
#display_console_graph(title, data)
display_html_graph
(
title
,
data
)
if
__name__
==
'__main__'
:
if
len
(
sys
.
argv
)
!=
2
:
print
(
f
'Usage: {sys.argv[0].split(os.sep)[-1]} <LOCUS>'
,
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
graph_locus
(
sys
.
argv
[
1
])
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