Skip to content

Commit

Permalink
🎨 string format
Browse files Browse the repository at this point in the history
  • Loading branch information
enryH committed Oct 9, 2024
1 parent fc152b8 commit d493c3c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
5 changes: 2 additions & 3 deletions acore/differential_regulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,8 @@ def calculate_repeated_measures_anova(df, column, subject="subject", within="gro
df1, df2 = aov_result["DF"]
except Exception as e:
print(
"Repeated measurements Anova for column: {} could not be calculated. Error {}".format(
column, e
)
"Repeated measurements Anova for column: {} could not be calculated."
" Error {}".format(column, e)
)

return (column, df1, df2, t, pvalue)
Expand Down
10 changes: 4 additions & 6 deletions acore/kaplan_meier_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,14 @@ def group_data_based_on_marker(df, marker, index_col, how, value):
labels.extend([str(marker) + "-"] * (num_values - value))
else:
print(
"Invalid value provided. Exceeded maximun number of samples {}".format(
num_values
)
"Invalid value provided. Exceeded maximun number of samples {}"
.format(num_values)
)
mdf["new_grouping"] = labels
else:
print(
"Grouping method {} not implemented. Try with 'cutoff' or 'top'".format(
how
)
"Grouping method {} not implemented. Try with 'cutoff' or 'top'"
.format(how)
)

return mdf
Expand Down
17 changes: 12 additions & 5 deletions acore/publications_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import pandas as pd
from Bio import Entrez, Medline

Entrez.email = "[email protected]" # TODO: This should probably be changed to the email of the person installing ckg?
# TODO: This should probably be changed to the email of the person installing ckg?
Entrez.email = "[email protected]"


def getMedlineAbstracts(idList):
Expand Down Expand Up @@ -54,17 +55,23 @@ def get_publications_abstracts(
index="PMID",
):
"""
Accesses NCBI PubMed over the WWW and retrieves the abstracts corresponding to a list of one or more PubMed IDs.
Accesses NCBI PubMed over the WWW and retrieves the abstracts corresponding
to a list of one or more PubMed IDs.
:param data: pandas dataframe of diseases and publications linked to a list of proteins (columns: 'Diseases', 'Proteins', 'linkout' and 'publication').
:param data: pandas dataframe of diseases and publications linked to a list of
proteins (columns: 'Diseases', 'Proteins', 'linkout' and 'publication').
:param str publication_col: column label containing PubMed ids.
:param list join_by: column labels to be kept from the input dataframe.
:param str index: column label containing PubMed ids from the NCBI retrieved data.
:return: Pandas dataframe with publication information and columns 'PMID', 'abstract', 'authors', 'date', 'journal', 'keywords', 'title', 'url', 'Proteins' and 'Diseases'.
:return: Pandas dataframe with publication information and columns 'PMID', 'abstract',
'authors', 'date', 'journal', 'keywords', 'title', 'url', 'Proteins' and 'Diseases'.
Example::
result = get_publications_abstracts(data, publication_col='publication', join_by=['publication','Proteins','Diseases'], index='PMID')
result = get_publications_abstracts(data,
publication_col='publication',
join_by=['publication','Proteins','Diseases'],
index='PMID')
"""
abstracts = pd.DataFrame()
if not data.empty:
Expand Down

0 comments on commit d493c3c

Please sign in to comment.