Skip to content

Commit

Permalink
Fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang Wu committed Sep 14, 2020
1 parent afb3808 commit 976e9d6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@

### Pulling the Docker image (recommended)

Please follow the instruction [here](https://docs.docker.com/get-docker/) to download and install Docker based on your operating system before running the Docker image. This is **recommended** as it is compatible with most common operating systems including Linux, macOS and Windows.
Please follow the instruction [here](https://docs.docker.com/get-docker/) to download and install Docker based on your operating system before running the Docker image. **For Windows users**, please check [here](https://github.com/yangwu91/r2g/wiki/Install-and-configure-Docker-on-Windows) to configure the Docker if it is your first time to use it.

This installation method is **recommended** as it is compatible with most common operating systems including Linux, macOS and Windows.

Then, pull the r2g Docker image with all required software packages installed and configured by one command as follows:

Expand Down
8 changes: 4 additions & 4 deletions tests/test_assemblers.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_trinity_paired(self):
paired = True
app_json = utils.preflight(self.args)
trinity = assemblers.Trinity(self.args, app_json, self.fastq_list, paired)
trinity_dir = trinity.run()
trinity_dir, trinity_log_file = trinity.run()
result = "{}/Trinity.fasta".format(trinity_dir)
if os.path.isfile(result):
trinity.copyto("{}/final_assembly.fasta".format(self.output_dir))
Expand All @@ -49,7 +49,7 @@ def test_trinity_singled_trimmed(self):
self.args['trim'] = True
app_json = utils.preflight(self.args)
trinity = assemblers.Trinity(self.args, app_json, self.fastq_list, paired)
trinity_dir = trinity.run()
trinity_dir, trinity_log_file = trinity.run()
# result = "{}/{}.Trinity.fasta".format(self.output_dir, os.path.split(trinity_dir)[1])
result = "{}/{}/Trinity.fasta".format(self.output_dir, os.path.split(trinity_dir)[1])
if os.path.isfile(result) and os.stat(result).st_size > 1000:
Expand All @@ -64,7 +64,7 @@ def test_trinity_customtrimmed(self):
del self.fastq_list['2']
app_json = utils.preflight(self.args)
trinity = assemblers.Trinity(self.args, app_json, self.fastq_list, paired)
trinity_dir = trinity.run()
trinity_dir, trinity_log_file = trinity.run()
result = "{}/{}/Trinity.fasta".format(self.output_dir, os.path.split(trinity_dir)[1])
print(result)
print(os.stat(result).st_size)
Expand All @@ -79,7 +79,7 @@ def test_trinity_stage(self):
self.args['stage'] = stage
app_json = utils.preflight(self.args)
trinity = assemblers.Trinity(self.args, app_json, self.fastq_list, paired)
trinity_dir = trinity.run()
trinity_dir, trinity_log_file = trinity.run()
if stage == "jellyfish":
result = "{}/jellyfish.kmers.fa".format(trinity_dir)
elif stage == "inchworm":
Expand Down
2 changes: 1 addition & 1 deletion tests/test_r2g.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
class TestR2g(unittest.TestCase):

def test_utils_parse_argument(self):
online_raw_args = "-o RPS7 -s SRX5138669 -q aae_RPS7.fa --cut 50,20 -r 5 --CPU 4".split()
online_raw_args = "r2g -o RPS7 -s SRX5138669 -q aae_RPS7.fa --cut 50,20 -r 5 --CPU 4".split()
globals()['args_dict']['query'] = "aae_RPS7.fa"
self.assertEqual(utils.parse_arguments(online_raw_args), globals()['args_dict'])

Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def setUp(self):

def test_parse_args(self):
utils.log("Testing r2g.utils.utils _parse_args")
raw_args = "-o OUTPUT -s SRXNNNNNN -q ATGC --cut 80,50 -p blastn --CPU 4 --retry"
raw_args = "r2g -o OUTPUT -s SRXNNNNNN -q ATGC --cut 80,50 -p blastn --CPU 4 --retry"
raw_args = raw_args.split()
parsed_args = utils.parse_arguments(raw_args)
self.assertEqual(parsed_args, self.args)
Expand Down

0 comments on commit 976e9d6

Please sign in to comment.