diff --git a/.idea/ruff.xml b/.idea/ruff.xml index d2889cf568b0b14ece74f0674b0336ffad272b2d..d3a43c2692798cf84ac6aa5d6f9894a6cddb096d 100644 --- a/.idea/ruff.xml +++ b/.idea/ruff.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="RuffConfigService"> - <option name="projectRuffExecutablePath" value="$USER_HOME$/anaconda3/bin/ruff" /> + <option name="projectRuffExecutablePath" value="$USER_HOME$/anaconda3/envs/catm/bin/ruff" /> </component> </project> \ No newline at end of file diff --git a/README.md b/README.md index 4ea2e64a8ded5f0f735811dfc03f273ce0599276..4913d0c66c48add9513961cddb75dc590c383613 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ python version at least 3.5 is required, create a separated environment if you w 1. Creat a new vitual enviroment (optional) ``` -conda create -n CATM python +conda create -n catm python ``` 2. Download the package from gitlab and change directory to the CATM folder ``` @@ -23,7 +23,7 @@ git clone https://git.biohpc.swmed.edu/s194231/cryo-catm.git cd cryo-catm ``` -2. Install the package +2. Install the package, if you want to build your own code activiely, add -dev option ``` pip install . @@ -33,7 +33,7 @@ pip install . ``` cd test -CATM #run the main program +catm #run the main program ``` diff --git a/src/catm.py b/src/catm.py index 0386331cc5c911be20562807eb43c6cc47d4aa60..642ec8c921ca0e1f55fef83fb8802e8d84bc8c3b 100644 --- a/src/catm.py +++ b/src/catm.py @@ -45,7 +45,7 @@ def main(): user_inputs = parse_input() if hasattr(config, "testTM"): # this will run only the global TM if config.testTM: - print("Running general template matching!") + print("Running regular template matching!") matcher = TemplateMatcherGeneral(user_inputs) matcher.run_multiprocessing() end_time = time.time() @@ -61,7 +61,7 @@ def main(): obj_xml = matcher.run_multiprocessing() print("Template matching finished, saving results") else: - print("Bypassing template matching") + print("Bypassed template matching") # for debugging, read the xml file from lxml.etree import XMLParser, parse diff --git a/src/global_template_matching.py b/src/global_template_matching.py index 40d3eb06336398862db645c5d11094e81754e5a7..954640354e99efedab92dc0ae74e01ce8b2b2b3f 100644 --- a/src/global_template_matching.py +++ b/src/global_template_matching.py @@ -65,7 +65,6 @@ class TemplateMatcherGeneral: indices = list(range(len(self.global_angles))) results = pool.map(self.match_worker, indices) # Process results in order - print(len(results)) print("Template matching is done, sorting the results!") # scores, rot_new, coord_new, model = [], [], [], [] # Initialize the arrays @@ -86,7 +85,6 @@ class TemplateMatcherGeneral: # Assign the temporary array to rot_save where the mask is True rot_save[mask] = temp_array[mask] # Verify the result for one element - print(rot_save[0, 0, 0]) # Example verification """ rot_save = np.empty(self.dims, dtype=object) ccc_save = np.zeros(self.dims) for cur_ccc, cur_rot in results: diff --git a/src/template_matching.py b/src/template_matching.py index 108c6affdbf02f9a58ac33e070e7fcd263a22c3e..4913e51001749aa58fa033747a0a2254b057d47d 100644 --- a/src/template_matching.py +++ b/src/template_matching.py @@ -54,6 +54,7 @@ class TemplateMatcher: ctf_volumes = prepare_ctf_volumes(self.ctf, self.templates) else: ctf_volumes = [] + #print("Working on subtomogram " + str(index)) score, rots, coords, models = self.template_match( subtomo, angles, self.coords[index], ctf_volumes ) @@ -212,7 +213,6 @@ class TemplateMatcher: mask = apply_wedge(mask, self.missing_wedge) mask[mask < 0.5] = 0 # the mask should be binary mask[mask >= 0.5] = 1 - cur_ccc.append(calculate_correlation(subtomo[temp], template_rot, mask)) ccc_save, rot_save, coor_save = self.get_best_match( cur_ccc,