1. copied the gl files to the entropy directory:
cp /uufs/chpc.utah.edu/common/home/u6007910/projects/timema_adaptation/consensus_align/variantcalling/glfiles/timema*.gl ./
2. Ran gl2genest.pl for all 8 species to create the pntest files
perl gl2genest.pl timemaBart.gl
perl gl2genest.pl timemaCali.gl
perl gl2genest.pl timemaChum.gl
perl gl2genest.pl timemaCris.gl
perl gl2genest.pl timemaKnul.gl
perl gl2genest.pl timemaLand.gl
perl gl2genest.pl timemaPodu.gl
perl gl2genest.pl timemaPopp.gl
I did this in the main directory and then moved the files to the species specific folders.
3. R CMD BATCH initq.R
bart 195 3074
cali 77 7858
chum 358 4172
cris 205 196252
knul 89 11139
land 125 8548
podu 255 6000
popp 116 7157
I edited the R script in each directory and then ran the script for each species in the species folder.
4. edited the forkentropy. pl script in each species folder
5. submitted two bash scripts for running entropy
This created hdf5 files for each chain.
6.I then converted the hdf5 files to g and q files as follows. This was by going into each directory
#### g giles ######
#bart
#parameter dimensions for gprob: loci = 3074, ind = 195, genotypes = 3, chains = 3
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K2_bart.txt -p gprob -s 0 -w 0 timema_BartCh*K2.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K3_bart.txt -p gprob -s 0 -w 0 timema_BartCh*K3.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K4_bart.txt -p gprob -s 0 -w 0 timema_BartCh*K4.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K5_bart.txt -p gprob -s 0 -w 0 timema_BartCh*K5.hdf5
#cali parameter dimensions for gprob: loci = 7858, ind = 77, genotypes = 3, chains = 3
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K2_cali.txt -p gprob -s 0 -w 0 timema_CaliCh*K2.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K3_cali.txt -p gprob -s 0 -w 0 timema_CaliCh*K3.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K4_cali.txt -p gprob -s 0 -w 0 timema_CaliCh*K4.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K5_cali.txt -p gprob -s 0 -w 0 timema_CaliCh*K5.hdf5
#chum parameter dimensions for gprob: loci = 4172, ind = 358, genotypes = 3, chains = 3
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K2_chum.txt -p gprob -s 0 -w 0 timema_ChumCh*K2.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K3_chum.txt -p gprob -s 0 -w 0 timema_ChumCh*K3.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K4_chum.txt -p gprob -s 0 -w 0 timema_ChumCh*K4.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K5_chum.txt -p gprob -s 0 -w 0 timema_ChumCh*K5.hdf5
#cris parameter dimensions for gprob: loci = 196252, ind = 205, genotypes = 3, chains = 3
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K2_cris.txt -p gprob -s 0 -w 0 timema_CrisCh*K2.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K3_cris.txt -p gprob -s 0 -w 0 timema_CrisCh*K3.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K4_cris.txt -p gprob -s 0 -w 0 timema_CrisCh*K4.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K5_cris.txt -p gprob -s 0 -w 0 timema_CrisCh*K5.hdf5
#land
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K2_land.txt -p gprob -s 0 -w 0 timema_LandCh*K2.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K3_land.txt -p gprob -s 0 -w 0 timema_LandCh*K3.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K4_land.txt -p gprob -s 0 -w 0 timema_LandCh*K4.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K5_land.txt -p gprob -s 0 -w 0 timema_LandCh*K5.hdf5
#knul parameter dimensions for gprob: loci = 11139, ind = 89, genotypes = 3, chains = 3
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K2_knul.txt -p gprob -s 0 -w 0 timema_KnulCh*K2.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K3_knul.txt -p gprob -s 0 -w 0 timema_KnulCh*K3.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K4_knul.txt -p gprob -s 0 -w 0 timema_KnulCh*K4.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K5_knul.txt -p gprob -s 0 -w 0 timema_KnulCh*K5.hdf5
#popp parameter dimensions for gprob: loci = 7157, ind = 116, genotypes = 3, chains = 3
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K2_popp.txt -p gprob -s 0 -w 0 timema_PoppCh*K2.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K3_popp.txt -p gprob -s 0 -w 0 timema_PoppCh*K3.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K4_popp.txt -p gprob -s 0 -w 0 timema_PoppCh*K4.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K5_popp.txt -p gprob -s 0 -w 0 timema_PoppCh*K5.hdf5
#podu
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K2_podu.txt -p gprob -s 0 -w 0 timema_PoduCh*K2.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K3_podu.txt -p gprob -s 0 -w 0 timema_PoduCh*K3.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K4_podu.txt -p gprob -s 0 -w 0 timema_PoduCh*K4.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o g_K5_podu.txt -p gprob -s 0 -w 0 timema_PoduCh*K5.hdf5
#### q files ###
#bart
#parameter dimensions for q: loci = 3074, ind = 195, genotypes = 3, chains = 3
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K2_bart.txt -p q -s 0 -w 0 timema_BartCh*K2.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K3_bart.txt -p q -s 0 -w 0 timema_BartCh*K3.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K4_bart.txt -p q -s 0 -w 0 timema_BartCh*K4.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K5_bart.txt -p q -s 0 -w 0 timema_BartCh*K5.hdf5
#cali parameter dimensions for q: loci = 7858, ind = 77, genotypes = 3, chains = 3
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K2_cali.txt -p q -s 0 -w 0 timema_CaliCh*K2.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K3_cali.txt -p q -s 0 -w 0 timema_CaliCh*K3.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K4_cali.txt -p q -s 0 -w 0 timema_CaliCh*K4.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K5_cali.txt -p q -s 0 -w 0 timema_CaliCh*K5.hdf5
#chum parameter dimensions for q: loci = 4172, ind = 358, genotypes = 3, chains = 3
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K2_chum.txt -p q -s 0 -w 0 timema_ChumCh*K2.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K3_chum.txt -p q -s 0 -w 0 timema_ChumCh*K3.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K4_chum.txt -p q -s 0 -w 0 timema_ChumCh*K4.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K5_chum.txt -p q -s 0 -w 0 timema_ChumCh*K5.hdf5
#cris parameter dimensions for q: loci = 196252, ind = 205, genotypes = 3, chains = 3
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K2_cris.txt -p q -s 0 -w 0 timema_CrisCh*K2.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K3_cris.txt -p q -s 0 -w 0 timema_CrisCh*K3.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K4_cris.txt -p q -s 0 -w 0 timema_CrisCh*K4.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K5_cris.txt -p q -s 0 -w 0 timema_CrisCh*K5.hdf5
#land
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K2_land.txt -p q -s 0 -w 0 timema_LandCh*K2.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K3_land.txt -p q -s 0 -w 0 timema_LandCh*K3.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K4_land.txt -p q -s 0 -w 0 timema_LandCh*K4.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K5_land.txt -p q -s 0 -w 0 timema_LandCh*K5.hdf5
#knul parameter dimensions for q: loci = 11139, ind = 89, genotypes = 3, chains = 3
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K2_knul.txt -p q -s 0 -w 0 timema_KnulCh*K2.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K3_knul.txt -p q -s 0 -w 0 timema_KnulCh*K3.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K4_knul.txt -p q -s 0 -w 0 timema_KnulCh*K4.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K5_knul.txt -p q -s 0 -w 0 timema_KnulCh*K5.hdf5
#popp parameter dimensions for q: loci = 7157, ind = 116, genotypes = 3, chains = 3
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K2_popp.txt -p q -s 0 -w 0 timema_PoppCh*K2.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K3_popp.txt -p q -s 0 -w 0 timema_PoppCh*K3.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K4_popp.txt -p q -s 0 -w 0 timema_PoppCh*K4.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K5_popp.txt -p q -s 0 -w 0 timema_PoppCh*K5.hdf5
#podu
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K2_podu.txt -p q -s 0 -w 0 timema_PoduCh*K2.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K3_podu.txt -p q -s 0 -w 0 timema_PoduCh*K3.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K4_podu.txt -p q -s 0 -w 0 timema_PoduCh*K4.hdf5
/uufs/chpc.utah.edu/common/home/u6000989/bin/estpost_entropy -o q_K5_podu.txt -p q -s 0 -w 0 timema_PoduCh*K5.hdf5
6. create population order files
#for loop to creat temp pops from the gl files
for i in */*gl; do cat $i | head -2 | tail -1 > "${i}_temppops.txt"; done
# In R
popfiles<-list.files(pattern="pops.txt", all.files=T, full.names=T, recursive=T)
for (x in popfiles){
xt <- read.table(x, sep = " ", header=F)
newx <- t(xt)
write.table(newx, file=paste(x,"t", sep="_"), quote=F, row.names=F,col.names=F)
}
In bash:
for i in */*_t; do cat $i | cut -d"_" -f 1 > "${$i}_poporder.txt"; done
#renaming
mv bart/timemaBart.gl_temppops.txt_t_poporder.txt bart/bart_poporder.txt
mv cali/timemaCali.gl_temppops.txt_t_poporder.txt cali/cali_poporder.txt
mv chum/timemaChum.gl_temppops.txt_t_poporder.txt chum/chum_poporder.txt
mv cris/timemaCris.gl_temppops.txt_t_poporder.txt cris/cris_poporder.txt
mv knul/timemaKnul.gl_temppops.txt_t_poporder.txt knul/knul_poporder.txt
mv land/timemaLand.gl_temppops.txt_t_poporder.txt land/land_poporder.txt
mv podu/timemaPodu.gl_temppops.txt_t_poporder.txt podu/podu_poporder.txt
mv popp/timemaPopp.gl_temppops.txt_t_poporder.txt popp/popp_poporder.txt