Skip to content
Snippets Groups Projects
Commit 2df21f06 authored by Christian Faber's avatar Christian Faber
Browse files

clean up cmap

parent aa1b1e41
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ with open("README.md", "r") as f: ...@@ -5,7 +5,7 @@ with open("README.md", "r") as f:
setup( setup(
name="BioHelpers_FABER", name="BioHelpers_FABER",
version="0.1.20", version="0.1.21",
description="Small collection of useful scripts for the computational work with RNA Data.", description="Small collection of useful scripts for the computational work with RNA Data.",
url="https://gitlab.jsc.fz-juelich.de/faber1/biohelpers", url="https://gitlab.jsc.fz-juelich.de/faber1/biohelpers",
package_dir={"": "src"}, package_dir={"": "src"},
......
Metadata-Version: 2.1 Metadata-Version: 2.1
Name: BioHelpers-FABER Name: BioHelpers-FABER
Version: 0.1.18 Version: 0.1.20
Summary: Small collection of useful scripts for the computational work with RNA Data. Summary: Small collection of useful scripts for the computational work with RNA Data.
Home-page: https://gitlab.jsc.fz-juelich.de/faber1/biohelpers Home-page: https://gitlab.jsc.fz-juelich.de/faber1/biohelpers
Author: Christian Faber Author: Christian Faber
......
...@@ -63,10 +63,12 @@ class Cmap: ...@@ -63,10 +63,12 @@ class Cmap:
self.reference = reference self.reference = reference
self.contact_threshold = contact_threshold self.contact_threshold = contact_threshold
self.positioning, self.sequence = bm.get_sequence_position(filename) self.positioning, self.sequence = bm.get_sequence_position(filename)
if start_from_one: if not start_from_one:
shift = self.positioning[0] - 1
self.positioning = [e - shift for e in self.positioning]
self.positioning.insert(0, 0) self.positioning.insert(0, 0)
self.positioning.insert(0, 0) self.positioning.insert(0, 0)
self.l = self.positioning[-1] - self.positioning[0] + 1 * (not start_from_one) self.l = self.positioning[-1]
chain = next(pdb.PDBParser().get_structure(id, filename)[0].get_chains()) chain = next(pdb.PDBParser().get_structure(id, filename)[0].get_chains())
bm.cleanup_chain(chain) bm.cleanup_chain(chain)
self.native_contacts = np.zeros((len(chain), len(chain))) self.native_contacts = np.zeros((len(chain), len(chain)))
...@@ -77,8 +79,8 @@ class Cmap: ...@@ -77,8 +79,8 @@ class Cmap:
self.contacts["native"] = np.zeros((self.l, self.l)) self.contacts["native"] = np.zeros((self.l, self.l))
for c in bm.arr_to_contact_list(self.native_contacts): for c in bm.arr_to_contact_list(self.native_contacts):
self.contacts["native"][ self.contacts["native"][
self.num_to_id(c[0]) - self.positioning[0] - 1 * (not start_from_one), self.num_to_id(c[0]),
self.num_to_id(c[1]) - self.positioning[0] - 1 * (not start_from_one), self.num_to_id(c[1]),
] = 1 ] = 1
self.pdb_id = id self.pdb_id = id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment