#!bin/bash #generate consensus L1PA7-L1HS sed -n "/>L1HS/,/>/p" repeats2_short_names.fa | sed '$d' > L1HS.fa #list of directories and file prefixes ls */*.bed | cut -d"_" -f1 > files.txt #get full length (greater than 5000 nt) cat legend.txt | while read i; do grep "L1PA7" ${i}_RepeatMasker.bed | awk '$3-$2>5000' > ${i}_L1PA7_full.bed; done cat legend.txt | while read i; do twoBitToFa -bed=${i}_L1PA7_full.bed -bedPos https://hgdownload.soe.ucsc.edu/gbdb/${i}.2bit ${i}_L1PA7_full.fa; done cat legend.txt | while read i; do blat RepeatBrowserConsensus/L1PA7.fa ${i}_L1PA7_full.fa ${i}_L1PA7.psl; done pslToBed ${i}_L1PA7.psl temp.bed bedtools sort -i temp.bed > temp_sort.bed bedtools genomecov -bg -split -i temp_sort.bed -g ~/public_html/RepeatBrowser/repeats2_short_names.chrom.sizes > temp.bg bedGraphToBigWig temp.bg ~/public_html/RepeatBrowser/repeats2_short_names.chrom.sizes ${i}_L1PA7.bw