#pipeline for running the rearrangement analysis #1. define phenotypes based on number of lines sharing a segment minshared=5 phenotypesfile='../Phenotypes/trans.phenotypes.'$minshared'.txt' mosaicfile='~/DPhil/Recombination/Results2/Mosaics/MaskedTransposons/mosaic10.highlow.infcoords.clusters.txt' mappingdir='../MappingTranslocations/HaplotypeMode/' pdfdir='../HaplotypeModePlots/' Rscript ./translocation.phenotypes.R ../LikelyTranslocations/likely.translocations.txt $mosaicfile $minshared $phenotypesfile #2. run reconstruction on these phenotypes - in haplotype mode IFS=$'\t'; read -r -a arr < $phenotypesfile; unset arr[0]; N=${#arr[@]}; k=$(($N/10)); l=1; echo ${arr[1]} for ((i=1;i<=10;i++)) do echo 'i='$i cphen='' for ((j=$l;j<=$(($l+$k-1));j++)) do cphen=$cphen${arr[$j]} cphen=$cphen',' done echo $cphen nice ~/magic-genomes/genome_scan -d ~/magic-genomes/ -a ~/magic-genomes/ -f $phenotypesfile -p $cphen -h -w $mappingdir l=$(($l+$k)); done echo 'i=11' cphen='' for ((j=$l;j<=$N;j++)) do cphen=$cphen${arr[$j]} cphen=$cphen',' nice ~/magic-genomes/genome_scan -f $phenotypesfile -p $cphen -h -w $mappingdir done echo $cphen #3. plot qtls Rscript ./plot.translocation.qtl.R $mappingdir $pdfdir $mosaicfile $phenotypesfile #4.investigate if they are translocations python trans.from.qtls-new.py #5.classify them - for the non-translocations find out if they are related to inversions or duplications - by examining strandedness and read coverage #6.for the translocations make mapping plots - that show the distribution of reads and the structure of the rearrangement