Skip to content

Commit

Permalink
Added test for "from_hmmer_alignment" class method from DCA.py
Browse files Browse the repository at this point in the history
  • Loading branch information
HanaJaafari committed Sep 11, 2024
1 parent a898844 commit 918f9f0
Show file tree
Hide file tree
Showing 3 changed files with 53,050 additions and 23 deletions.
20 changes: 11 additions & 9 deletions frustratometer/classes/DCA.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def from_hmmer_alignment(cls,pdb_structure : object,
query_sequence_database_file : Path or str
File name of sequence database.
DCA_format : str
Current option is "plmDCA"
Options are "plmDCA" and "mfDCA"
sequence_cutoff : float
Sequence seperation cutoff; the couplings terms of contacts that are separated by more than this cutoff will be ignored.
distance_cutoff : float
Expand All @@ -346,27 +346,29 @@ def from_hmmer_alignment(cls,pdb_structure : object,
self._chain=pdb_structure.chain
self._sequence=pdb_structure.sequence
self._pdb_file=pdb_structure.pdb_file
self._potts_model=potts_model
self._sequence_cutoff=sequence_cutoff
self._distance_cutoff=distance_cutoff
self._distance_matrix_method=None

self._alignment_output_file_name = alignment_output_file_name
self._filtered_alignment_output_file_name = filtered_alignment_output_file_name
self._query_sequence_database_file=query_sequence_database_file
self.alignment_output_file_name = alignment_output_file_name
self.filtered_alignment_output_file_name = filtered_alignment_output_file_name
self.query_sequence_database_file=query_sequence_database_file

self._DCA_format=DCA_format
self.DCA_format=DCA_format

self.mapped_distance_matrix=pdb_structure.mapped_distance_matrix
self.distance_matrix=self.mapped_distance_matrix
self.mask = frustration.compute_mask(self.mapped_distance_matrix, self.distance_cutoff, self.sequence_cutoff)

self.minimally_frustrated_threshold=1

self._alignment_file=align.jackhmmer(self.sequence,self.alignment_file)
self._filtered_alignment_file=filter.filter_alignment(self.alignment_output_file_name,self.filtered_alignment_output_file_name,self.query_sequence_database_file)
self.alignment_file=align.jackhmmer(self.sequence,self.alignment_output_file_name,self.query_sequence_database_file)
self.filtered_alignment_file=filter.filter_alignment(self.alignment_output_file_name,self.filtered_alignment_output_file_name)

self._potts_model=dca.pydca.plmdca(self.filtered_alignment_file)
if self.DCA_format=="plmDCA":
self.potts_model=dca.pydca.plmdca(str(self.filtered_alignment_file))
else:
self.potts_model=dca.pydca.mfdca(str(self.filtered_alignment_file))

self.aa_freq = None
self.contact_freq = None
Expand Down
Loading

0 comments on commit 918f9f0

Please sign in to comment.