Skip to content
Snippets Groups Projects
Commit 3bbd8a8b authored by Huabin Zhou's avatar Huabin Zhou
Browse files

roll back to skip the rotamer and maskmer generation prior the template...

roll back to skip the rotamer and maskmer generation prior the template matching, which accelaratate the program since MPI wasn't involved in these two separated processes .
parent 3ed05208
Branches
No related merge requests found
<?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
......@@ -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
```
......
......@@ -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
......
......@@ -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:
......
......@@ -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,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment