https://github.com/ay-lab/selfish
SELFISH is a tool for finding differential chromatin interactions between two Hi-C contact maps.
Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 2 DOI reference(s) in README -
○Academic publication links
-
✓Committers with academic emails
1 of 7 committers (14.3%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.6%) to scientific vocabulary
Keywords from Contributors
Repository
SELFISH is a tool for finding differential chromatin interactions between two Hi-C contact maps.
Basic Info
Statistics
- Stars: 17
- Watchers: 2
- Forks: 7
- Open Issues: 16
- Releases: 0
Metadata Files
README.md
Selfish
Selfish (Discovery of Differential Chromatin Interactions via a Self-Similarity Measure) is a tool by Abbas Roayaei Ardakany, Ferhat Ay (ferhatay@lji.org), and Stefano Lonardi. This Python implementation is currently maintained by Tuvan Gezer (tgezer@sabanciuniv.edu). The original MATLAB implementation by Abbas (roayaei@gmail.com) can be found at https://github.com/ucrbioinfo/SELFISH.
SELFISH is a tool for finding differential chromatin interactions between two Hi-C contact maps. It uses self-similarity to model interactions in a robust way. For more information read the full
paper: Selfish: discovery of differential chromatin interactions via a self-similarity measure.

Installation and usage
PIP
bash
pip3 install selfish-hic
selfish -f1 /path/to/contact/map1.txt \
-f2 /path/to/contact/map2.txt \
-ch 2 \
-r 100kb -o ./output.npy
Github
Make sure you have Python 3 installed, along with all the dependencies listed.
bash
git clone https://github.com/ay-lab/selfish
./selfish/selfish/selfish.py -f1 /path/to/contact/map1.txt \
-f2 /path/to/contact/map2.txt \
-ch 2 \
-r 100kb -o ./output.npy
Nextflow
If you have any problem regarding dependencies or version mismatches, we recommend using Nextflow with a container technology like Docker or Singularity. These methods require Nextflow(Can be installed with a single command that doesn't require special permissions.), and the desired container technology to be available.
Program arguments are given to Nextflow with two dashes and the short format listed below.
Updating: If Nextflow warns that your project is outdated, use nextflow pull ay-lab/selfish in order to update to latest version.
Install Nextflow
Nextflow works for Linux and OS X. Install it using one of the commands listed below. Requires Java 8+
bash
wget -qO- https://get.nextflow.io | bash
OR
curl -s https://get.nextflow.io | bash
With Docker
bash
./nextflow run ay-lab/selfish --f1="/path/to/contact/map1.txt" \
--f2="/path/to/contact/map2.txt" \
--ch=2 \
--r=100kb -profile docker
With Singularity
bash
./nextflow run ay-lab/selfish --f1="/.../map1.txt" \
--f2="/.../map2.txt" \
--ch=2 \
--r=100kb -profile singularity
Bioconda
Bioconda install isn't currently available.
Dependencies
Selfish uses some python packages to accomplish its mission. These are the packages used by selfish:
- numpy
- pandas
- matplotlib
- seaborn
- scipy
- statsmodels
- hic-straw
- pathlib
Parameters
| Short | Long | Meaning | | --------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Required Parameters | | | | -f1 | --file1 | Location of contact map 1. (See below for format.) Not required for HiC-Pro input. | | -f2 | --file2 | Location of contact map 2. (See below for format.) Not required for HiC-Pro input. | | -r | --resolution | Resolution of the provided contact maps. | | -o | --outfile | Name of the output file. | | -ch | --chromosome | Specify which chromosome to run the program for. | | -m1 | --matrix1 | Location of matrix file, only for HiC-Pro type input. | | -m2 | --matrix2 | Location of matrix file, only for HiC-Pro type input. | | -bed1 | --bed1 | Location of bed file, only for HiC-Pro type input. | | -bed2 | --bed2 | Location of bed file, only for HiC-Pro type input. | | Optional Parameters | | | | -t | --tsvout | If specified, outputs will be written as a TSV file. Specify the q-value threshold for which the results will be written to the file (i.e. -t 0.05) | | -d | --distanceFilter | Maximum distance between interacting loci. | | -c | --changes | Name of the output file that has the log fold changes (log2((a+1)/(b+1))) between the inputs. | | -b1 | --biases1 | Location of bias/normalization vector file for contact map 1. (See below for format.) | | -b2 | --biases2 | Location of bias/normalization vector file for contact map 2. (See below for format.) | | -sz | --sigmaZero | Sigma0 parameter for Selfish. Default is experimentally chosen for 5Kb resolution. | | -i | --iterations | Iteration count parameter for Selfish. Default is experimentally chosen for 5Kb resolution. | | -v | --verbose | Whether the program prints its progress while running. Default is True. | | -st | --sparsityThreshold | The sparsity threshold selfish uses to filter differential interactions. Differential interactions falling in sparse regions are filtered out. The default is 0.7. | | -ns | --no-sparsityCheck | Do not use sparsity checking. | | -nm | --no-mutual | Include also the interactions that are zero in one of the contact maps. By defalut, selfish only considers interactions that are not zero in any of the contact maps. | | -norm | --normalization | For .[m]cool or .hic files, you can specify what normalization selfish should use (-norm KR). For .[m]cool files, by default, selfish assumes that bias values are stored in the 'weight' column when this parameter is not specified. For .hic format, the default is 'KR' normalization if not specified. | | -p | --plot | Whether the program plots its results. Highly discouraged for high resolutions(<50kb) as it will take a lot of time to compute the plots. For high resolutions, we recommend using the output matrix and plotting small sections of it manually. Default is False. | | -lm | --lowmem | Use float32 instead of float64. Uses less memory at the cost of precision. Default is False. | | -V | --version | Shows the version of the tool. |
Input Formats
SELFISH supports 3 different input formats. Plain text, .hic, .cool, .bed/.matrix pairs (HiC-Pro format).
Text Contact Maps
Contact maps need to have the following format. They must not have a header. Values must be separated by either a space, a tab, or a comma.
| Chromosome | Midpoint 1 | Chromosome | Midpoint 2 | Contact Count | | ---------- | ---------- | ---------- | ---------- | ------------- | | chr1 | 5000 | chr1 | 65000 | 438 | | chr1 | 5000 | chr1 | 85000 | 12 | | ... | ... | ... | ... | ... |
Bed-Matrix pairs (HiC-Pro format)
User must provide a chromosome with the -ch argument. .bed and .matrix files must have the same name other than the extension. Either file name can be provided as an input for selfish and the program will search for the second file automatically.
HiC file
User must provide a chromosome with the -ch argument. Selfish uses juicer's straw tool to read .hic files.
.cool file
User must provide a chromosome with the -ch argument. Selfish uses cooler to read .cool files.
Bias (normalization) File
Bias file need to have the following format. Bias file must use the same midpoint format as the contact maps. Bias file must not have a header.
| Chromosome | Midpoint | Bias | | ---------- | -------- | ----- | | chr1 | 5000 | 1.012 | | 1 | 65000 | 1.158 | | ... | ... | ... |
Output
Output of Selfish is a matrix of q-values indicating the probability of differential conformation (Smaller values mean more significant.).
X and Y coordinates indicate the bin midpoints.
Another optional output is the log fold changes file. It is simply produced by log2((map1 + 1) / (map2 + 1))
File format of the outputs is a binary numpy file. It can be read by using Numpy as follows.
python
import numpy as np
matrix = np.load("/path/to/output/selfish.npy")
Citation
If you use Selfish in your work, please cite our Bionformatics paper:
Abbas Roayaei Ardakany, Ferhat Ay, Stefano Lonardi, Selfish: discovery of differential chromatin interactions via a self-similarity measure, Bioinformatics, Volume 35, Issue 14, July 2019, Pages i145–i153, https://doi.org/10.1093/bioinformatics/btz362
Owner
- Login: ay-lab
- Kind: user
- Repositories: 6
- Profile: https://github.com/ay-lab
GitHub Events
Total
- Issues event: 1
Last Year
- Issues event: 1
Committers
Last synced: over 3 years ago
All Time
- Total Commits: 105
- Total Committers: 7
- Avg Commits per committer: 15.0
- Development Distribution Score (DDS): 0.4
Top Committers
| Name | Commits | |
|---|---|---|
| Halil Tuvan Gezer (Student) | t****r@s****u | 63 |
| ay-lab | f****y@l****g | 21 |
| ay-lab | a****s@l****g | 10 |
| ay-lab | s****a@l****g | 4 |
| Phlya | f****r@g****m | 3 |
| roayaei | r****i@y****m | 2 |
| ay-lab | a****t@l****g | 2 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 21
- Total pull requests: 5
- Average time to close issues: about 1 month
- Average time to close pull requests: 2 days
- Total issue authors: 12
- Total pull request authors: 4
- Average comments per issue: 2.57
- Average comments per pull request: 0.6
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 1
- Pull request authors: 0
- Average comments per issue: 0.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- BenxiaHu (6)
- zyqfrog10 (3)
- biozzq (3)
- PPWEST522 (1)
- mariko728 (1)
- wbszhu (1)
- tuxette (1)
- mzytnicki (1)
- Z-H-Zhang (1)
- yezhengSTAT (1)
- zmanber (1)
- ilead-cong (1)
Pull Request Authors
- tuvangezer (2)
- sebastian-gregoricchio (1)
- Phlya (1)
- liviu- (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 21 last-month
- Total docker downloads: 113
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 27
- Total maintainers: 2
pypi.org: selfish-hic
Hi-C Differential Analysis software created and maintained by the Ay Lab
- Homepage: http://github.com/ay-lab/selfish/
- Documentation: https://selfish-hic.readthedocs.io/
- License: MIT
-
Latest release: 1.14.0
published about 5 years ago
Rankings
Dependencies
- cooler *
- hic-straw *
- matplotlib *
- numpy *
- pandas *
- pathlib *
- requests *
- scipy *
- seaborn *
- statsmodels *
- python 3.6 build