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
eea24234
Commit
eea24234
authored
3 years ago
by
Kathleen Moriarty
Browse files
Options
Downloads
Patches
Plain Diff
added: comments and new lines
parent
7549c162
Branches
Branches containing commit
No related tags found
1 merge request
!17
Issue 7
Pipeline
#13804
failed
3 years ago
Stage: qc
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/read_sequencing.py
+3
-2
3 additions, 2 deletions
src/read_sequencing.py
tests/test_read_sequence.py
+3
-3
3 additions, 3 deletions
tests/test_read_sequence.py
with
6 additions
and
5 deletions
src/read_sequencing.py
+
3
−
2
View file @
eea24234
"""
Read Sequencing
!
"""
Read Sequencing
.
Simulate the sequencing of reads on the template of terminal fragments and simulates reads of these fragments.
Author: Kathleen Moriarty
...
...
@@ -33,14 +33,15 @@ def read_sequencing(
num_reads: number of total reads to simulate
read_len: integer of identical read length
"""
# Read data from terminal fragment file
# Store fragment descriptions in a list
frag_desc
=
[]
# type: List[str]
with
open
(
frag_file_name
,
'
r
'
)
as
f
:
frag_line
=
f
.
readline
()
# Store all fragments as a list to parse later
frag_list
=
[]
# type: List[str]
# Store combined fragment lines
frag_str
=
""
while
frag_line
!=
""
:
# To stop when the end of file is reached
...
...
This diff is collapsed.
Click to expand it.
tests/test_read_sequence.py
+
3
−
3
View file @
eea24234
"""
Test Read Sequencing
Functionality.
"""
"""
Test
Functionality of
Read Sequencing
"""
# imports from built-in modules
from
pathlib
import
Path
...
...
@@ -13,10 +13,10 @@ from src.read_sequencing import read_sequencing
def
test_read_sequencing
(
tmpdir
):
"""
Tests the correct number of reads were generated.
"""
read_sequencing
(
frag_file_name
=
Path
(
'
./
tests/resources/test_terminal_fragments.txt
'
)
,
frag_file_name
=
Path
.
cwd
()
/
'
tests/resources/test_terminal_fragments.txt
'
,
num_reads
=
80
,
read_len
=
10
,
output_file_name
=
tmpdir
/
'
reads.txt
'
)
df_out
=
pd
.
read_table
(
tmpdir
/
'
reads.txt
'
,
header
=
None
)
assert
df_out
.
shape
[
0
]
==
80
*
3
assert
df_out
.
shape
[
0
]
==
80
*
2
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