Exemple #1
0
 def test_onp_ignore_indels(self):
     """make sure indels aren't being combined with onps"""
     file = 'testdata/maflite/onp.indel.maf.txt'
     input = OnpCombiner(MafliteInputMutationCreator(file))
     expected = list(MafliteInputMutationCreator(file).createMutations())
     onp_muts = [mut for mut in input.createMutations()]
     self.assert_mutations_match_expected(expected=expected, result=onp_muts)
Exemple #2
0
 def test_onp_ignore_indels(self):
     """make sure indels aren't being combined with onps"""
     file = 'testdata/maflite/onp.indel.maf.txt'
     input = OnpCombiner(MafliteInputMutationCreator(file))
     expected = list(MafliteInputMutationCreator(file).createMutations())
     onp_muts = [mut for mut in input.createMutations()]
     self.assert_mutations_match_expected(expected=expected, result=onp_muts)
Exemple #3
0
 def test_multi_sample_maflite(self):
     """Tests a multi sample maf with several unaligned onps"""
     input = OnpCombiner(MafliteInputMutationCreator('testdata/maflite/onp_combination.maf.txt'))
     onp_muts =list(input.createMutations())
     expected = self._tuples_to_MutationData([(1, 1, 1, "G", "A", "hg19"),
                                              (1, 1, 4, "GTTT", "CGAA", "hg19"),
                                              (1, 2, 3, "TT", "CC", "hg19"),
                                              (1, 12, 12, "T", "G", "hg19"),
                                              (2, 13, 13, "A", "G", "hg19")])
     expected_pair_names = ['P2','P1','P3','P1','P1']
     self._assert_mutation_lists_equal(onp_muts, expected)
     for mut, pair in zip(onp_muts, expected_pair_names):
         self.assertEqual(mut["Pair_Name"], pair)
Exemple #4
0
 def test_multi_sample_maflite(self):
     """Tests a multi sample maf with several unaligned onps"""
     input = OnpCombiner(MafliteInputMutationCreator('testdata/maflite/onp_combination.maf.txt'))
     onp_muts =list(input.createMutations())
     expected = self._tuples_to_MutationData([(1, 1, 1, "G", "A", "hg19"),
                                              (1, 1, 4, "GTTT", "CGAA", "hg19"),
                                              (1, 2, 3, "TT", "CC", "hg19"),
                                              (1, 12, 12, "T", "G", "hg19"),
                                              (2, 13, 13, "A", "G", "hg19")])
     expected_pair_names = ['P2','P1','P3','P1','P1']
     self._assert_mutation_lists_equal(onp_muts, expected)
     for mut, pair in zip(onp_muts, expected_pair_names):
         self.assertEqual(mut["Pair_Name"], pair)
 def create_input_creator(inputFilename,
                          inputFormat,
                          genome_build="hg19",
                          input_creator_options=None):
     inputCreatorDict = OncotatorCLIUtils.createInputFormatNameToClassDict()
     if inputFormat not in inputCreatorDict.keys():
         raise NotImplementedError("The inputFormat specified: " +
                                   inputFormat + " is not supported.")
     else:
         inputConfig = inputCreatorDict[inputFormat][1]
         inputCreator = inputCreatorDict[inputFormat][0](
             inputFilename, inputConfig, genome_build,
             input_creator_options)
         if input_creator_options.get(
                 OptionConstants.INFER_ONPS
         ):  #If we're combinging ONPs, wrap the input creater
             inputCreator = OnpCombiner(inputCreator)
     return inputCreator