Skip to content

Estimation motifs #78

Merged
merged 8 commits into from
Jan 19, 2019
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,28 @@ conda activate masterenv
4. Set the wd parameter in the nextflow.config file as path where the repository is saved. For example: '~/masterJLU2018/'.


**Important Note:** For conda the channel bioconda needs to be set as highest priority! This is required due to two different packages with the same name in different channels. For the pipeline the package jellyfish from the channel bioconda is needed and **NOT** the jellyfish package from the channel conda-forge!

**Important Notes:**
1. For conda the channel bioconda needs to be set as highest priority! This is required due to two different packages with the same name in different channels. For the pipeline the package jellyfish from the channel bioconda is needed and **NOT** the jellyfish package from the channel conda-forge!
2. The paramtere --create_known_tfbs_path and --tfbs_path need the absolute path. If a relative path is given it will not work due to nextflow changing the working directory. This will soon be updated.
Copy link
Collaborator

Choose a reason for hiding this comment

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

...need an absolute path.



## Quick Start
```console
nextflow run pipeline.nf --bigwig [BigWig-file] --bed [BED-file] --genome_fasta [FASTA-file] --motif_db [MEME-file] --organism [mm10|mm9|hg19|hg38]
nextflow run pipeline.nf --bigwig [BigWig-file] --bed [BED-file] --genome_fasta [FASTA-file] --motif_db [MEME-file] --organism [mm10|mm9|hg19|hg38] (--tfbs_path [absolute PATH] || --create_known_tfbs_path [absolute PATH])
```

### Demo run
There are files provided inside ./demo/ for a demo run.
Go to the main directory and run following command:
```
nextflow run pipeline.nf --bigwig ./demo/buenrostro50k_chr1_fp.bw --bed ./demo/buenrostro50k_chr1_peaks.bed --genome_fasta ./demo/hg38/hg38_chr1.fa --motif_db ./demo/motif_database/jaspar_vertebrates.meme --out ./demo/buenrostro50k_chr1_out/ --create_known_tfbs_path ./demo/known_tfbs_hg38_chr1/ --organism hg38
nextflow run pipeline.nf --bigwig ./demo/buenrostro50k_chr1_fp.bw --bed ./demo/buenrostro50k_chr1_peaks.bed --genome_fasta ./demo/hg38/hg38_chr1.fa --motif_db ./demo/motif_database/jaspar_vertebrates.meme --out ./demo/buenrostro50k_chr1_out/ --create_known_tfbs_path [absolute path]/demo/known_tfbs/ --organism hg38
```
**Important Note:** In can happen that tfbsscan does not work due to an unknown bug. If this is the case you will see the error message shown in "Known Issues". If this occurs and "fimo" will also throw this error, try following command:
Copy link
Collaborator

Choose a reason for hiding this comment

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

'It' not 'in'
...shown in the Known Issues section below.
If the error occurs first try to change the tfbsscan_method to fimo. If it persists try the following command:

```
nextflow run pipeline.nf --bigwig ./demo/buenrostro50k_chr1_fp.bw --bed ./demo/buenrostro50k_chr1_peaks.bed --genome_fasta ./demo/hg38/hg38_chr1.fa --motif_db ./demo/motif_database/jaspar_vertebrates.meme --out ./demo/buenrostro50k_chr1_out/ --tfbs_path [absolute path]/demo/known_tfbs_chr1_hg38/ --organism hg38
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please verify that this and the nextflow call above are correct. To me it seems that you just changed the parameter create_known_tfbs_path to tfbs_path between the two.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh I think I figured it out. The tfbs_scan provides already scanned data so tfbsscan can be skipped, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, that's correct. With the parameter tfbs_path, you can provide scanned data. So tfbsscan.py will be skipped.

```


## Parameters
For a detailed overview for all parameters follow this [link](https://github.molgen.mpg.de/loosolab/masterJLU2018/wiki/Configuration).
```
Expand All @@ -56,14 +62,17 @@ Required arguments:
--config Path to UROPA configuration file
--organism Input organism [hg38 | hg19 | mm9 | mm10]
--out Output Directory (Default: './out/')
[
--create_known_tfbs_path Path to directory where output from tfbsscan (known motifs) are stored.
Path can be set as tfbs_path in next run. (Needs absolute path)
or
--tfbs_path Path to directory with output from tfbsscan. If given tfbsscan will not be run. (Needs absolute path)
Copy link
Collaborator

Choose a reason for hiding this comment

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

...will be skipped.

]

Optional arguments:

--help [0|1] 1 to show this help message. (Default: 0)
--tfbs_path Path to directory with output from tfbsscan. If given tfbsscan will not be run.
--create_known_tfbs_path Path to directory where output from tfbsscan (known motifs) are stored.
Path can be set as tfbs_path in next run. (Default: './')
--gtf_path Path to gtf-file. If path is set the process which creats a gtf-file is skipped.
--gtf_path Path to gtf-file. If path is set the process which creats a gtf-file is skipped.

Footprint extraction:
--window_length INT This parameter sets the length of a sliding window. (Default: 200)
Expand Down Expand Up @@ -97,8 +106,9 @@ Optional arguments:
--iteration INT Number of iterations done by GLAM2. More Iterations: better results, higher runtime. (Default: 10000)
--tomtom_treshold FLOAT Threshold for similarity score. (Default: 0.01)
--best_motif INT Get the best X motifs per cluster. (Default: 3)
--gap_penalty INT Set penalty for gaps in GLAM2 (Default: 1000)
Moitf clustering:
--cluster_motif Boolean If 1 pipeline clusters motifs. If its 0 it does not. (Default: 0)
--cluster_motif Boolean If 1 pipeline clusters motifs. If its 0 it does not. (Defaul: 0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

*Default

--edge_weight INT Minimum weight of edges in motif-cluster-graph (Default: 5)
--motif_similarity_thresh FLOAT Threshold for motif similarity score (Default: 0.00001)

Expand Down
4 changes: 2 additions & 2 deletions bin/2.2_motif_estimation/get_motif_seq.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ create_seq_json <- function(input, output, num, tmp_path, cluster_id) {
stop(paste0("CLUSTER ID could not be found. Please make sure that your file path contains _[cluster_id] at the end. Found: ", cluster_id,"\n For example: /test_cluster_1/glam.txt"))
}

dir.create(tmp_path, showWarnings = FALSE)
dir.create(tmp_path, showWarnings = FALSE, recursive = TRUE)

file_dir <- tmp_path

# Split glam.txt file on lines that start with Score:
system(paste0("csplit ", input, " '/^Score:.*/' '{*}' -f ", file_dir, "/f_id_test.pholder"))
system(paste0("csplit ", input, " '/^Score:.*/' '{*}' -f ", file_dir, "/f_id.pholder"))
# Only keep the lines that start with 'f' to get the lines with the sequence ids
system(paste0("for i in ", file_dir, "/*.pholder0[1-", num, "];do grep \"^f\" $i > \"${i}.done\";done"))

Expand Down
Empty file.
Empty file.