linuxbashabyss

abyss-pe: variables to assemble multiple genomes with one command


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.


Solution

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

    I added a single quote before and after the variable