-
Notifications
You must be signed in to change notification settings - Fork 10
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
implementation of ImpactAnalysis, SPIA and LRPath #31
base: master
Are you sure you want to change the base?
Conversation
minor docstring changes and clean-up
import from https://github.com/iseekwonderful/PyPathway on MIT license
Interface for impact analysis method and models corrections
import from https://github.com/iseekwonderful/PyPathway on MIT license
ttest implementation
LRpath method interface
IA docstrings and PEP8, exclude_genes for Sample, SampleCollection and Experiment, KEGGPathways self_loops correction
Implementation of SPIA method.
generate_markdown for MethodResult
corrections and tests for impact analysis
…ests for SPIA. Done todos from SPIA.
Implement LRpath method. Add get_gene_code in databases and test for it.
Deleted unnecessary files from PuPathways. Added documentatnion and t…
Inter_value transferred to constants.py
Parametr organism to LRpath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall code quality is satisfactory, and this is a great piece of work.
However, two major issues remain with regard to the SPIA method:
- It appears to me that the licence attribution is incorrect (please correct me if I am wrong) and it is a blocker issue (we cannot incorporate GNU GPL code into MIT package)
- there are no meaningful tests attached for SPIA
I would recommend splitting this PR into smaller chunks (if possible) and merging ImpactAnalysis, LRPath in.
if os.path.exists(self.database): | ||
db = self.get_list_db() | ||
else: | ||
sys.exit("Path with database file is not exist") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if an exception wouldn't be a better solution, but it's fine as is.
data['nlp'] = None | ||
|
||
for sig in data.index: | ||
up = pd.Series([float((-1) * math.log(float(data.loc[[sig]][name])))], name='nlp', index=[sig]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why (-1)
?
""" | ||
The signaling pathway impact analysis (SPIA) combines two types of evidence: the overrepresentation of DE genes in a given pathway | ||
and the abnormal perturbation of that pathway, as measured by propagating measured expression changes | ||
across the pathway topology.These two aspects are captured by two independent probability values (pNDE and pPERT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
topology. These
8. Multiple hypothesis testing adjustments of each pathway significance are performed by FDR | ||
and Bonferroni correction calculation | ||
|
||
Additional method arguments allow specifying organism for database selection , |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selection,
def load_data_dict(dictionary, all): | ||
''' | ||
|
||
Part of this code is imported from https://github.com/iseekwonderful/PyPathway on MIT license. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PyPathway is not MIT licensed. It appears that it is (and always was) GNU GPL 3.0. This requires further consideration, as GNU GPL derived cannot be used in (our) MIT project. However, we could change our license to GPL 3.0
Moreover, I think that this one requires more visible attribution:
- on top of the file:
Parts of this implementation incorporate, build upon or adapt PyPathway (github.com/iseekwonderful/PyPathway) code by iseekwonderful
[insert correct licence information here + link to the full text of the licence]
- in the method docstring
inter_value = i_val or beta | ||
rel_dict = {rel[i]: inter_value[i] for i in range(len(rel))} | ||
datp_ALL = {} | ||
for k, v in datpT_ALL.items(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No comments, single-letter variable names - it is difficult to understand this part of the method.
@staticmethod | ||
def calculate_spia(de, all, dictionary, nB=2000, beta=None, combine='fisher'): | ||
""" | ||
This code is imported from https://github.com/iseekwonderful/PyPathway on MIT license. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above. NB instead of "imported", I would use "is based upon", as there is no import in there.
models.py
Outdated
columns_selector: Callable[[Sequence[int]], Sequence[int]]=None, | ||
samples=None, delimiter: str='\t', index_col: int=0, | ||
columns_selector: Callable[[Sequence[int]], Sequence[int]] = None, | ||
samples=None, delimiter: str = '\t', index_col: int = 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? ;)
@@ -0,0 +1,31 @@ | |||
|
|||
# names and databases keys for species | |||
SPECIES = [["anopheles", "Anopheles gambiae", "Ag", "aga", "anoGam", "7165"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did it come from? How to update the hard-coded information?
["zebrafish", "Danio rerio", "Dr", "dre", "danRer", "7955"]] | ||
|
||
# KEGG database interaction types | ||
rel = ["activation", "compound", "binding/association", "expression", "inhibition", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did it come from? How to update the hard-coded information?
PEP 8
Small corrections in existing classes, new methods implementation, tests, and new output type.