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
90c6a8fd
Commit
90c6a8fd
authored
2 years ago
by
Christoph Harmel
Browse files
Options
Downloads
Plain Diff
Merge branch 'fixes' into 'main'
fix: updated linters in CI See merge request
!33
parents
6b07d9da
e8bfd7f3
No related branches found
No related tags found
1 merge request
!33
fix: updated linters in CI
Pipeline
#14909
passed
2 years ago
Stage: build
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
readsequencer/read_sequencer.py
+8
-4
8 additions, 4 deletions
readsequencer/read_sequencer.py
with
9 additions
and
5 deletions
.gitlab-ci.yml
+
1
−
1
View file @
90c6a8fd
...
@@ -30,7 +30,7 @@ lint-test-job: # This job also runs in the test stage.
...
@@ -30,7 +30,7 @@ lint-test-job: # This job also runs in the test stage.
-
pip install -r requirements.txt
-
pip install -r requirements.txt
-
pip install -r requirements-dev.txt
-
pip install -r requirements-dev.txt
-
pip install -e .
-
pip install -e .
#
- flake8 --docstring-convention google
readsequencer/ tests/
-
flake8 --docstring-convention google
--max-line-length 120 readsequencer/ --ignore=D212,D103,D104,D107,D100,D017,D415
#- pylint readsequencer/ tests/
#- pylint readsequencer/ tests/
deploy-job
:
# This job runs in the deploy stage.
deploy-job
:
# This job runs in the deploy stage.
...
...
This diff is collapsed.
Click to expand it.
readsequencer/read_sequencer.py
+
8
−
4
View file @
90c6a8fd
...
@@ -7,6 +7,7 @@ from Bio.SeqRecord import SeqRecord
...
@@ -7,6 +7,7 @@ from Bio.SeqRecord import SeqRecord
class
ReadSequencer
:
class
ReadSequencer
:
"""
ReadSequencer class
"""
ReadSequencer class
Args:
Args:
fasta: path fasta file
fasta: path fasta file
output: path output fasta file(s)
output: path output fasta file(s)
...
@@ -72,7 +73,8 @@ class ReadSequencer:
...
@@ -72,7 +73,8 @@ class ReadSequencer:
return
seq
return
seq
def
resize_sequence
(
self
,
record
:
SeqRecord
)
->
SeqRecord
:
def
resize_sequence
(
self
,
record
:
SeqRecord
)
->
SeqRecord
:
"""
"""
Resizes sequence
Resizes sequence according to set read length. If sequence is
Resizes sequence according to set read length. If sequence is
shorter than read length, fills up with random nucleotides.
shorter than read length, fills up with random nucleotides.
...
@@ -83,7 +85,7 @@ class ReadSequencer:
...
@@ -83,7 +85,7 @@ class ReadSequencer:
resized SeqRecord
resized SeqRecord
"""
"""
if
(
len
(
record
))
>=
self
.
read_length
:
if
(
len
(
record
))
>=
self
.
read_length
:
record
.
seq
=
record
.
seq
[
0
:
self
.
read_length
-
1
]
record
.
seq
=
record
.
seq
[
0
:
self
.
read_length
-
1
]
else
:
else
:
n_add
=
self
.
read_length
-
len
(
record
)
n_add
=
self
.
read_length
-
len
(
record
)
add_seq
=
self
.
generate_random_sequence
(
n_add
)
add_seq
=
self
.
generate_random_sequence
(
n_add
)
...
@@ -91,7 +93,8 @@ class ReadSequencer:
...
@@ -91,7 +93,8 @@ class ReadSequencer:
return
record
.
seq
return
record
.
seq
def
batch_iterator
(
self
,
iterator
:
Iterator
,
batch_size
:
int
)
->
Generator
:
def
batch_iterator
(
self
,
iterator
:
Iterator
,
batch_size
:
int
)
->
Generator
:
"""
"""
Generates batch iterator.
This is a generator function, and it returns lists of the
This is a generator function, and it returns lists of the
entries from the supplied iterator. Each list will have
entries from the supplied iterator. Each list will have
batch_size entries, although the final list may be shorter.
batch_size entries, although the final list may be shorter.
...
@@ -111,7 +114,8 @@ class ReadSequencer:
...
@@ -111,7 +114,8 @@ class ReadSequencer:
batch
=
[]
batch
=
[]
def
run_sequencing
(
self
)
->
None
:
def
run_sequencing
(
self
)
->
None
:
"""
"""
Runs sequencing.
Runs read sequencing of specified sequences from input fasta file or
Runs read sequencing of specified sequences from input fasta file or
generates random sequences for a given read length. If number of
generates random sequences for a given read length. If number of
sequences exceeds chunk-size, it will switch to batch processing mode.
sequences exceeds chunk-size, it will switch to batch processing mode.
...
...
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