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

implementation of ImpactAnalysis, SPIA and LRPath #31

Open
wants to merge 64 commits into
base: master
Choose a base branch
from

Conversation

sienkie
Copy link
Contributor

@sienkie sienkie commented Oct 30, 2018

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
Copy link
Member

@krassowski krassowski left a 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:

  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.

if os.path.exists(self.database):
db = self.get_list_db()
else:
sys.exit("Path with database file is not exist")
Copy link
Member

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])
Copy link
Member

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)
Copy link
Member

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 ,
Copy link
Member

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.
Copy link
Member

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

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
Member

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.
Copy link
Member

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,
Copy link
Member

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"],
Copy link
Member

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",
Copy link
Member

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