#!/bin/bash
# Script to set up maker options file.

## Establish variables for more readable code

### Path to Olympia oyster genome FastA file
oly_genome=../data/oly_genome/Olurida_v081.fa

### Path to Olympia oyster transcriptome FastA file
oly_transcriptome=../data/oly_transcriptome/Olurida_transcriptome_v3.fasta

### Path to combined proteome file
gigas_virginica_ncbi_proteomes=../data/gigas_virginica_ncbi_proteomes.fasta

## Create Maker control files needed for running Maker
maker -CTL

## Store path to options control file
maker_opts_file=./maker_opts.ctl

## Edit options file
### Set paths to O.lurida genome and transcriptome. Set path to combined C. gigas and C.virginica proteomes.
## The use of the % symbol sets the delimiter sed uses for arguments. Normally, the delimiter that most examples use is a slash "/". But, we need to expand the variables into a full 
## path with slashes, which screws up sed. Thus, the use of % symbol instead (it could be any character that is NOT present in the expanded variable; doesn't have to be "%").
sed -i "/^genome=/ s% %$oly_genome %" "$maker_opts_file"
sed -i "/^est=/ s% %$oly_transcriptome %" "$maker_opts_file"
sed -i "/^protein=/ s% %$gigas_virginica_ncbi_proteomes %" "$maker_opts_file"
sed -i "/^repeat_protein=/ s% %#provide a fasta file of transposable element proteins for RepeatRunner%" "$maker_opts_file"
