-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
54 lines (46 loc) · 1.7 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# This program starts to making csv files to Gephi to display n persons weighted march graph
# You can use this enjoy your dna. If you modify, please send the modified code to me.
#
# FFtoGephi Main
# (c) Ilpo Kantonen 2020
#!/usr/bin/python
# -*- coding: latin-1 -*-
import os.path
from os import path
import sys
#import fileinput
import csv
from csv import reader
from datetime import datetime
from Kit import Kit
from MatchList import MatchList
from ForGephi import ForGephi
#-----------------------------------------------------------------------------------------------------------
#----------------------------------------- Main ------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------
i=0
if len(sys.argv) != 1:
if not os.path.isfile(sys.argv[1]):
print ("Error: Source file not exist")
exit(0)
# Set maximum drawn dna-matches to Gephi charts
ForGephi.setMax(200)
# Fresh means that it is downloaded today. Remember timezone. It makes some harm.
freshkits = []
freshkits = MatchList.getFreshMatchLists( str( sys.argv[1] ) )
ind30=0
offsetN = 0
offsetL = 0
for fresh in freshkits:
if ind30 == 0:
offsetN = ForGephi.addNames1(fresh)
offsetL = ForGephi.addLinks1(fresh)
ind30 += 1
else:
offsetN = ForGephi.addNames2(fresh,offsetN)
offsetL = ForGephi.addLinks2(fresh,offsetL)
print('Done.')
else:
print('Usage: python kits.py kits.csv')
#-----------------------------------------------------------------------------------------------------------