#!/bin/bash
# Orftcr.sh

export NA=$1
cd ${NA}

#lowres bin analysis first
printf "${NA}_Cdipy_bk_plus.wig\n${NA}_Cdipy_bk_minus.wig\n" | perl ../cpd_orf_bins.pl >${NA}_Cdipy_bk_tcrbins_matrix.txt

printf "${NA}_Cdipy_bk_tcrbins_matrix.txt\n" | perl ../tcr_bins_allgenes.pl >${NA}_Cdipy_bk_tcrbins_allgenes.txt

#highres analysis second

printf "${NA}_Cdipy_bk_plus.wig\n${NA}_Cdipy_bk_minus.wig\n" | perl ../cpd_orf_highres.pl >${NA}_Cdipy_bk_tcrhires_matrix.txt

printf "${NA}_Cdipy_bk_tcrhires_matrix.txt\n" | perl ../tcr_hires_allgenes.pl >${NA}_Cdipy_bk_tcrhires_allgenes.txt

printf "${NA}_Cdipy_bk_tcrhires_matrix.txt\n" | perl ../tcr_hires_trxsubsets.pl 

printf "${NA}_Cdipy_bk_tcrhires_matrix_less1perhr.txt\n" | perl ../tcr_hires_allgenes.pl >${NA}_Cdipy_bk_tcrhires_less1perhr.txt

printf "${NA}_Cdipy_bk_tcrhires_matrix_1to10perhr.txt\n" | perl ../tcr_hires_allgenes.pl >${NA}_Cdipy_bk_tcrhires_1to10perhr.txt

printf "${NA}_Cdipy_bk_tcrhires_matrix_greater10perhr.txt\n" | perl ../tcr_hires_allgenes.pl >${NA}_Cdipy_bk_tcrhires_greater10perhr.txt

printf "${NA}_Cdipy_bk_plus.wig\n${NA}_Cdipy_bk_minus.wig\n" | perl ../cpd_tts_highres.pl >${NA}_Cdipy_bk_ttshires_matrix.txt

printf "${NA}_Cdipy_bk_ttshires_matrix.txt\n" | perl ../tcr_hires_allgenes.pl >${NA}_Cdipy_bk_ttshires_allgenes.txt

printf "${NA}_Cdipy_bk_ttshires_matrix.txt\n" | perl ../tcr_hires_trxsubsets.pl 

printf "${NA}_Cdipy_bk_ttshires_matrix_less1perhr.txt\n" | perl ../tcr_hires_allgenes.pl >${NA}_Cdipy_bk_ttshires_less1perhr.txt

printf "${NA}_Cdipy_bk_ttshires_matrix_1to10perhr.txt\n" | perl ../tcr_hires_allgenes.pl >${NA}_Cdipy_bk_ttshires_1to10perhr.txt

printf "${NA}_Cdipy_bk_ttshires_matrix_greater10perhr.txt\n" | perl ../tcr_hires_allgenes.pl >${NA}_Cdipy_bk_ttshires_greater10perhr.txt

