forked from CRG-Beato/utils_beatolab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_fasta_from_bed.sh
executable file
·64 lines (50 loc) · 1.76 KB
/
get_fasta_from_bed.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
#==================================================================================================
# Created on: 2017-12-01
# Usage: ./get_fasta_from_bed.sh
# Author: javier.quilez@crg.eu
# Goal: get FASTA sequence for each entry in a BED file
#==================================================================================================
#==================================================================================================
# CONFIGURATION VARIABLES AND PATHS
#==================================================================================================
# variables
process=get_fasta_from_bed
ibed=$HOME/assemblies/homo_sapiens/hg38/pirna_cluster_db/proTRAC_normal_ovary_and_testis_generic_clusterd_piRNAs.bed
ifa=$HOME/assemblies/homo_sapiens/hg38/ucsc/hg38_chr1-22XYMUn.fa
ofa=$HOME/assemblies/homo_sapiens/hg38/pirna_cluster_db/hg38_pirnas.fa
# Paths
JOB_CMD=$HOME/utils/job_cmd
JOB_OUT=$HOME/utils/job_out
mkdir -p $JOB_CMD
mkdir -p $JOB_OUT
bedtools=`which bedtools`
# CRG cluster parameters
queue=short-sl7
memory=10G
max_time=06:00:00
slots=1
#==================================================================================================
# JOB
#==================================================================================================
# Build job: parameters
job_name=${process}
job_file=$JOB_CMD/$job_name.sh
m_out=$JOB_OUT
echo "#!/bin/bash
#$ -N $job_name
#$ -q $queue
#$ -l virtual_free=$memory
#$ -l h_rt=$max_time
#$ -M javier.quilez@crg.eu
#$ -m abe
#$ -j y
#$ -o $m_out/${job_name}_\$JOB_ID.out
#$ -e $m_out/${job_name}_\$JOB_ID.err
#$ -pe smp $slots" > $job_file
# build kallisto index
job_cmd="$bedtools getfasta -fi $ifa -bed $ibed -fo $ofa"
echo $job_cmd >> $job_file
# Submit job
chmod a+x $job_file
qsub < $job_file