Skip to content

implementation of ImpactAnalysis, SPIA and LRPath - #31

Open
sienkie wants to merge 64 commits into
kn-bioinf:masterfrom
bibsAPB:master
Open

implementation of ImpactAnalysis, SPIA and LRPath#31
sienkie wants to merge 64 commits into
kn-bioinf:masterfrom
bibsAPB:master

Conversation

@sienkie

@sienkie sienkie commented Oct 30, 2018

Copy link
Copy Markdown
Contributor

Small corrections in existing classes, new methods implementation, tests, and new output type.

sienkie and others added 30 commits October 29, 2017 21:10
minor docstring changes and clean-up
Interface for impact analysis method and models corrections
LRpath method interface
sienkie and others added 28 commits June 19, 2018 12:45
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
 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

@krassowski krassowski left a comment

Copy link
Copy Markdown
Contributor

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:

  1. 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)
  2. there are no meaningful tests attached for SPIA

I would recommend splitting this PR into smaller chunks (if possible) and merging ImpactAnalysis, LRPath in.

Comment thread methods/LRpath/LRpath.py
if os.path.exists(self.database):
db = self.get_list_db()
else:
sys.exit("Path with database file is not exist")

Copy link
Copy Markdown
Contributor

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.

Comment thread methods/LRpath/LRpath.py
data['nlp'] = None

for sig in data.index:
up = pd.Series([float((-1) * math.log(float(data.loc[[sig]][name])))], name='nlp', index=[sig])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why (-1)?

Comment thread methods/SPIA/SPIA.py
"""
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

topology. These

Comment thread methods/SPIA/SPIA.py
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 ,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

selection,

Comment thread methods/SPIA/SPIA.py
def load_data_dict(dictionary, all):
'''

Part of this code is imported from https://github.com/iseekwonderful/PyPathway on MIT license.

Copy link
Copy Markdown
Contributor

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:

  1. 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]
  1. in the method docstring

Comment thread methods/SPIA/SPIA.py
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():

Copy link
Copy Markdown
Contributor

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.

Comment thread methods/SPIA/SPIA.py
@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.

Copy link
Copy Markdown
Contributor

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.

Comment thread 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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? ;)

Comment thread methods/SPIA/constants.py
@@ -0,0 +1,31 @@

# names and databases keys for species
SPECIES = [["anopheles", "Anopheles gambiae", "Ag", "aga", "anoGam", "7165"],

Copy link
Copy Markdown
Contributor

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?

Comment thread methods/SPIA/constants.py
["zebrafish", "Danio rerio", "Dr", "dre", "danRer", "7955"]]

# KEGG database interaction types
rel = ["activation", "compound", "binding/association", "expression", "inhibition",

Copy link
Copy Markdown
Contributor

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?

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 this pull request may close these issues.

5 participants