diff --git a/reduced_genome.sh b/reduced_genome.sh index f5f0930..48a4a36 100644 --- a/reduced_genome.sh +++ b/reduced_genome.sh @@ -28,7 +28,7 @@ cat up.txt down.txt > ${genome}_${enzyme}_flanking_sites_${fl}_2.bed awk '{if($2 >= 0 && $3 >=0) print $0}' ${genome}_${enzyme}_flanking_sites_${fl}_2.bed | grep -v -E 'random|JH|GL' - | sort -k1,1 -k2,2n | uniq > ${genome}_${enzyme}_flanking_sites_${fl}_unique_2.bed #get the sequence of unique flanking coordinates fastaFromBed -fi ${genome}.fa -bed ${genome}_${enzyme}_flanking_sites_${fl}_unique_2.bed -fo ${genome}_${enzyme}_flanking_sequences_${fl}_unique_2.fa -#get only sequences from FASTA file +#get only unique sequences from FASTA file grep -v '^>' ${genome}_${enzyme}_flanking_sequences_${fl}_unique_2.fa | sort | uniq -i -u | grep -xF -f - -B 1 ${genome}_${enzyme}_flanking_sequences_${fl}_unique_2.fa | grep -v '^--' > ${genome}_${enzyme}_flanking_sequences_${fl}_unique.fa #remove unwanted intermediate files