Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IBD-Analysis
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Harald RINGBAUER
IBD-Analysis
Commits
cf37d9a4
Commit
cf37d9a4
authored
May 04, 2016
by
Harald RINGBAUER
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload new file
parent
ea8a8849
Pipeline
#30
skipped
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
blockpiece.py
blockpiece.py
+38
-0
No files found.
blockpiece.py
0 → 100644
View file @
cf37d9a4
'''
Created on 27.01.2015
The class for the pieces of blocks. Basically just the relevant attributes
@author: hringbauer
'''
class
BlPiece
(
object
):
# Class for block pieces, container for relevant attributes
origin
=
()
# Coordinates of the original individual
start
=
0
# Starting coordinates
end
=
0
# End coordinates
index
=
0
# Index of chromosome
screwed
=
False
# Variable which indicate this block will not be followed anymore
def
__init__
(
self
,
origin
,
start
,
end
,
index
=
0
):
self
.
origin
=
origin
self
.
start
=
start
self
.
end
=
end
self
.
index
=
index
def
update_length
(
self
,
start
,
end
):
self
.
start
=
start
self
.
end
=
end
class
Multi_Bl
(
BlPiece
):
# Subclass of Block, simply carries blocks of multiple origins and total start and end value
def
__init__
(
self
,
sub_blocks
):
self
.
origin
=
()
# No origin since only subblocks have that
self
.
start
=
min
(
i
.
start
for
i
in
sub_blocks
)
self
.
end
=
max
(
i
.
end
for
i
in
sub_blocks
)
self
.
sub_blocks
=
[]
# IMPORTANT: Since lists are mutable, we have to reset them
for
block
in
sub_blocks
:
# Subblocks can be Multi-Blocks!
if
isinstance
(
block
,
Multi_Bl
):
self
.
sub_blocks
+=
block
.
sub_blocks
else
:
self
.
sub_blocks
.
append
(
block
)
\ No newline at end of file
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