]> git.donarmstrong.com Git - using_make_for_science.git/blobdiff - using_make_for_science.Rnw
show how to handle timestamps
[using_make_for_science.git] / using_make_for_science.Rnw
index f418d490cc5469f5e1a98d21f88295d5c410ccfe..29df3764fdd518e8ea610cde87bc363646b76fc9 100644 (file)
@@ -336,13 +336,13 @@ $(SRX)_star.bam:
        $(MODULE) load STAR/2.4.2a; \
        mkdir -p $(SRX)_star; \
        STAR --outFileNamePrefix $(SRX)_star/ \
-               --outSAMtype BAM SortedByCoordinate \
-               --runThreadN $(CORES) \
-        --outSAMstrandField intronMotif \
-               --genomeDir $(STAR_INDEX_DIR) \
-               --readFilesCommand "gzip -dc" \
-               --readFilesIn $(TOPHAT_FASTQ_ARGUMENT);
-       ln $(SRX)_star/Aligned.sortedByCoord.out.bam $@ -s
+       --outSAMtype BAM SortedByCoordinate \
+       --runThreadN $(CORES) \
+       --outSAMstrandField intronMotif \
+       --genomeDir $(STAR_INDEX_DIR) \
+       --readFilesCommand "gzip -dc" \
+       --readFilesIn $(TOPHAT_FASTQ_ARGUMENT);
+       ln $(SRX)_star/Aligned.*.bam $@ -s
 \end{minted} %$
   \begin{itemize}
   \item Call STAR with lots of options to do the alignment
@@ -366,24 +366,57 @@ $(SRX)_genes.fpkm_tracking: $(SRX)_star.bam $(BOWTIE_INDEX_DIR)$(GTF)
 \end{frame}
 
 \begin{frame}[fragile]{Run it on biocluster}
-  \begin{minted}[shell]
-for a in SRX*/Makefile; do 
-   (cd $(dirname $a); 
-    MAKE_TARGET=call qsub -q default -v MAKE_TARGET -S /bin/bash \
-      -d "$(pwd)" -l "nodes=1:ppn=8,mem=12G" \
-      ~donarm/uiuc_igb_scripts/run_make
-    );
-done;
-\end{minted} %$
+  \begin{minted}{shell}
+~donarm/uiuc_igb_scripts/dqsub --mem 70G \
+   --ppn 8 make call;
+\end{minted}
+\begin{itemize}
+\item dqsub is my own qsub wrapper which avoids me having to write
+  little scripts for everything
+\item \url{http://git.donarmstrong.com/?p=uiuc_igb_scripts.git;a=blob;f=dqsub}
+\end{itemize}
 \end{frame}
 
 \section{Why not make?}
 
+\begin{frame}{Why not make?}
+  \begin{itemize}
+  \item Timestamps, not MD5sums
+  \item Complicated workflows
+  \end{itemize}
+\end{frame}
+
 \subsection{Timestamps}
 
+\begin{frame}{Dealing with timestamps}
+  \begin{itemize}
+  \item Make builds things on the basis of timestamps
+  \item But what if the contents haven't changed and it's expensive to
+    rebuild?
+  \item Use md5sum!
+  \end{itemize}
+\begin{minted}[showtabs,breaklines]{make}
+TARGET: PREREQ1 PREREQ1
+       if [ -e $@.target.md5sum ] && [ -e $@ ] && \
+       md5sum --status --check $@.target.md5sum; \
+    then \
+        touch $@; \
+       else \
+           RECIPE FOR $@; \
+               md5sum $^ > $@.target.md5sum; \
+       fi;
+\end{minted}
+\end{frame}
+
 \subsection{Complicated Workflows}
 
+\begin{frame}{Complicated Workflow}
+  
+\end{frame}
+
 \section{Further Resources}
 
+\begin{frame}{Further Resources}
+\end{frame}
 
 \end{document}