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

document recommended way to merge multiple consensus peak files from ASPEN to create one file for TOBIAS #9

Closed
kelly-sovacool opened this issue Apr 3, 2024 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@kelly-sovacool
Copy link
Member

kelly-sovacool commented Apr 3, 2024

Are the default options from bedtools merge good enough for this use case, or are there other methods we should consider?

@kopardev

@kelly-sovacool kelly-sovacool added the documentation Improvements or additions to documentation label Apr 3, 2024
@kelly-sovacool kelly-sovacool self-assigned this Apr 3, 2024
@Krithika-Bhuvan
Copy link
Member

Found the answer on the TOBIAS FAQ (https://github.com/loosolab/TOBIAS/wiki/FAQ) and I quote below:

What peak-file should I use as input?
You should use any .bed-file containing open chromatin regions from peak-calling, e.g. from MACS2 or similar. If you are planning to compare several conditions with each other, e.g. WT.bam with treatment.bam, you should obtain the peaks WT_peaks.bed and treatment_peaks.bed for each condition, and merge these using e.g. bedtools:

cat WT_peaks.bed treatment_peaks.bed | bedtools sort | bedtools merge > merged_peaks.bed

You should then use 'merged_peaks.bed' throughout the TOBIAS tools.

@Krithika-Bhuvan
Copy link
Member

Krithika-Bhuvan commented Apr 3, 2024

Here is a simple bash script in case anyone is interested

#!/bin/bash

#SBATCH --partition=norm
#SBATCH --job-name=tobias_merge_bed
#SBATCH --time=48:00:00
#SBATCH --cpus-per-task=4
#SBATCH --mem=80g
#SBATCH --gres=lscratch:200

### SETTINGS TO CHANGE

# enter path to consensus bed file(s) output from CCBR ASPEN
consensus_bed_dir="/data/CCRCCDI/analysis/ccrtegs4/atac/01_aspen/output3/results/peaks/genrich/"

# output folder
out_dir="/data/CCRCCDI/analysis/ccrtegs4/atac/09_tobias/"
OUTBED=$out_dir"merged_peaks.bed"

## STEPS - load bedtools module
module load bedtools
cd $consensus_bed_dir

echo "Found these files:"
ls *.genrich.consensus.bed

echo "Sort and merge these bed files:"
cat *.genrich.consensus.bed | bedtools sort | bedtools merge > $OUTBED

#call this script like this
#sbatch script_merge_bed_for_tobias.sh

@kelly-sovacool kelly-sovacool added this to the 2024-04 milestone Apr 3, 2024
@kelly-sovacool
Copy link
Member Author

Perfect, thank you Krithika!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants