Skip to content

Commit

Permalink
fix templates
Browse files Browse the repository at this point in the history
  • Loading branch information
mjoppich committed Mar 13, 2019
1 parent 53a548e commit 29df8c8
Show file tree
Hide file tree
Showing 4 changed files with 497 additions and 17 deletions.
2 changes: 1 addition & 1 deletion install_templates/install_canu.igui
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fi

if [ -d "$PROGDIR/$PROG" ]; then
echo "Removing Folder $PROGDIR/$PROG"
#rm -rf $PROGDIR/$PROG
rm -rf $PROGDIR/$PROG
fi

## create progdir
Expand Down
192 changes: 192 additions & 0 deletions install_templates/install_featurecounts.igui
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
#! Install featureCounts (github)



if [ ! "$2" = "" ]; then

if [ "$(uname)" == "Darwin" ]; then

echo "Installing brew gcc"
brew install gcc

alias gcc='gcc-8'
alias g++='g++-8'

else

echo "No dependencies"

fi

else
echo "No sudo password, not installing dependencies"
fi


## set all variables
PROG=featureCounts
PROGDIR=$1



if [ -z "${PROGDIR}" ]; then
PROGDIR=~/bioGUI/progs/
fi


PROGDIRESC=$(echo $PROGDIR | sed 's/ /\\ /g')
APPBINARYDIR=${PROGDIR}/${PROG}/bin/

if [ -d "$PROGDIR/$PROG" ]; then
echo "Removing Folder $PROGDIR/$PROG"
rm -rf "$PROGDIR/$PROG"
fi

## create progdir
mkdir -p "$PROGDIR/$PROG"

#download and unzip
#wget https://sourceforge.net/projects/subread/files/subread-1.6.3/subread-1.6.3-source.tar.gz/download -O subread.tar.gz

tar xfz subread.tar.gz -C "$PROGDIR/$PROG/"

cd "$PROGDIR"/$PROG/

mv */* .

cd "$PROGDIR/$PROG/src"

if [ "$(uname)" == "Darwin" ]; then
make -f Makefile.MacOS
else
make -f Makefile.Linux
fi


if [ $# -gt 2 ]; then
if [ "$3" = "1" ]; then

if ! grep -q "$PROGDIRESC/$PROG/bin/" ~/.bashrc; then
echo "export PATH=\"$PROGDIRESC/$PROG/bin/:\$PATH\" " >> ~/.bashrc;
fi
fi
fi



if [ $# -eq 5 ]; then

IP=$4
PORT=$5

echo "Sending Template to $IP at $PORT"


NCCMD=""

if [ "$(uname)" == "Darwin" ]; then
NCCMD="nc -c $IP $PORT"
else
NCCMD="nc -q 0 $IP $PORT"
fi


$NCCMD <<EOF

<template description="featureCounts (subread)" title="featureCounts">

<window width="500" height="1000" title="featureCounts">

<vgroup>


<group title="Alignment Options">


<label>Input Annotation</label> <filedialog id="featureCounts_annotation" output="false">Select Input Annotation (GTF/GFF)</filedialog>
<label>Output File</label> <filedialog id="featureCounts_output" output="true">Select Output Count-File</filedialog>

<label>Input Files</label> <filedialog id="featureCounts_input" output="false" multiples="true" multiples_delim=";">Select Input Files (sam or bam)</filedialog>

<label>Program Mode (not all options used in all modes)</label>
<combobox id="featureCounts_annot_format" selected="GTF">
<comboitem value="GTF">GTF or compatible GFF</comboitem>
<comboitem value="SAF">SAF format</comboitem>
</combobox>


<label>Feature type</label><input id="featureCounts_feature_type">exon</input>


<label>Additional Options</label><input id="featureCounts_options"></input>


<action program="featureCounts" hint="click here to run program">Run featureCounts</action>
</group>


<group title="General Options">
<label>Run in WSL on Windows?</label><checkbox id="WSLsel" value="true" selectonwindows="true">Run in WSL?</checkbox>
<label>Threads</label><input id="featureCounts_threads" type="int">1</input>
</group>

<streambox id="output1">
<stream id="outputstream1">OS1</stream>
<stream id="outputstream2">OS2</stream>
</streambox>


</vgroup>

</window>



<execution>

<const id="bindir">${APPBINARYDIR}/</const>


<relocate id="featureCounts_annotation_rel" from="\${featureCounts_annotation}" wsl="\${WSLsel}"/>
<relocate id="featureCounts_output_rel" from="\${featureCounts_output}" wsl="\${WSLsel}"/>
<relocate id="featureCounts_input_rel" from="\${featureCounts_input}" sep=" " insep=";" wsl="\${WSLsel}"/>

<add id="args" sep=" ">
<if comp="IS_SET" value1="\${featureCounts_feature_type}" sep=" ">
<const>-t</const>
<value from="\${featureCounts_feature_type}"/>
</if>

<const>-F</const>
<value from="\${featureCounts_annot_format}"/>

<value from="\${featureCounts_options}"/>

<if comp="IS_SET" value1="\${featureCounts_annotation_rel}" sep=" ">
<const>-a</const>
<value from="\${featureCounts_annotation_rel}"/>
</if>

<if comp="IS_SET" value1="\${featureCounts_output_rel}" sep=" ">
<const>-o</const>
<value from="\${featureCounts_output_rel}"/>
</if>

<value from="\${featureCounts_input_rel}"/>

</add>

<execute program="featureCounts" param="\${args}" location="\${bindir}" exec="featureCounts" wsl="WSLsel">
<output type="COUT" color="green" to="outputstream1" />
<output type="CERR" color="red" to="outputstream2" />
</execute>



</execution>
</template>


EOF

fi
86 changes: 70 additions & 16 deletions install_templates/install_mm_asm_racon.igui
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ fi
## create progdir
mkdir -p "$PROGDIR/$PROG"

wget -O "$PROGDIR/$PROG/assemble.sh" https://gist.githubusercontent.com/mjoppich/18b7a07074b59bd34056df6fe7b08d05/raw/505494921348d6dc952148ac6c6d86568c49fe79/mmr_assemble.sh


cd "$PROGDIR/$PROG"
git clone https://github.com/lh3/minimap2 minimap2
Expand Down Expand Up @@ -105,6 +103,52 @@ if [ $# -gt 2 ]; then
fi
fi

APPBINARYDIR=${PROGDIRESC}/${PROG}/

cat <<EOS > $APPBINARYDIR/assemble.sh
#!/usr/bin/sh
INREADS=\$1
ASMFOLDER=\$2
ASMPREFIX=\$3

# path to used executables
MINIMAP2BIN="\${4-minimap2}"
MINIASMBIN="\${5-miniasm}"
GRAPHMAPBIN="\${6-graphmap}"
RACONBIN="\${7-racon}"

THREADS="\${8-4}"

#echo \$INREADS
#echo \$ASMFOLDER
#echo \$ASMPREFIX
#echo \$MINIMAP2BIN
#echo \$MINIASMBIN
#echo \$GRAPHMAPBIN
#echo \$RACONBIN

# first we must overlap all reads with each other
\$MINIMAP2BIN -x ava-ont -t\$THREADS \$INREADS $INREADS > \$ASMFOLDER/\$ASMPREFIX.paf

# then miniasm can create alignment
\$MINIASMBIN -f \$INREADS \$ASMFOLDER/\$ASMPREFIX.paf > \$ASMFOLDER/\$ASMPREFIX.gfa

# extract unitigs from miniasm
awk '\$1 ~/S/ {print ">"\$2"\n"\$3}' \$ASMFOLDER/\$ASMPREFIX.gfa > \$ASMFOLDER/\$ASMPREFIX.unitigs.fasta

# align reads with unitigs
\$MINIMAP2BIN \$ASMFOLDER/\$ASMPREFIX.unitigs.fasta \$INREADS > \$ASMFOLDER/\$ASMPREFIX.unitigs.paf

# find contigs from unitigs
\$RACONBIN \$INREADS \$ASMFOLDER/\$ASMPREFIX.unitigs.paf \$ASMFOLDER/\$ASMPREFIX.unitigs.fasta > \$ASMFOLDER/\$ASMPREFIX.contigs.fasta

\$MINIMAP2BIN -x map-ont -a -t\$THREADS \$ASMFOLDER/\$ASMPREFIX.contigs.fasta \$INREADS > \$ASMFOLDER/\$ASMPREFIX.reads.mm2.sam
\$GRAPHMAPBIN align -r \$ASMFOLDER/\$ASMPREFIX.contigs.fasta -d \$INREADS -o \$ASMFOLDER/\$ASMPREFIX.reads.gm.sam


EOS




if [ $# -eq 5 ]; then
Expand All @@ -125,9 +169,7 @@ fi

$NCCMD <<EOF

<!--<?xml version="1.0" encoding="UTF-8")>-->

<template description="minimap/miniasm/racon assembly pipeline" title="graphmap">
<template description="minimap/miniasm/racon assembly pipeline" title="MiMiRa">

<window width="500" height="1000" title="MiMiRa">

Expand All @@ -137,8 +179,8 @@ $NCCMD <<EOF
<group title="Assembly Options">


<label>Input Reads</label> <filedialog id="assembly_reads" output="false">Select Input Reference (fq)</filedialog>
<label>Input Folder</label> <filedialog id="assembly_dir" output="false" folder="true">Select Assembly Folder</filedialog>
<label>Input Reads (Fastq)</label> <filedialog id="assembly_reads" output="false">Select Input Reference (fq)</filedialog>
<label>Assembly/Output Folder</label> <filedialog id="assembly_dir" output="false" folder="true">Select Assembly Folder</filedialog>

<label>Assembly Prefix</label><input id="assembly_prefix"></input>

Expand All @@ -164,30 +206,42 @@ $NCCMD <<EOF


<execution>

<const id="bindir">${APPBINARYDIR}/</const>


<relocate id="assembly_reads_rel" from="\${assembly_reads}" wsl="\${WSLsel}"/>
<relocate id="assembly_dir_rel" from="\${assembly_dir}" wsl="\${WSLsel}"/>

<add id="args">

<value from="\${assembly_reads}"/>
<value from="\${assembly_dir}"/>
<value from="\${assembly_prefix}"/>
<const>${APPBINARYDIR}/assemble.sh</const>
<value from="\${assembly_reads_rel}"/>
<value from="\${assembly_dir_rel}"/>
<value from="\${assembly_prefix}"/>
<add sep="/">
<value from="\${bindir}"/>
<const>minimap2/minimap2</const>
</add>
<add sep="/">
<value from="\${bindir}"/>
<const>miniasm/miniasm</const>
</add>
<add sep="/">
<value from="\${bindir}"/>
<const>graphmap/bin/Linux-x64/graphmap</const>
</add>
<add sep="/">
<value from="\${bindir}"/>
<const>racon/build/bin/racon</const>
</add>

<if comp="IS_SET" value1="\${assembly_threads}">
<value from="\${assembly_threads}"/>
</if>

</add>

<execute program="graphmap" param="\${args}" location="\${bindir}" exec="graphmap" wsl="WSLsel">
<execute program="assembly" param="bash \${args}" location="/usr/bin/" exec="env" wsl="WSLsel">
<output type="COUT" color="green" to="outputstream1" />
<output type="CERR" color="red" to="outputstream2" />
</execute>



</execution>
Expand Down

0 comments on commit 29df8c8

Please sign in to comment.