Skip to content
Snippets Groups Projects
Commit b2618dd9 authored by Holger Brandl's avatar Holger Brandl
Browse files

continued star wrapper

parent 80340742
No related branches found
No related tags found
No related merge requests found
...@@ -165,7 +165,7 @@ wait4jobs .tophatjobs ...@@ -165,7 +165,7 @@ wait4jobs .tophatjobs
dge_bam_correlate . dge_bam_correlate . &
## create tophat mapping report ## create tophat mapping report
spin.R ${NGS_TOOLS}/dge_workflow/tophat_qc.R . spin.R ${NGS_TOOLS}/dge_workflow/tophat_qc.R .
......
...@@ -5,14 +5,23 @@ ...@@ -5,14 +5,23 @@
usage=' usage='
Use star to align fastq files against a genome Use star to align fastq files against a genome
Usage: star_align.sh <igenome> <fastq_files>... Usage: star_align.sh <igenome> <fastq_files>
Options: Options:
-c Cache results
' '
#-c Cache results
eval $(echo "$usage" | ~/bin/docopts/docopts -h - -A dopts : "$@") #eval $(echo "$usage" | ~/bin/docopts/docopts -h - -A dopts : "$@")
#eval $(echo "$usage" | ~/bin/docopts/docopts -h - : /projects/bioinfo/igenomes/Mus_musculus/Ensembl/GRCm38 /projects/bioinfo/holger/projects/florio_11b_2nd_batch/lanereps_pooled/arhgap11b_1.fastq.gz) #echo "$usage" | ~/bin/docopts/docopts -h - : "$@"
#echo "$usage" | ~/bin/docopts/docopts -h - : "hallo dfds"
#eval $(echo $usage | ~/bin/docopts/docopts -h - : "$@")
#eval(exit 64)
eval "$(echo "$usage" | ~/bin/docopts/docopts -h - : "$@")"
# v0.7 style
#eval $(echo "$usage" | /home/brandl/bin/docopts_v0.7/docopts "hallo")
#eval "$(echo "$usage" | ~/bin/docopts/docopts -h - : /projects/bioinfo/igenomes/Mus_musculus/Ensembl/GRCm38 /projects/bioinfo/holger/projects/florio_11b_2nd_batch/lanereps_pooled/arhgap11b_1.fastq.gz)"
#for fastqFile in ${fastq_files[@]} ; do #for fastqFile in ${fastq_files[@]} ; do
# echo processing $fastqFile # echo processing $fastqFile
...@@ -21,34 +30,33 @@ eval $(echo "$usage" | ~/bin/docopts/docopts -h - -A dopts : "$@") ...@@ -21,34 +30,33 @@ eval $(echo "$usage" | ~/bin/docopts/docopts -h - -A dopts : "$@")
#echo $igenome #echo $igenome
## build index if not present fastqFiles=${fastq_files[@]}
#echo $fastqFiles
export star_index="${igenome}/Sequence/StarIndex"
export star_index="$igenome/Sequence/StarIndex/genome"
export gtfFile="$igenome/Annotation/Genes/genes.gtf" export gtfFile="$igenome/Annotation/Genes/genes.gtf"
head $gtfFile #head $gtfFile
if [ ! -f $gtfFile ]; then if [ ! -f $gtfFile ]; then
>&2 echo "gtf '$gtfFile' does not exis"; exit 1; >&2 echo "gtf '$gtfFile' does not exis"; exit 1;
fi fi
## basic ## basic usage tutorial
#http://www.homolog.us/blogs/blog/2012/11/02/star-really-kick-ass-rna-seq-aligner/ #http://www.homolog.us/blogs/blog/2012/11/02/star-really-kick-ass-rna-seq-aligner/
if ! -d "${igenome}/Sequence/StarIndex" ]; then ## build index if not present
if ! -d "${star_index}" ]; then
mailme "${project}: creating STAR index for $igenome" mailme "${project}: creating STAR index for $igenome"
mkdir ${igenome}/Sequence/StarIndex mkdir ${star_index}
cmd="STAR --runMode genomeGenerate --genomeDir ${igenome}/Sequence/StarIndex --genomeFastaFiles ${igenome}/Sequence/WholeGenomeFasta/genome.fa --runThreadN 10" cmd="STAR --runMode genomeGenerate --genomeDir ${star_index} --genomeFastaFiles ${igenome}/Sequence/WholeGenomeFasta/genome.fa --runThreadN 10"
#eval $cmd #eval $cmd
#STAR --runMode genomeGenerate --genomeDir ${igenome}/Sequence/StarIndex --genomeFastaFiles ${igenome}/Sequence/Chromosomes/*.fa --runThreadN 10 #STAR --runMode genomeGenerate --genomeDir ${star_index} --genomeFastaFiles ${igenome}/Sequence/Chromosomes/*.fa --runThreadN 10
mysub "${project}_star_index" "$cmd" -n 5 -R span[hosts=1] -q medium | blockScript mysub "${project}_star_index" "$cmd" -n 5 -R span[hosts=1] -q medium | blockScript
## prevent modification ## prevent modification
chmod -R -w ${igenome}/Sequence/StarIndex chmod -R -w ${star_index}
fi fi
...@@ -70,7 +78,7 @@ ll $fastqFiles ...@@ -70,7 +78,7 @@ ll $fastqFiles
for fastqFile in $fastqFiles ; do for fastqFile in $fastqFiles ; do
echo "submitting tophat job for $fastqFile" echo "submitting tophat job for $fastqFile"
# DEBUG fastqFile=/projects/bioinfo/holger/projects/helin/mouse/trimmed/mouse_big_cyst_rep4_ca.fastq.gz # DEBUG fastqFile=/projects/bioinfo/holger/projects/florio_11b_2nd_batch/lanereps_pooled/arhgap11b_1.fastq.gz
fastqBaseName=$(basename ${fastqFile%%.fastq.gz}) fastqBaseName=$(basename ${fastqFile%%.fastq.gz})
outputdir=$fastqBaseName outputdir=$fastqBaseName
...@@ -80,7 +88,7 @@ for fastqFile in $fastqFiles ; do ...@@ -80,7 +88,7 @@ for fastqFile in $fastqFiles ; do
## note --outSAMstrandField intronMotif is required for cuffdiff compatiblity (xs flag) ## note --outSAMstrandField intronMotif is required for cuffdiff compatiblity (xs flag)
mysub "${project}__star__${fastqBaseName}" " mysub "${project}__star__${fastqBaseName}" "
# tophat -p6 -G $gtfFile -g1 -o $outputdir $bowtie_gindex $fastqFile # tophat -p6 -G $gtfFile -g1 -o $outputdir $bowtie_gindex $fastqFile
STAR --genomeDir $star_index --readFilesIn /path/to/read1 $fastqFile --runThreadN 6 --outFileNamePrefix $fastqBaseName --outSAMtype BAM SortedByCoordinate --outSAMstrandField intronMotif --sjdbGTFfile STAR --genomeDir $star_index --readFilesIn $fastqFile --runThreadN 6 --readFilesCommand zcat --outFileNamePrefix $fastqBaseName --outSAMtype BAM SortedByCoordinate --outSAMstrandField intronMotif --sjdbGTFfile $gtfFile
" -n 5 -R span[hosts=1] -q long | joblist .tophatjobs " -n 5 -R span[hosts=1] -q long | joblist .tophatjobs
done done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment