-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPost_ORF_ReMap_Clean.sh
More file actions
70 lines (56 loc) · 1.94 KB
/
Post_ORF_ReMap_Clean.sh
File metadata and controls
70 lines (56 loc) · 1.94 KB
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
64
65
66
67
68
69
70
#!/bin/bash
#SBATCH --partition=Orion
#SBATCH --time=47:00:00
#SBATCH --mem=64GB
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
cd /scratch/nkrell/ReMap_Trimmed_Genes/blast
#merge TAAR and OR data
for file in *_chemo.tblastn
do
cat "$file" "${file%.*}".blastn > "$file".merged.chemo.blastn
done
#this is changed because the TAARs arent being run
for file in *_chemo.blastn
do
mv "$file" "$file".merged.chemo.blastn
done
module load bedtools2
module load blast
cd /scratch/nkrell/ReMap_Trimmed_Genes/blast
for file in *.merged.chemo.blastn
do
python /projects/yohe_lab/genomeGTFtools-master/blast2gff.py -b "$file" -F -l 100 -s 0.2 > "${file%.*}".output.gff3
done
python3 /scratch/nkrell/ReMap_Trimmed_Genes/ReMap_Info_Preserver.py
cd /scratch/nkrell/ReMap_Trimmed_Genes/blast
for file in *.gff3.info
do
awk -vOFS='\t' '{$3 = $9; print}' "$file" > "$file".name
done
cd /scratch/nkrell/ReMap_Trimmed_Genes/blast
for file in *.output.gff3.info.name
do
bedtools getfasta -fi /scratch/nkrell/ReMap_Trimmed_Genes/GCF_009914755.1_T2T-CHM13v2.0_genomic.fna -bed /scratch/nkrell/ReMap_Trimmed_Genes/blast/"$file" -s -name -fo /scratch/nkrell/ReMap_Trimmed_Genes/blast/"$file".fa.out
done
#remove exact duplicates
for file in *.out
do
~/bbmap/dedupe.sh in="$file" out="${file%.*.*}".fasta ow=t
done
#move to your home directory
cd ~/ora-1.9.1/scripts
for file in /scratch/nkrell/ReMap_Trimmed_Genes/blast/*.name.fasta
do
perl or.pl -sequence "$file" -a -d --sub "$file".sub.fasta > "$file".ORs.fasta
done
#remove empty first line from fasta file to make up for ORA bug
#this can be run repeatedly without any dataloss
#I added this script to the genomeGTFtools folder for organization
cd /scratch/nkrell/ReMap_Trimmed_Genes/blast
python3 /projects/yohe_lab/genomeGTFtools-master/ORA_Fix.py
#re-remove duplicates
for file in *.fixed.fasta
do
~/bbmap/dedupe.sh in="$file" out="${file%.*.*.*}".ORs.clean.fasta ow=t
done