コード例 #1
0
def mmtf_fetch(pdb, cache_dir='cath/mmtf/'):
    """ Retrieve mmtf record from PDB with local caching """
    mmtf_file = cache_dir + pdb + '.mmtf.gz'
    url = 'http://mmtf.rcsb.org/v1.0/full/' + pdb + '.mmtf.gz'
    mmtf_file = download_cached(url, mmtf_file)
    mmtf_record = mmtf.parse_gzip(mmtf_file)
    return mmtf_record
コード例 #2
0
ファイル: __init__.py プロジェクト: abradle/biopython
    def get_structure_gzip(file_path):
        """Get a structrue from a gzipped file - given a file path.

        :param file_path: the input file path
        :return the structure
        """
        decoder = parse_gzip(file_path)
        return get_from_decoded(decoder)
コード例 #3
0
    def get_structure(file_path):
        """Get a structure from a file - given a file path.

        :param file_path: the input file path
        :return: the structure

        """
        try:
            decoder = parse(file_path)
        except Exception:
            decoder = parse_gzip(file_path)
        return get_from_decoded(decoder)
コード例 #4
0
def _parse_mmtf(fn):
    if fn.endswith('gz'):
        return mmtf.parse_gzip(fn)
    else:
        return mmtf.parse(fn)
コード例 #5
0
ファイル: test_mmtf.py プロジェクト: kaplajon/mdanalysis
 def setUp(self):
     top = mmtf.parse_gzip(MMTF_gz)
     self.u = mda.Universe(top)
コード例 #6
0
ファイル: codec_tests.py プロジェクト: pwrose/mmtf-python
 def test_round_trip(self):
     data_in = parse_gzip("mmtf/tests/testdatastore/4CUP.mmtf.gz")
     write_mmtf("test.mmtf", data_in, MMTFDecoder.pass_data_on)
     data_rt = parse("test.mmtf")
     self.check_equal(data_in, data_rt)
コード例 #7
0
ファイル: codec_tests.py プロジェクト: pwrose/mmtf-python
 def test_gz_decoder(self):
     decoded = parse_gzip("mmtf/tests/testdatastore/4CUP.mmtf.gz")
コード例 #8
0
ファイル: test_mmtf.py プロジェクト: zhenyuwei99/mdanalysis
 def u(self):
     top = mmtf.parse_gzip(MMTF_gz)
     return mda.Universe(top)
コード例 #9
0
ファイル: test_mmtf.py プロジェクト: MDAnalysis/mdanalysis
 def u(self):
     top = mmtf.parse_gzip(MMTF_gz)
     return mda.Universe(top)
コード例 #10
0
ファイル: MMTF.py プロジェクト: MDAnalysis/mdanalysis
def _parse_mmtf(fn):
    if fn.endswith('gz'):
        return mmtf.parse_gzip(fn)
    else:
        return mmtf.parse(fn)