Esempio n. 1
0
 def testReturnsDataWithFloatingPointForce(self):
   params = dict(
     construct='SJF4', slide=1, mol=3,
     pull=3, force=10.5, min='2')
   finfo = fio.parseFilename(
     self.filenameFromParams(**params))
   self.checkReturnData(params, finfo)
Esempio n. 2
0
  def testReturnsFilenameData(self):
    params = dict(
      construct='SJF4', slide=1, mol=3,
      pull=3, force=0, min='2')

    finfo = fio.parseFilename(
      self.filenameFromParams(**params))

    self.checkReturnData(params, finfo)
Esempio n. 3
0
 def testReturnsDataWithFloatingPointForce(self):
     params = dict(construct='SJF4',
                   slide=1,
                   mol=3,
                   pull=3,
                   force=10.5,
                   min='2')
     finfo = fio.parseFilename(self.filenameFromParams(**params))
     self.checkReturnData(params, finfo)
Esempio n. 4
0
    def testReturnsFilenameData(self):
        params = dict(construct='SJF4',
                      slide=1,
                      mol=3,
                      pull=3,
                      force=0,
                      min='2')

        finfo = fio.parseFilename(self.filenameFromParams(**params))

        self.checkReturnData(params, finfo)
Esempio n. 5
0
def byMolecule(directory='./', exp_type=experiment.Pulling, fromMatch=('',), **metadata):
    """Return a generator (iterator) which yields experiment.List for all molecules in given directory."""
    assert issubclass(exp_type, experiment.Base)
    assert isinstance(fromMatch, (tuple, list))
    assert isinstance(directory, str)
    with ChangeDirectory(directory):
        flist = filter(exp_type.filenameMatchesType,
                   experiment.filelist(*fromMatch))
    filelist = groupby(flist, lambda f: fileIO.parseFilename(f)[:4])
    for mol, group in filelist:
        with ChangeDirectory(directory):
            dirname = path.basename(directory)
            date_ = dir_to_date(dirname)
            metadata.setdefault('date', date_)
            yield experiment.List(
                map(lambda f: exp_type.fromFile(f, **metadata), group))
Esempio n. 6
0
def byMolecule(directory='./',
               exp_type=experiment.Pulling,
               fromMatch=('', ),
               **metadata):
    """Return a generator (iterator) which yields experiment.List for all molecules in given directory."""
    assert issubclass(exp_type, experiment.Base)
    assert isinstance(fromMatch, (tuple, list))
    assert isinstance(directory, str)
    with ChangeDirectory(directory):
        flist = filter(exp_type.filenameMatchesType,
                       experiment.filelist(*fromMatch))
    filelist = groupby(flist, lambda f: fileIO.parseFilename(f)[:4])
    for mol, group in filelist:
        with ChangeDirectory(directory):
            dirname = path.basename(directory)
            date_ = dir_to_date(dirname)
            metadata.setdefault('date', date_)
            yield experiment.List(
                map(lambda f: exp_type.fromFile(f, **metadata), group))
Esempio n. 7
0
 def testReturnsNoneWithBadFilename(self):
   fail = 'SJF4_0.5nM_s1m3_2hours.fret'
   finfo = fio.parseFilename(fail)
   self.assertEquals(finfo, None)
Esempio n. 8
0
 def testReturnsNoneWithBadFilename(self):
     fail = 'SJF4_0.5nM_s1m3_2hours.fret'
     finfo = fio.parseFilename(fail)
     self.assertEquals(finfo, None)