@@ -69,27 +69,35 @@ The raw data of the `Jakobi et al. 2016 <https://www.sciencedirect.com/science/a
6969
7070 cd workflow/reads
7171
72- # change the default download directory of wonderdump to current directory
73- sed -i ' s/SRA_DIR=~\/ncbi\/public\/sra/SRA_DIR=.\//g' wonderdump.sh
72+ # ... place your copy of wonderdump.sh in this directory ...
73+ # We need to update it slightly:
74+ wget https://raw.githubusercontent.com/dieterich-lab/circtools/master/docs/wonderdump.sh.patch
75+ patch wonderdump.sh < wonderdump.sh.patch
7476
7577 # get list of accession numbers to download
7678 # also get a mapping file from SRA accession to original file name
7779 wget https://data.dieterichlab.org/s/jakobi2016_sra_list/download -O jakobi2016_sra_list.txt
80+ dos2unix jakobi2016_sra_list.txt
7881 wget https://data.dieterichlab.org/s/sra_mapping/download -O mapping.txt
82+ dos2unix mapping.txt
7983
8084 # downloading and rewriting the files as gzipped .fastq files will take some time
8185 # in the end, the process will generate a set of 16 files (8 samples x 2 pairs)
8286
8387 # start wonderdump with the accession list and download data (~29GB)
84- cat jakobi2016_sra_list.txt | xargs -n 1 echo ./wonderdump.sh --split-files --gzip | bash
88+ for i in $( jakobi2016_sra_list.txt )
89+ do
90+ ./wonderdump.sh --split-files --gzip " $i " &
91+ sleep 60
92+ done
8593
8694 # rename files from SRA accessions to file names used throughout this tutorial
8795
8896 # for mate 1:
89- parallel --link ln -s {2}_1.fastq {1}1.fastq :::: mapping.txt :::: jakobi2016_sra_list.txt
97+ parallel --link ln -s {2}_1.fastq.gz {1}1.fastq.gz :::: mapping.txt :::: jakobi2016_sra_list.txt
9098
9199 # for mate 2:
92- parallel --link ln -s {2}_2.fastq {1}2.fastq :::: mapping.txt :::: jakobi2016_sra_list.txt
100+ parallel --link ln -s {2}_2.fastq.gz {1}2.fastq.gz :::: mapping.txt :::: jakobi2016_sra_list.txt
93101
94102
95103
@@ -169,17 +177,28 @@ Essentially, the wrapper script for STAR performs the following tasks:
169177* Map the unmapped reads of read 1 or read 2 again against the reference genome without the corresponding paired partner
170178* Several conversion and cleanup steps of the STAR output
171179
180+ Please note that the supplied examples are a little aged and will not work with the latest STAR version. Version 2.6.1d is known to work while version 2.7.0f and newer does not.
181+
172182.. code-block :: bash
173183
174184 # download wrapper for STAR
175185 wget https://raw.githubusercontent.com/dieterich-lab/bioinfo-scripts/master/slurm_circtools_detect_paired_mapping.sh
176186 chmod 755 slurm_circtools_detect_paired_mapping.sh
187+
188+ To allow this script to work the following changes are needed:
189+
190+ * Remove the '--chimMultimapNmax 20' options.
191+ * Change the '--chimOutType' options to '--chimOutType Junctions SeparateSAMold'.
192+
193+ .. code-block :: bash
177194 mkdir star/
178195 # obtain the annotation of the mouse genome for splice junctions
179196 wget ftp://ftp.ensembl.org/pub/release-90/gtf/mus_musculus/Mus_musculus.GRCm38.90.gtf.gz
180197 gzip -d Mus_musculus.GRCm38.90.gtf.gz
181198 cd rrna/
182- pd -j1 --xapply ../slurm_circtools_detect_paired_mapping.sh ../folder/to/star/index/ {1} {2} ../star/ .1 ../Mus_musculus.GRCm38.90.gtf
199+ ls -1 ALL_* .1.gz > input1
200+ ls -1 ALL_* .2.gz > input2
201+ parallel --gnu --xapply ../slurm_circtools_detect_paired_mapping.sh ../folder/to/star/index/ {1} {2} ../star/ .1 ../Mus_musculus.GRCm38.90.gtf :::: input1 :::: input2
183202
184203
185204 Manual mapping process
@@ -237,7 +256,7 @@ In a first step the paired-end data is mapped by using both mates. If the data i
237256 # Create a directory for mate1
238257 $ mkdir mate1
239258 $ cd mate1
240- $ $ STAR --runThreadN 10\
259+ $ STAR --runThreadN 10\
241260 --genomeDir [genome]\
242261 --genomeLoad NoSharedMemory\
243262 --readFilesIn Sample1_1.fastq.gz\
@@ -274,7 +293,7 @@ In a first step the paired-end data is mapped by using both mates. If the data i
274293 # Create a directory for mate2
275294 $ mkdir mate2
276295 $ cd mate2
277- $ $ STAR --runThreadN 10\
296+ $ STAR --runThreadN 10\
278297 --genomeDir [genome]\
279298 --genomeLoad NoSharedMemory\
280299 --readFilesIn Sample1_2.fastq.gz\
@@ -335,15 +354,15 @@ We first create a new folder for the circtools detection step and populate that
335354 cd star/
336355
337356 # link aligned reads (bam files) and indexing files for the aligned reads (.bai)
338- parallel --plus ln -s ` pwd` /{}/Aligned.noS.bam /scratch/tjakobi/circtools_workflow/workflow /circtools/01_detect/{}.bam ::: ALL_1654_*
339- parallel --plus ln -s ` pwd` /{}/Aligned.noS.bam.bai /scratch/tjakobi/circtools_workflow/workflow /circtools/01_detect/{}.bam.bai ::: ALL_1654_*
357+ parallel --plus ln -s $( pwd) /{}/Aligned.noS.bam $( dirname $( pwd ) ) /circtools/01_detect/{}.bam ::: ALL_1654_*
358+ parallel --plus ln -s $( pwd) /{}/Aligned.noS.bam.bai $( dirname $( pwd ) ) /circtools/01_detect/{}.bam.bai ::: ALL_1654_*
340359
341360 # link chimeric junction files of the main mapping
342- parallel --plus ln -s ` pwd` /{}/Chimeric.out.junction /scratch/tjakobi/circtools_workflow/workflow /circtools/01_detect/{}.Chimeric.out.junction ::: ALL_1654_*
361+ parallel --plus ln -s $( pwd) /{}/Chimeric.out.junction $( dirname $( pwd ) ) /circtools/01_detect/{}.Chimeric.out.junction ::: ALL_1654_*
343362
344363 # link chimeric junction files of the single mappings
345- parallel --plus ln -s ` pwd` /{}/mate1/Chimeric.out.junction /scratch/tjakobi/circtools_workflow/workflow /circtools/01_detect/{}.mate1.Chimeric.out.junction ::: ALL_1654_*
346- parallel --plus ln -s ` pwd` /{}/mate2/Chimeric.out.junction /scratch/tjakobi/circtools_workflow/workflow /circtools/01_detect/{}.mate2.Chimeric.out.junction ::: ALL_1654_*
364+ parallel --plus ln -s $( pwd) /{}/mate1/Chimeric.out.junction $( dirname $( pwd ) ) /circtools/01_detect/{}.mate1.Chimeric.out.junction ::: ALL_1654_*
365+ parallel --plus ln -s $( pwd) /{}/mate2/Chimeric.out.junction $( dirname $( pwd ) ) /circtools/01_detect/{}.mate2.Chimeric.out.junction ::: ALL_1654_*
347366
348367 cd ..
349368 cd circtools/01_detect/
@@ -364,7 +383,7 @@ Additionally the newly created files, a reference genome in Fasta format as well
364383
365384 # step two: repeat masker file for the genome build:
366385 wget https://data.dieterichlab.org/s/mouse_repeats/download -O GRCm38_90_repeatmasker.gtf.bz2
367- bunzip GRCm38_90_repeatmasker.gtf.bz2
386+ bunzip2 GRCm38_90_repeatmasker.gtf.bz2
368387
369388
370389 Running circtools circRNA detection
@@ -376,20 +395,27 @@ After performing all preparation steps the detection module can now be started:
376395
377396 # Run circtools detection to detect circRNAs, using the Jakobi 2016 data set
378397
379- $ circtools detect @samplesheet \ # @ is generally used to specify a file name
380- -mt1 @mate1 \ # mate1 file containing the mate1 independently mapped chimeric.junction.out files
381- -mt2 @mate2 \ # mate2 file containing the mate1 independently mapped chimeric.junction.out files
382- -D \ # run in circular RNA detection mode
383- -R GRCm38_90_repeatmasker.gtf \ # regions in this GTF file are masked from circular RNA detection
384- -an Mus_musculus.GRCm38.90.gtf \ # annotation is used to assign gene names to known transcripts
385- -Pi \ # run in paired independent mode, i.e. use -mt1 and -mt2
386- -F \ # filter the circular RNA candidate regions
387- -M \ # filter out candidates from mitochondrial chromosomes
388- -Nr 5 6 \ minimum count in one replicate [1] and number of replicates the candidate has to be detected in [2]
389- -fg \ # candidates are not allowed to span more than one gene
390- -G \ # also run host gene expression
391- -A Mus_musculus.GRCm38.dna.primary_assembly.fa \ # name of the fasta genome reference file; must be indexed, i.e. a .fai file must be present
398+ $ circtools detect @samplesheet \
399+ -mt1 @mate1 \
400+ -mt2 @mate2 \
401+ -B @bam_files.txt \
402+ -D \
403+ -R GRCm38_90_repeatmasker.gtf \
404+ -an ../../Mus_musculus.GRCm38.90.gtf \
405+ -Pi \
406+ -F \
407+ -M \
408+ -Nr 5 6 \
409+ -fg \
410+ -G \
411+ -A Mus_musculus.GRCm38.dna.primary_assembly.fa
412+
413+ Circtools with the detect command is mostly a wrapper around the DCC tool.
414+ To learn more about the options used above please check:
415+
416+ .. code-block :: bash
392417
418+ $ DCC -h
393419
394420 .. note :: By default, circtools assumes that the data is stranded. For non-stranded data the ``-N`` flag should be used
395421
0 commit comments