forked from trmznt/fatools
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
attempts to remove ladder peaks that resulf from oversaturated peaks …
…in other channels.
- Loading branch information
Showing
4 changed files
with
78 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"python.testing.unittestArgs": [ | ||
"-v", | ||
"-s", | ||
"./tests", | ||
"-p", | ||
"*test.py" | ||
], | ||
"python.testing.pytestEnabled": false, | ||
"python.testing.unittestEnabled": true, | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.python" | ||
}, | ||
"python.formatting.provider": "none" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import unittest | ||
|
||
from fatools.lib.fautil.mixin2 import FSAMixIn | ||
|
||
|
||
class GetSaturatedRtimesTest(unittest.TestCase): | ||
|
||
#mocks up a channels and alleles | ||
class Channel: | ||
def __init__(self, alleles): | ||
self.alleles = alleles | ||
def get_alleles(self): | ||
return self.alleles | ||
|
||
class Allele: | ||
def __init__(self, rfu, rtime): | ||
self.rfu = rfu | ||
self.rtime = rtime | ||
|
||
high_alleles = [Allele(29000,100),Allele(29001,200), Allele(35000,300), Allele(40000,400)] | ||
low_alleles = [Allele(28999,100),Allele(3000,200), Allele(1000,300), Allele(500,400)] | ||
|
||
def setUp(self): | ||
self.fsa = FSAMixIn() | ||
|
||
def test_get_saturated_rtimes_empty_channels(self): | ||
self.fsa.channels = [] | ||
saturated_rtimes = self.fsa.get_saturated_rtimes() | ||
self.assertEqual(saturated_rtimes, []) | ||
|
||
def test_get_saturated_rtimes_no_saturated_alleles(self): | ||
self.fsa.channels = [self.Channel(self.low_alleles)] | ||
saturated_rtimes = self.fsa.get_saturated_rtimes() | ||
self.assertEqual(saturated_rtimes, []) | ||
|
||
def test_get_saturated_rtimes_some_saturated_allele(self): | ||
self.fsa.channels = [self.Channel(self.low_alleles),self.Channel(self.high_alleles)] | ||
saturated_rtimes = self.fsa.get_saturated_rtimes() | ||
self.assertEqual(saturated_rtimes, [100,200,300,400]) | ||
|
||
if __name__ == "__main__": | ||
unittest.main() |