Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
loosolab
/
master_project_JLU2018
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
7
Pull requests
1
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
3877157
bin
1.1_footprint_extraction
1.2_filter_motifs
2.1_clustering
2.2_motif_estimation
3.1_create_gtf
Modules
Ensembl
FTPHandling
ActivityCategorizer.py
ActivityTable.py
ActivityTableGenerator.py
Ensembl.py
GTFGen.py
__init__.py
ucsc
CrossMap.py
CrossMapper.py
SaveResults.py
Uniquifier.py
Validator.py
__init__.py
config
RegGTFExtractor.py
config
.gitignore
README.md
masterenv.yml
nextflow.config
pipeline.nf
Breadcrumbs
master_project_JLU2018
/
bin
/
3.1_create_gtf
/
Modules
/
Ensembl
/
ActivityTable.py
Blame
Blame
Latest commit
History
History
81 lines (58 loc) · 2.93 KB
Breadcrumbs
master_project_JLU2018
/
bin
/
3.1_create_gtf
/
Modules
/
Ensembl
/
ActivityTable.py
Top
File metadata and controls
Code
Blame
81 lines (58 loc) · 2.93 KB
Raw
import os.path from Modules.Ensembl.ActivityTableGenerator import ATGenerator class ActivityTable: """ Class for checking activity_table and generating them. activityTable = byte Representation of activity status corresponding to the generator schema default: 0, "activity=ACTIVE", 1, "activity=POISED", 2, "activity=REPRESSED", 3, "activity=INACTIVE", 4, "activity=NA" @author: Sebastian Beyvers @contact: sebastian.beyvers@med.uni-giessen.de """ def __init__(self, organism, current_release, wd, data_dir): # Constructor for the ActivityTable-Class # input_parameter: organism = input organism # current_release = current used Ensembl release # wd = working dir (default working directory, data_dir is used if specified) # data_dir = data directory (this is used as directory if specified) if data_dir: self.link = os.path.join(data_dir + "/EnsemblData/", current_release, organism, "activity") else: self.link = os.path.join(wd + "/data/EnsemblData/", current_release, organism, "activity") self.folders = next(os.walk(self.link))[1] # List to represent Index with activitystatus for ATGenerator class self.generator = ATGenerator(["activity=ACTIVE", "activity=POISED", "activity=REPRESSED", "activity=INACTIVE", "activity=NA"]) def check_and_generate_activity_table(self): # checks if file (table.bin) already exists for celltype -> generates new one if missing for subfolder in self.folders: folder_link = os.path.join(self.link, subfolder) sf_link = os.path.join(folder_link, "table.bin") # If table.bin is missing: if not os.path.isfile(sf_link): print("No ActivityTable for "+subfolder+" found, generating new one.") self.generate_table(folder_link) # Else: Do nothing print("All ActivityTables found, proceeding") def generate_table(self, link): # generates the table and saves it as table.bin file # input_parameter: link = link to ensembl activity folder for specific celltype # generates table.bin file in link folder for root, dirs, files in os.walk(link): for file in files: if file.endswith(".gff.gz"): originpath = os.path.join(root, file) file_path = os.path.join(root, "table.bin") with open(file_path, "wb") as f: f.write(self.generator.read_table(originpath)) print("New ActivityTable generated in: " + root) # Debug # e = ActivityTable("homo_sapiens", "release-94") # e.check_and_generate_activity_table()
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
You can’t perform that action at this time.