コード例 #1
0
ファイル: test_illumina.py プロジェクト: Galithil/scilifelab
 def test_map_index_name(self):
     """Map index sequences to names
     """
     
     # Some test cases
     from scilifelab.illumina.index_definitions import BASIC_LOOKUP
     random_keys = [BASIC_LOOKUP.keys()[random.randint(0,len(BASIC_LOOKUP.keys())-1)] for n in xrange(25)]
     
     for name in random_keys:
         self.assertIn(name,map_index_name(BASIC_LOOKUP[name],0),
                       "Exact mapping did not return expected index name")
コード例 #2
0
ファイル: test_illumina.py プロジェクト: wenjingk/scilifelab
    def test_map_index_name(self):
        """Map index sequences to names
        """

        # Some test cases
        from scilifelab.illumina.index_definitions import BASIC_LOOKUP
        random_keys = [
            BASIC_LOOKUP.keys()[random.randint(0,
                                               len(BASIC_LOOKUP.keys()) - 1)]
            for n in xrange(25)
        ]

        for name in random_keys:
            self.assertIn(name, map_index_name(BASIC_LOOKUP[name], 0),
                          "Exact mapping did not return expected index name")
コード例 #3
0
ファイル: __init__.py プロジェクト: tomasdalmo/scilifelab
def map_index_name(index, mismatch=0):
    """Map the index sequences to the known names, if possible. Requires the samplesheet module.
    """

    names = []
    for name, sequence in BASIC_LOOKUP.items():
        try:
            if index != sequence and hamming_distance(index, sequence) > mismatch:
                continue
            names.append(name)
        except:
            pass

    return names
コード例 #4
0
def map_index_name(index, mismatch=0):
    """Map the index sequences to the known names, if possible. Requires the samplesheet module.
    """

    names = []
    for name, sequence in BASIC_LOOKUP.items():
        try:
            if index != sequence and hamming_distance(index,
                                                      sequence) > mismatch:
                continue
            names.append(name)
        except:
            pass

    return names