Skip to content
Snippets Groups Projects
Commit 90c6a8fd authored by Christoph Harmel's avatar Christoph Harmel
Browse files

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!33fix: updated linters in CI
Pipeline #14909 passed
...@@ -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.
......
...@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment