Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Read sequencer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
zavolan_group
tools
Read sequencer
Commits
38af80ac
Commit
38af80ac
authored
2 years ago
by
clara
Browse files
Options
Downloads
Patches
Plain Diff
new file: read_sequencer_package/generate_sequences.py
parent
96b55041
No related branches found
Branches containing commit
No related tags found
1 merge request
!9
new file: read_sequencer_package/generate_sequences.py
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
read_sequencer_package/generate_sequences.py
+25
-0
25 additions, 0 deletions
read_sequencer_package/generate_sequences.py
with
25 additions
and
0 deletions
read_sequencer_package/generate_sequences.py
0 → 100644
+
25
−
0
View file @
38af80ac
import
random
def
generate_sequences
(
n
,
mean
,
sd
):
"""
Summary line.
Generates random sequences.
Args:
n (int): Amount of sequences to generate.
mean (int): mean length of sequence (gaussian distribution).
sd (float): standart deviation of length of sequence (gaussian distribution).
Returns:
list: of n sequences
"""
l1
=
[]
for
i
in
range
(
n
):
seq
=
""
nt
=
[
"
A
"
,
"
T
"
,
"
C
"
,
"
G
"
]
for
pos
in
range
(
round
(
random
.
gauss
(
mean
,
sd
))):
seq
=
seq
+
random
.
choice
(
nt
)
l1
.
append
(
seq
)
return
l1
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment