1

How do I rewrite the following to properly replace the variable with my genomeID? (I have it working with this method in Spades and Masurca assemblers, so it's something about Abyss that doesnt like this approach and I need a work-around)

I am trying to run abyss on a cluster server but am running into trouble with how abyss-pe is reading my variable input:

  1. my submit file loads a script for each genome listed in a .txt file
  2. my script writes in the genome name throughout the script
  3. the abyss assembly fumbles the variable replacement

Input.sub:

queue genomeID from genomelisttest.txt

Input.sh:

#!/bin/bash
genomeID=$1
cp /mnt/gluster/harrow2/trim_output/${genomeID}_trim.tar.gz ./
tar -xzf ${genomeID}_trim.tar.gz
rm ${genomeID}_trim.tar.gz
for k in `seq 86 10 126`; do
    mkdir k$k
    abyss-pe -C k$k name=${genomeID} k=$k lib='pe1 pe2' pe1='../${genomeID}_trim/${genomeID}_L1_1.fq.gz ../${genomeID}_trim/${genomeID}_L1_2.fq.gz' pe2='../${genomeID}_trim/${genomeID}_L2_1.fq.gz ../${genomeID}_trim/${genomeID}_L2_2.fq.gz' 
done

Error that I get:

`../enome_trim/enome_L1_1.fq.gz': No such file or directory

This is where "enome" is supposed to replace with a five digit genomeID, which happens properly in the earlier part of the script up to this point, where abyss comes in.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
  • `pe1='../${genomeID}_trim/${genomeID}_L1_1.fq.gz ...'` - `${genomeID}` is probably not replaced due to single quote. You may need double quote for shell replacement (if that is what you want). – jww Feb 10 '19 at 23:28
  • ive tried it also with "$genomeID" and gotten the same results. Do you mean that I should try pe1="..." – AlchemyAdept Feb 10 '19 at 23:38
  • [Expansion of variable inside single quotes in a command in Bash](https://stackoverflow.com/q/13799789/608639), [Difference between single and double quotes in Bash](https://stackoverflow.com/q/6697753/608639), etc – jww Feb 10 '19 at 23:39

1 Answers1

0
pe1='../'"$genomeID"'_trim/'"$genomeID"'_L1_1.fq.gz ...'

I added a single quote before and after the variable