Exemple #1
0
    def test1a(self):
        pdb_1a = self.pdb.flatMap(structureToPolymerChains())
        pdb_1a = pdb_1a.filter(
            experimentalMethods(experimentalMethods.X_RAY_DIFFRACTION))
        results_1a = pdb_1a.keys().collect()

        self.assertTrue('2ONX.A' in results_1a)
        self.assertFalse('5VLN.A' in results_1a)
Exemple #2
0
def main():
    path = "../../resources/mmtf_reduced_sample/"

    conf = SparkConf().setMaster("local[*]") \
                         .setAppName("FilterByDExperimentalMethods")
    sc = SparkContext(conf=conf)

    MmtfReader.readSequenceFile(path, sc) \
                 .filter(experimentalMethods(experimentalMethods.NEUTRON_DIFFRACTION, experimentalMethods.X_RAY_DIFFRACTION)) \
                 .keys() \
                 .foreach(lambda x: print(x))

    sc.stop()
Exemple #3
0
 def test5(self):
     pdb_5 = self.pdb.filter(
         experimentalMethods(experimentalMethods.ELECTRON_CRYSTALLOGRAPHY))
     results_2 = pdb_5.keys().collect()
     self.assertFalse('2ONX' in results_2)
     self.assertFalse('5VLN' in results_2)
     self.assertFalse('5VAI' in results_2)
     self.assertFalse('5JXV' in results_2)
     self.assertTrue('5K7N' in results_2)
     self.assertFalse('3PDM' in results_2)
     self.assertFalse('5MNX' in results_2)
     self.assertFalse('5I1R' in results_2)
     self.assertFalse('5MON' in results_2)
     self.assertFalse('5LCB' in results_2)
     self.assertFalse('3J07' in results_2)
Exemple #4
0
 def test4(self):
     pdb_4 = self.pdb.filter(
         experimentalMethods(experimentalMethods.SOLID_STATE_NMR))
     results_4 = pdb_4.keys().collect()
     self.assertFalse('2ONX' in results_4)
     self.assertFalse('5VLN' in results_4)
     self.assertFalse('5VAI' in results_4)
     self.assertTrue('5JXV' in results_4)
     self.assertFalse('5K7N' in results_4)
     self.assertFalse('3PDM' in results_4)
     self.assertFalse('5MNX' in results_4)
     self.assertFalse('5I1R' in results_4)
     self.assertFalse('5MON' in results_4)
     self.assertFalse('5LCB' in results_4)
     self.assertFalse('3J07' in results_4)
Exemple #5
0
 def test3(self):
     pdb_3 = self.pdb.filter(
         experimentalMethods(experimentalMethods.ELECTRON_MICROSCOPY))
     results_3 = pdb_3.keys().collect()
     self.assertFalse('2ONX' in results_3)
     self.assertFalse('5VLN' in results_3)
     self.assertTrue('5VAI' in results_3)
     self.assertFalse('5JXV' in results_3)
     self.assertFalse('5K7N' in results_3)
     self.assertFalse('3PDM' in results_3)
     self.assertFalse('5MNX' in results_3)
     self.assertFalse('5I1R' in results_3)
     self.assertFalse('5MON' in results_3)
     self.assertFalse('5LCB' in results_3)
     self.assertFalse('3J07' in results_3)
Exemple #6
0
 def test2(self):
     pdb_2 = self.pdb.filter(
         experimentalMethods(experimentalMethods.SOLUTION_NMR))
     results_2 = pdb_2.keys().collect()
     self.assertFalse('2ONX' in results_2)
     self.assertTrue('5VLN' in results_2)
     self.assertFalse('5VAI' in results_2)
     self.assertFalse('5JXV' in results_2)
     self.assertFalse('5K7N' in results_2)
     self.assertFalse('3PDM' in results_2)
     self.assertFalse('5MNX' in results_2)
     self.assertFalse('5I1R' in results_2)
     self.assertFalse('5MON' in results_2)
     self.assertFalse('5LCB' in results_2)
     self.assertFalse('3J07' in results_2)
Exemple #7
0
 def test1(self):
     pdb_1 = self.pdb.filter(
         experimentalMethods(experimentalMethods.X_RAY_DIFFRACTION))
     results_1 = pdb_1.keys().collect()
     self.assertTrue('2ONX' in results_1)
     self.assertFalse('5VLN' in results_1)
     self.assertFalse('5VAI' in results_1)
     self.assertFalse('5JXV' in results_1)
     self.assertFalse('5K7N' in results_1)
     self.assertFalse('3PDM' in results_1)
     self.assertFalse('5MNX' in results_1)
     self.assertFalse('5I1R' in results_1)
     self.assertFalse('5MON' in results_1)
     self.assertFalse('5LCB' in results_1)
     self.assertFalse('3J07' in results_1)
Exemple #8
0
 def test7(self):
     pdb_7 = self.pdb.filter(
         experimentalMethods(experimentalMethods.NEUTRON_DIFFRACTION))
     results_7 = pdb_7.keys().collect()
     self.assertFalse('2ONX' in results_7)
     self.assertFalse('5VLN' in results_7)
     self.assertFalse('5VAI' in results_7)
     self.assertFalse('5JXV' in results_7)
     self.assertFalse('5K7N' in results_7)
     self.assertFalse('3PDM' in results_7)
     self.assertTrue('5MNX' in results_7)
     self.assertFalse('5I1R' in results_7)
     self.assertFalse('5MON' in results_7)
     self.assertFalse('5LCB' in results_7)
     self.assertFalse('3J07' in results_7)
Exemple #9
0
 def test9(self):
     pdb_9 = self.pdb.filter(
         experimentalMethods(experimentalMethods.SOLUTION_NMR,
                             experimentalMethods.SOLUTION_SCATTERING))
     results_9 = pdb_9.keys().collect()
     self.assertFalse('2ONX' in results_9)
     self.assertFalse('5VLN' in results_9)
     self.assertFalse('5VAI' in results_9)
     self.assertFalse('5JXV' in results_9)
     self.assertFalse('5K7N' in results_9)
     self.assertFalse('3PDM' in results_9)
     self.assertFalse('5MNX' in results_9)
     self.assertTrue('5I1R' in results_9)
     self.assertFalse('5MON' in results_9)
     self.assertFalse('5LCB' in results_9)
     self.assertFalse('3J07' in results_9)
Exemple #10
0
 def test10(self):
     pdb_10 = self.pdb.filter(
         experimentalMethods(experimentalMethods.SOLID_STATE_NMR,
                             experimentalMethods.ELECTRON_MICROSCOPY,
                             experimentalMethods.SOLUTION_SCATTERING))
     results_10 = pdb_10.keys().collect()
     self.assertFalse('2ONX' in results_10)
     self.assertFalse('5VLN' in results_10)
     self.assertFalse('5VAI' in results_10)
     self.assertFalse('5JXV' in results_10)
     self.assertFalse('5K7N' in results_10)
     self.assertFalse('3PDM' in results_10)
     self.assertFalse('5MNX' in results_10)
     self.assertFalse('5I1R' in results_10)
     self.assertFalse('5MON' in results_10)
     self.assertFalse('5LCB' in results_10)
     self.assertTrue('3J07' in results_10)