annotate monorail.sh @ 5:d2d9937d1f9c draft

Uploaded
author chrisw
date Tue, 12 Feb 2019 13:51:52 -0500
parents ae546ad6f2f4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
1 set -o pipefail -o errexit
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
2
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
3 path2=$PATH
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
4
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
5 #e.g. /data7/references/ath10/star_idx
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
6 ref=$1
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
7 #e.g. 4
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
8 threads=$2
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
9 #e.g. 10
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
10 min_uniq_qual=$3
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
11 #e.g. ./ath10/gtf/exons.bed
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
12 annotation=$4
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
13 #e.g. ./tmp2
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
14 tmp=$5
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
15 #e.g. tmp/SRR8505407_SRP182756_ath10_sra_1.fastq.gz
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
16 reads1=$6
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
17 #e.g. tmp/SRR8505407_SRP182756_ath10_sra_2.fastq.gz, just leave off if not paired
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
18 reads2=$7
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
19
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
20 #align
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
21 STAR --runMode alignReads --runThreadN $threads --genomeDir ${ref} --readFilesIn $reads1 $reads2 --readFilesCommand zcat --twopassMode None --outReadsUnmapped Fastx --outMultimapperOrder Random --outSAMreadID Number --readFilesType Fastx --outTmpDir ./star_tmp --outSAMtype BAM Unsorted --outSAMmode NoQS --outSAMattributes NH MD --chimOutType Junctions --chimOutJunctionFormat 1 --chimSegmentReadGapMax 3 --chimJunctionOverhangMin 12 --chimSegmentMin 12 > star.log 2>&1
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
22
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
23 sout="Aligned.out.bam"
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
24
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
25 #sort
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
26 sorted_bam="sorted.bam"
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
27 samtools sort -T ./samtools_temp -@ $threads -m 64M -o $sorted_bam $sout > stools.log 2>&1
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
28 #index
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
29 samtools index -@ $threads $sorted_bam >> stools.log 2>&1
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
30
a25fa2b5e379 Uploaded
chrisw
parents:
diff changeset
31 #get coverage summaries
5
d2d9937d1f9c Uploaded
chrisw
parents: 4
diff changeset
32 bamcount $sorted_bam --threads $threads --coverage --no-head --require-mdz --min-unique-qual $min_uniq_qual --frag-dist bc --bigwig bc --annotation $annotation bc --auc bc --alts bc > bc.log 2>&1