Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scRNA-seq-simulation
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
pipelines
scRNA-seq-simulation
Commits
b9d94593
Commit
b9d94593
authored
3 years ago
by
Kathleen Moriarty
Browse files
Options
Downloads
Patches
Plain Diff
change: read start random to read start at 0
parent
e80482a7
Branches
Branches containing commit
No related tags found
1 merge request
!17
Issue 7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/read_sequencing.py
+5
-11
5 additions, 11 deletions
src/read_sequencing.py
with
5 additions
and
11 deletions
src/read_sequencing.py
+
5
−
11
View file @
b9d94593
...
...
@@ -75,26 +75,20 @@ def read_sequencing(
for
i
in
range
(
0
,
num_frag_reads
):
# Obtain random first position for the read on the fragment
rand_start
=
randrange
(
0
,
len
(
frag
))
# Calculate the difference of start position and length of read
diff_start_end
=
len
(
frag
)
-
rand_start
# If length of read is greater than difference of start to end, then add random nucleotides
if
diff_start_end
<
read_len
:
# If the read length is less than the required length given by the parameter, then add random nucleotides
if
len
(
frag
)
<
read_len
:
# Calculate number of random nucleotides to add to the end of the read
diff
=
read_len
-
diff_start_
en
d
diff
=
read_len
-
read_l
en
# Select random nucleotides from list of possible
rand_samp
=
choices
(
nucleotides
,
k
=
diff
)
# Add the random list to the read and save
tmp_read
=
frag
[
rand_start
:
len
(
frag
)]
+
''
.
join
(
rand_samp
)
tmp_read
=
frag
[
0
:(
len
(
frag
)
-
1
)
]
+
''
.
join
(
rand_samp
)
else
:
# Save subset of fragment as read
tmp_read
=
frag
[
rand_start
:(
rand_start
+
read_len
)]
tmp_read
=
frag
[
0
:(
read_len
-
1
)]
# append read to list
fasta_list
.
append
(
tmp_read
)
...
...
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