Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hongduosun committed May 15, 2020
1 parent 4187d05 commit 7247aba
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 338 deletions.
25 changes: 12 additions & 13 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import mamotif
import sphinx_rtd_theme

# -- General configuration ------------------------------------------------

Expand All @@ -30,9 +32,10 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.imgmath',
'sphinx.ext.viewcode']
extensions = [
'sphinx.ext.autodoc',
'sphinx_rtd_theme'
]

# Add any paths that contain templates here, relative to this directory.
# templates_path = ['_templates']
Expand All @@ -56,9 +59,9 @@
# built documents.
#
# The short X.Y version.
version = u'1.0'
version = mamotif.__version__
# The full version, including alpha/beta/rc tags.
release = u'1.0.1'
release = mamotif.__version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -78,7 +81,6 @@
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand All @@ -95,7 +97,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -112,13 +114,11 @@
]
}


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'MAmotifdoc'


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
Expand Down Expand Up @@ -147,7 +147,6 @@
u'ShaoLab', 'manual'),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
Expand All @@ -157,7 +156,6 @@
[author], 1)
]


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
Expand All @@ -169,5 +167,6 @@
'Miscellaneous'),
]



linkcheck_ignore = [
r"https://github.com/shao-lab/MAmotif/workflows/Python%20package/badge.svg"
]
48 changes: 18 additions & 30 deletions docs/source/demo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
Example Usage
=============

Here we provide a step-by-step instruction on how to use MAmotif to find candidate cell-type specific regulators
associated with certain histone modifications.
Here we provide a step-by-step instruction on how to use MAmotif to find candidate
cell-type specific regulators associated with certain histone modifications.

We take the H3K4me3 analysis between adult and fetal ProES in MAmotif paper as an example:
We take the H3K4me3 analysis between adult and fetal ProES in the MAmotif
paper as an example:

1. Install MAmotif::

$pip install mamotif
$conda install -c bioconda mamotif

2. Download all data MAmotif needs::
2. Download example data files::

$mkdir MAmotif_demo
$cd MAmotif_demo
Expand All @@ -23,46 +24,33 @@ We take the H3K4me3 analysis between adult and fetal ProES in MAmotif paper as a
$wget ftp://ftp.ncbi.nlm.nih.gov/geo/samples/GSM908nnn/GSM908039/suppl/GSM908039_H3K4me3-A.bed.gz
$gzip -d *gz

Remove the header line and ribosomal reads (You do not need to do this for modern ChIP-seq mapping softwares)
Remove the header line and ribosomal reads
$sed -i '1d' GSM908038_H3K4me3-F.bed
$sed -i '1d' GSM908039_H3K4me3-A.bed
$sed -i '8986927,$d' GSM908039_H3K4me3-F.bed
$sed -i '8986927,$d' GSM908038_H3K4me3-F.bed
$sed -i '14916308,$d' GSM908039_H3K4me3-A.bed

Substitute space into tab for bed files (You do not need to do this for your own bed files are tab-separated)
Substitute space into tab for bed files
$sed -i "s/ /\t/g" GSM908038_H3K4me3-F.bed
$sed -i "s/ /\t/g" GSM908039_H3K4me3-A.bed

.. note::

3. Build for genome sequences::
The modification steps of data files above is specific to the example,
since the format does not follow the standard. You do not have to do this
for your own data.

$mkdir genome
$cd genome
$wget http://hgdownload.cse.ucsc.edu/goldenPath/hg18/bigZips/chromFa.zip
$unzip chromFa.zip
$cat *fa > hg18.fa
$genomecompile -G hg18.fa -o hg18
$cd ..

4. Build for motif PWM (Optional)
3. Install genome `hg18` from UCSC database::

The motif matrix file which containing the motif score cutoff is already packaged under /data directory under MotifScan package.
$ motifscan genome --install -n hg18 -r hg18

You can download it by::
4. Install motif PFMs set from JASPAR database::

$wget --no-check-certificate https://github.com/shao-lab/MAmotif/raw/master/data/motif.tar.gz

If you want you compile for your custom motifs, please run the following commands::

$mkdir motif
$cd motif
$wget http://jaspar2016.genereg.net/html/DOWNLOAD/JASPAR_CORE/pfm/nonredundant.tar.gz
$tar -xzvf nonredundant.tar.gz
$motifcompile -M nonredundant/pfm_vertebrates.txt -g ../genome/hg18 -o hg18_jaspar2016_nonredundant_vertebrates
$cd ..
$ motifscan motif --install -n vertebrates -r vertebrates_non-redundant -g hg19

5. Run MAmotif::

$mamotif --p1 GSM908039_H3K4me3-A_peaks.bed --p2 GSM908038_H3K4me3-F_peaks.bed --r1 GSM908039_H3K4me3-A.bed --r2 GSM908038_H3K4me3-F.bed -g genome/hg18 -m motif/hg18_jaspar2016_nonredundant_vertebrates_1e-4.txt -o AvsF_H3K4me3_MAmotif
$mamotif run --p1 GSM908039_H3K4me3-A_peaks.bed --p2 GSM908038_H3K4me3-F_peaks.bed --r1 GSM908039_H3K4me3-A.bed --r2 GSM908038_H3K4me3-F.bed -g hg18 -m vertebrates -o AvsF_H3K4me3_MAmotif

6. Check the output of MAmotif
6. Check the output of MAmotif
Loading

0 comments on commit 7247aba

Please sign in to comment.