Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions on page /29_algorithm_validation/validate-spot-counting.html #27

Open
ClementCaporal opened this issue Mar 2, 2023 · 1 comment · May be fixed by #37
Open

Questions on page /29_algorithm_validation/validate-spot-counting.html #27

ClementCaporal opened this issue Mar 2, 2023 · 1 comment · May be fixed by #37

Comments

@ClementCaporal
Copy link

ClementCaporal commented Mar 2, 2023

Hello,

Thank you for your work.
I have two questions concerning the 29_algorithm_validation/validate-spot-counting

Maximum or sum projection ?

def compute_true_positives(distance_matrix, thresh): 
    dist_mat = cle.push(distance_matrix)
    count_matrix = dist_mat < thresh

    ...

    detected = np.asarray(cle.maximum_y_projection(count_matrix))[0, 1:]
    # [0, 1:] is necessary to get rid of the first column which corresponds to background

    ...

    # ambiguous matches occur when one annotation corresponds to multiple detected spots 
    ambiguous_matches = len(detected[detected>1])

    ...

I think maximum_y_projection -> sum_y_projection otherwise we cannot detect ambiguous matches. (everything will be 0 or 1 using the maximum projection)

Who should be in the column position : detected or annotation ?

Considering that annotation is 16 points.
Considering that detected_spots is 31 points.

When distance_matrix is defined:

distance_matrix = cle.generate_distance_matrix(detected_spots, annotations.T)

It will put the detection as columns of the matrix (it's shape will be (16, 31))

But for the F1 score quantification:

print(f'We are detecting {distance_matrix.shape[0]} cells when there are {distance_matrix.shape[1]}')

The detections are in row, not in columns.
Also in def compute_true_positives(distance_matrix, thresh): the y_projection suggest also that annotation should be in the columns.

If distance_matrix.T is used from the definition maybe the legend of this figure will need to change
image

@haesleinhuepf
Copy link
Owner

Let me just get @Shannon-E-Taylor in the loop for this question :-)

@ClementCaporal ClementCaporal linked a pull request Jun 19, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants