Git Product home page Git Product logo

neticspy's Introduction

NetICSpy

version

Python implementation of NetICS (Network-based Integration of Multi-omics data).

Installation

$ pip install neticspy

Description

NetICS performs a per sample bidirectional network diffusion-based method for prioritizing genes based on their proximity to upstream aberration events and to downstream differentially expressed genes and proteins in an interaction network. The sample-specific gene lists are integrated into an overall ranked list of genes using rank aggregation technique.

Usage

There are two subcommands: neticspy diffuse and neticspy rank.

diffuse

Prepare diffusion matrix for given network and restart probability. This subcommand will produce .npz file containing precomputed forward/backward diffusion matrices.

$ neticspy diffuse --adj ADJ \
    --beta BETA \
    --output OUTPUT 

Arguments

-j ADJ, --adj ADJ: Adjacency matrix of the directed interaction network. (separted by tab)

-b BETA, --beta BETA: Restart probability for the insulated diffusion. Default: 0.4 (For the network from Wu et al., 2010)

-o OUTPUT, --output OUTPUT: Output filename for diffusion matrix in .npz format.

rank

Run core NetICS algorithm and rank genes by their mediator effect. This subcommand will produce two comma-separated tables: raw result containing sample-gene-diffusion score triplets (raw.txt), and aggregated gene rankings (rank_aggregated.txt) that allow cohort-wise gene prioritization.

$ neticspy rank --aberration ABERRATION \
    --diffusion-matrix DIFFUSION_MATRIX \
    --network NETWORK \
    --degs DEGS \
    --output OUTPUT \

Arguments

-a ABERRATION, --aberration ABERRATION: Input two-column table (without headers) containing genetically aberrant genes for each sample. It contain two columns that map every gene (1st column) to the samples that it is genetically aberrant (2nd column).

-f DIFFUSION_MATRIX, --diffusion-matrix DIFFUSION_MATRIX: Path to .npz file for diffusion matrix.

-n NETWORK, --network NETWORK: Input file that contains the list of the genes that are present in the network. (same order with adjency matrix)

-d DEGS, --degs DEGS: List of the names of predefined differentially expressed genes. (same format with aberration file)

-o OUTPUT-PREFIX, --output-prefix OUTPUT-PREFIX: Prefix of the output file to save raw NetICS result and aggregated ranks.

-v, --verbose: Increase verbosity.

As an ordinary python package

import neticspy

netics_result = neticspy.netics_fun(
    filename_aberration,
    filename_network_genes,
    output,
    filename_deg_list,
    restart_prob=0.4,
)

Note

The default value of beta (restart probability) is 0.4.

References

Dimitrakopoulos, Christos, et al. "Network-based integration of multi-omics data for prioritizing cancer genes." Bioinformatics 34.14 (2018): 2441-2448.

neticspy's People

Contributors

bonilkoo avatar dohlee avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

bonilkoo

neticspy's Issues

Need more instruction in using neticspy

Hi,

I am a neticspy end-user.
I successfully install neticspy in my computer(debian 9) with Python 2.7.13.

When I try to conduct the example command with the file "adj_lar_com.mat" downloaded from [https://github.com/cbg-ethz/netics/blob/master/data/adj_lar_com.mat]
It failed and I guess that it may be the format problem.
As a consequence, I use the following command in the python prompt to transform the mat to a csv format:

import pandas as pd
import numpy
from scipy.io import loadmat
data_dict = loadmat('adj_lar_com.mat')
data_array = data_dict['adj_lar_com']
data_array = data_array.transpose(1, 0)
dataframe = pd.DataFrame(data_array)
dataframe.to_csv(r"adj_lar_com.csv")

Then I try to conduct neticspy again.
The command I run:
neticspy diffuse --adj adj_lar_com.csv --beta 0.4 --output testout
It turn back the following message as I use the .mat file.

Traceback (most recent call last):
File "/usr/local/bin/neticspy", line 7, in
from neticspy.cli import main
File "/usr/local/lib/python2.7/dist-packages/neticspy/init.py", line 120
logger.info(f'Successfully saved diffusion matrix to {output}.')
^
SyntaxError: invalid syntax

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.