Skip to content

Commit

Permalink
Merge pull request #4 from stjude/madetunj
Browse files Browse the repository at this point in the history
more usage information
  • Loading branch information
madetunj authored Feb 12, 2020
2 parents cb4ce74 + 7b63577 commit c7742a8
Show file tree
Hide file tree
Showing 2 changed files with 138 additions and 32 deletions.
71 changes: 39 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,49 @@ CLONED using SOURCETREE from: https://bitbucket.org/young_computation/rose/src/m


#### === Changelog
1) DIRECTORY structure

├── LICENSE.txt

├── README.md

├── ROSE-call.sh : bash wrapper

├── lib

└── ROSE_utils.py : utilities method
│  

└── src

├── ROSE_bamToGFF.py : calculates density of .bam reads in .gff regions

├── ROSE_callSuper.R : ranks regions by their densities, creates cutoff

├── ROSE_geneMapper.py : assigns stitched enhancers to genes

└── ROSE_main.py : main program

Total: 2 directories, 8 files

2) DEPENDENCIES
1. USAGE

- Option 1: To run the program locally and independent of software location by calling ROSE-local.sh
NB: First open ROSE-local.sh and modify PATHTO with the PATH ROSE is installed in.
> ROSE-local.sh ["GTF file"] ["BAM file"] ["OutputDir"] ["feature type"] ["species"] ["bed fileA"] ["bed fileB"]

- Option 2: Add ROSE to user executable $PATH
```bash
PATHTO=/path/to/ROSE
PYTHONPATH=$PATHTO/lib
export PYTHONPATH
export PATH=$PATH:$PATHTO/bin
```

1. Update:

* ROSE is executable independent of software directory location.
* ROSE has a wrapper script "ROSE-local.sh" to successfully execute all steps of the package, else add ROSE to user executable $PATH
* ROSE is compatible with python3

1. DIRECTORY structure
```
├── LICENSE.txt
├── README.md
├── ROSE-local.sh : bash wrapper
├── bin
│   ├── ROSE_bamToGFF.py : calculates density of .bam reads in .gff regions
│   ├── ROSE_callSuper.R : ranks regions by their densities, creates cutoff
│   ├── ROSE_geneMapper.py : assigns stitched enhancers to genes
│   └── ROSE_main.py : main program
└── lib
└── ROSE_utils.py : utilities method

Total: 2 directories, 8 files
```
1. DEPENDENCIES

* samtools
* R version > 3.4
* bedtools > 2
* python3

3) USAGE

Program is run by calling ROSE-call.sh
NB: First modify PATHTO with your own directory.
> ROSE-call.sh ["GTF file"] ["BAM file"] ["OutputDir"] ["feature type"] ["species"] ["bed fileA"] ["bed fileB"]
=================================================================
99 changes: 99 additions & 0 deletions ROSE-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#!/bin/bash
#
# Rose Caller to detect both Enhancers and Super-Enhancers
#
# Version 1 11/16/2019

##############################################################
# ##### Please replace PATHTO with your own directory ###### #
##############################################################
PATHTO=/path/to/ROSE
PYTHONPATH=$PATHTO/lib
export PYTHONPATH
export PATH=$PATH:$PATHTO/bin

if [ $# -lt 7 ]; then
echo ""
echo 1>&2 Usage: $0 ["GTF file"] ["BAM file"] ["OutputDir"] ["feature type"] ["species"] ["bed fileA"] ["bed fileB"]
echo ""
exit 1
fi

#================================================================================
#Parameters for running

# GTF files
GTFFILE=$1

# BAM file
BAMFILE=$2

# Output Directory
OUTPUTDIR=$3
OUTPUTDIR=${OUTPUTDIR:=ROSE_out}

# Feature type
FEATURE=$4
FEATURE=${FEATURE:=gene}

# Species
SPECIES=$5
SPECIES=${SPECIES:=hg_19}

# Bed File A
FILEA=$6

# Bed File B
FILEB=$7

# Transcription Start Size Window
#TSS=
TSS=${TSS:=2000}

# Maximum linking distance for stitching
#STITCH=
STITCH=${STITCH:=12500}


echo "#############################################"
echo "###### ROSE v1 ######"
echo "#############################################"

echo "Input Bed File A: $FILEA"
echo "Input Bed File B: $FILEB"
echo "BAM file: $BAMFILE"
echo "Output directory: $OUTPUTDIR"
echo "Species: $SPECIES"
echo "Feature type: $FEATURE"
#================================================================================
#
# GENERATING UCSC REFSEQ FILE
#
mkdir -p annotation
echo -e "#bin\tname\tchrom\tstrand\ttxStart\ttxEnd\tcdsStart\tcdsEnd\tX\tX\tX\t\tX\tname2" > annotation/$SPECIES"_refseq.ucsc"

if [[ $FEATURE == "gene" ]]; then
awk -F'[\t ]' '{
if($3=="gene")
print "0\t" $14 "\tchr" $1 "\t" $7 "\t" $4 "\t" $5 "\t" $4 "\t" $5 "\t.\t.\t.\t.\t" $18}' $GTFFILE | sed s/\"//g >> annotation/$SPECIES"_refseq.ucsc"

elif [[ $FEATURE == "transcript" ]]; then
awk -F'[\t ]' '{
if($3=="transcript")
print "0\t" $14 "\tchr" $1 "\t" $7 "\t" $4 "\t" $5 "\t" $4 "\t" $5 "\t.\t.\t.\t.\t" $18}' $GTFFILE | sed s/\"//g >> annotation/$SPECIES"_refseq.ucsc"
fi
echo "Annotation file: "$SPECIES"_refseq.ucsc"

#
# GENERATING MERGE BED FILES
#
cat $FILEA $FILEB | sort -k1,1 -k2,2n | mergeBed -i - | awk -F\\t '{print $1 "\t" NR "\t\t" $2 "\t" $3 "\t\t.\t\t" NR}' > unionpeaks.gff
echo "Merge Bed file: unionpeaks.gff"
echo

#
# ROSE CALLER
#
ROSE_main.py -s $STITCH -t $TSS -g $SPECIES -i unionpeaks.gff -r $BAMFILE -o $OUTPUTDIR

echo "Done!"

0 comments on commit c7742a8

Please sign in to comment.