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

Calcul de la pvalue pour les specific proteins #88

Open
dagopian opened this issue Sep 16, 2020 · 1 comment
Open

Calcul de la pvalue pour les specific proteins #88

dagopian opened this issue Sep 16, 2020 · 1 comment
Assignees
Labels
backend bug Something isn't working

Comments

@dagopian
Copy link
Collaborator

Après l'étape distribution du pipeline, les proteins specific n'ont pas de pvalue.
Je suis en mode "two-tailed", et les pvalues étaient bien calculées pour les specific quand j'étais en "right-tailed".
J'utilise la branche scripts_analysis.

@clescoat clescoat self-assigned this Sep 16, 2020
@clescoat clescoat added backend bug Something isn't working labels Sep 16, 2020
@dagopian
Copy link
Collaborator Author

Fichier distribution.py :

def compute_p_value(df: pd.DataFrame, test: str, best_dist, args_param) -> pd.DataFrame:
    if test == 'right-tailed':
        df['pvalue'] = 1 - best_dist.cdf(df['zscore'], **args_param)
    elif test == 'two-sided':
        df['pvalue'] = 2 * (1 - best_dist.cdf(abs(df['zscore']), **args_param))
    else:
        print("WARNING: two-tailed or not")
    return df

La condition pour calculer les pvalues en mode "two-sided" ou "two-tailed" est contrôlée dans: eilf == 'two-sided'

def update_res_with_specific_proteins(specific_proteins: pd.DataFrame, reference: str, test: str) -> pd.DataFrame:
    """
    Update p-value for protein if study include specific proteins
    """
    if test == 'two-tailed':
        specific_proteins['pvalue'] = 0
    elif test == 'right-tailed':
        #mask = (specific_proteins['ratio'] == 0.01)
        #specific_proteins['ratio']['pvalue'] = 0
        specific_proteins['pvalue'] = np.where((specific_proteins['ratio'] == 0.001), 1, 0)

Cette même condition pour le calcul des pavlues des protéines spécifiques est contrôlée dans if test == 'two-tailed'

Fix :

  • Changer le if test == 'two-tailed' en if test == 'two-sided' dans la fonction update_res_with_specific_proteins
  • Rajouter un else au cas ou la variable test ne vaut ni "two-tailed" ni "two-sided" dans la fonction update_res_with_specific_proteins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants